TuningFork.Reverb (TuningFork v0.1.11)

Copy Markdown View Source

A reverb whose state carries between calls: Freeverb, eight comb filters into four allpasses on each channel.

reverb = TuningFork.Reverb.new(44_100)
{wet, reverb} = TuningFork.Reverb.run(reverb, pcm, 2, 0.3, 0.6)

Summary

Functions

A silent room at rate samples per second.

Run pcm through the room and return the wet signal and the state to carry to the next call.

The room's own sound for pcm and nothing of pcm itself, for a caller mixing the two in its own proportions. channels and size are as run/5 takes them.

Types

channel()

@type channel() :: %{
  combs: [{:queue.queue(float()), float()}],
  allpasses: [:queue.queue(float())]
}

t()

@type t() :: %TuningFork.Reverb{
  left: channel(),
  rate: pos_integer(),
  right: channel()
}

Functions

new(rate)

@spec new(pos_integer()) :: t()

A silent room at rate samples per second.

run(reverb, pcm, channels, mix, size)

@spec run(t(), binary(), pos_integer(), number(), number()) :: {binary(), t()}

Run pcm through the room and return the wet signal and the state to carry to the next call.

mix is how much of the room comes back, 0.0 to 1.0, and size how long the room rings, in seconds to silence, 0.1 to 10. channels is how the PCM is interleaved: stereo goes through a left and a right room that differ slightly, mono through the left. A mix at or below zero returns the input untouched and leaves the state as it was.

wet(reverb, pcm, channels, size)

@spec wet(t(), binary(), pos_integer(), number()) :: {binary(), t()}

The room's own sound for pcm and nothing of pcm itself, for a caller mixing the two in its own proportions. channels and size are as run/5 takes them.