# `TuningFork.Wave`
[🔗](https://github.com/jaman/tuning_fork/blob/v0.1.11/tuning_fork/lib/tuning_fork/wave.ex#L1)

Oscillators, as functions from phase (0.0 to 1.0 over one cycle) to amplitude (-1.0 to 1.0).

    TuningFork.Wave.sample(:sine, 0.25)

# `seed`

```elixir
@type seed() :: integer()
```

# `shape`

```elixir
@type shape() :: :sine | :square | :saw | :triangle
```

# `noise`

```elixir
@spec noise(seed()) :: {float(), seed()}
```

One sample of white noise, from -1.0 to 1.0, and the seed for the next. The same seed
always gives the same sequence.

# `sample`

```elixir
@spec sample(shape(), float()) :: float()
```

One sample of `shape` at `phase`, with no band limiting.

`phase` is a position in the cycle from 0.0 to 1.0. The result runs -1.0 to 1.0.

# `sample`

```elixir
@spec sample(shape(), float(), float()) :: float()
```

One sample of `shape` at `phase`, band limited for a phase step of `step` per sample.

`step` is `freq / rate`. A `step` of 0.0 gives the raw shape. `:sine` and `:triangle`
ignore `step`.

# `seed`

```elixir
@spec seed(term()) :: seed()
```

A seed for `noise/1`, from any term.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
