Module sampara::signal[][src]

Structs

AddAmp

Adds a constant Sample to each channel in each Frame from a Signal.

AddFrame

Adds a constant Frame to each Frame from a Signal.

AddSignal

Adds together pairs of Frames from two Signals in lockstep and yields their sum.

Constant

A Signal that yields a given Frame repeatedly forever.

Delay

Delays a Signal a given number of Frames by yielding Frame::EQUILIBRIUM that many times before yielding from the contained Signal.

Empty

A Signal that yields zero Frames, mainly used in combination with other Signals.

Equilibrium

A Signal that yields Frame::EQUILIBRIUM forever.

Fixed
FromFn

A Signal that yields Frames by calling a closure for each iteration. This closure should return Option<Frame>.

FromFrames

A Signal that is powered by an underlying Iterator that yields Frames.

FromSamples

A Signal that is powered by an underlying Iterator that yields Samples.

Inspect

Creates a new Signal that calls a function with each Frame, and then yields the Frame.

IntoIter

Converts a Signal into a Iterator.

Map

Maps a function to each Frame from a Signal and yields a new Frame.

MulAmp

Multiplies a constant Sample to each channel in each Frame from a Signal.

MulFrame

Multiplies a constant Frame to each Frame from a Signal.

MulSignal

Multiplies together pairs of Frames from two Signals in lockstep and yields their product.

Phase

A Signal that wraps a Delta and accumulates it in an automated way, wrapping it to the interval [0.0, 1.0) as needed.

Saw

A saw wave Signal generator.

Sine

A sine wave Signal generator.

Square

A square wave Signal generator.

Take

Creates a new Signal that yields the first N Frames of a Signal, and then stops.

Variable
ZipMap

Maps a function to each pair of Frames from two Signals in lockstep and yields a new Frame.

Traits

Delta

Types that can produce a phase step size, usually based on a target frequency divided by a sampling frequency (sample rate).

Signal

Types that yield a sequence of Frames, representing an audio signal.

Functions

constant

Creates a new Signal where each Frame is copied from a given constant Frame.

empty

Creates an empty Signal that yields no Frames.

equilibrium

Creates a new Signal that always yields Frame::EQUILIBRIUM.

from_fn

Creates a new Signal where each Frame is yielded by calling a given closure that produces a Option<Frame> for each iteration.

from_frames

Creates a new Signal by wrapping an iterable that yields Frames.

from_samples

Creates a new Signal by wrapping an iterable that yields [Samples]s. These Samples are assumed to be interleaved, and in channel order. The resulting Signal will read these Samples into Frames of the desired size, and yield them. Any trailing Samples that do not fully complete a Frame will be discarded.

phase_hz

Creates a Phase with a constant Frame of frequencies.

phase_hzs

Creates a Phase with Frames of deltas over time, as yielded by a Signal.

phase_step

Creates a Phase with a constant Frame of deltas.

phase_steps

Creates a Phase with Frames of deltas over time, as yielded by a Signal.