TuningFork.Fx.Live (TuningFork v0.1.11)

Copy Markdown View Source

Effects on a stream, a block at a time, carrying their state between blocks.

state = Live.new([reverb: [room: 0.8, mix: 0.3]], 44_100, 2)
{pcm, state} = Live.advance(state, chunk)

Summary

Functions

Run a block of PCM through, returning it and the state to use for the next block.

Build the state for a list of effects.

The effect names this runs that TuningFork.Fx has no whole-buffer version of.

Types

t()

@type t() :: %TuningFork.Fx.Live{channels: pos_integer(), stages: [map()]}

Functions

advance(state, pcm)

@spec advance(t(), binary()) :: {binary(), t()}

Run a block of PCM through, returning it and the state to use for the next block.

The result is the same length as pcm. State with no effects returns the block unchanged.

new(effects, rate, channels \\ 2)

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

Build the state for a list of effects.

effects is what TuningFork.Fx.apply/4 takes — [reverb: [...], echo: [...]] — with the same option keys and defaults. rate is samples per second and channels samples per frame, default 2. An unknown effect name raises ArgumentError.

streamed()

@spec streamed() :: [atom()]

The effect names this runs that TuningFork.Fx has no whole-buffer version of.