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

A multiplier that moves over the length of a note, as `{progress, value}` breakpoints.

    Curve.new([{0.0, 1.0}, {0.5, 1.5}, {1.0, 1.0}])

# `point`

```elixir
@type point() :: {float(), float()}
```

# `t`

```elixir
@type t() :: [point()]
```

# `at`

```elixir
@spec at(t(), float()) :: float()
```

The value at `progress`, 0.0 at the start of a note and 1.0 at its end.

Interpolated in a straight line between breakpoints; before the first breakpoint and after
the last it is that breakpoint's value.

# `flat?`

```elixir
@spec flat?(t() | nil) :: boolean()
```

Whether a curve holds one value throughout. True of `nil` and of a single-point curve.

# `hold`

```elixir
@spec hold(number()) :: t()
```

A curve that stays at `value` throughout. `flat?/1` is true of it.

# `linear`

```elixir
@spec linear(number(), number()) :: t()
```

A curve going straight from `from` at progress 0.0 to `to` at progress 1.0.

# `new`

```elixir
@spec new([{number(), number()}]) :: t()
```

A curve from `{progress, value}` pairs, sorted by progress.

Progress runs 0.0 at the start of a note to 1.0 at its end; `value` is a multiplier over the
field the curve is attached to. Both members of each pair are converted to floats. Raises
`ArgumentError` on an empty list. Points outside 0.0 to 1.0 are kept rather than dropped or
clamped.

# `simplify`

```elixir
@spec simplify(t(), pos_integer()) :: t()
```

Thin a curve down to at most `count` breakpoints, keeping its shape.

The first and last points are always kept. A curve already at or under `count` points is
returned unchanged. Raises `ArgumentError` when `count` is under 2.

---

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