Module sample::signal [] [src]

Use the Signal trait for working with Iterators that yield Frames. To complement the Iterator trait, Signal provides methods for adding, scaling, offsetting, multiplying, clipping and generating frame iterators and more.

You may also find a series of Signal source functions, including:

Working with Signals allows for easy, readable creation of rich and complex DSP graphs with a simple and familiar API.

Structs

AddAmp

An iterator that yields the sum of the frames yielded by both other and self in lock-step.

Bus

A type which allows for sending a single Signal to multiple outputs.

ClipAmp

Clips samples in each frame yielded by signal to the given threshhold amplitude.

ConstHz

A constant phase step size.

Delay

Delays the signal by the given number of frames.

Equilibrium

An iterator that endlessly yields Frames of type F at equilibrium.

FromInterleavedSamples

An iterator that converts an iterator of Samples to an iterator of Frames.

Gen

A signal that generates frames using the given function.

GenMut

A signal that generates frames using the given function which may mutate some state.

Hz

An iterator that yields the step size for a phase.

MulAmp

An iterator that yields the product of the frames yielded by both other and self in lock-step.

MulHz

Multiplies the rate at which frames of self are yielded by the given signal.

Noise

A noise signal generator.

NoiseSimplex

A 1D simplex-noise generator.

OffsetAmp

Provides an iterator that offsets the amplitude of every channel in each frame of the signal by some sample value and yields the resulting frames.

OffsetAmpPerChannel

An Iterator that scales the amplitude of every Frame in self by the respective amplitudes in each channel of the given amp Frame.

Output

An output node to which some signal S is Outputing its frames.

Phase

An iterator that yields a phase, useful for waveforms like Sine or Saw.

Rate

The rate at which phrase a Signal is sampled.

Saw

A saw wave signal generator.

ScaleAmp

An Iterator that scales the amplitude of the sample of each channel in every Frame yielded by self by the given amplitude.

ScaleAmpPerChannel

An Iterator that scales the amplitude of every Frame in self by the respective amplitudes in each channel of the given amp Frame.

Sine

A sine wave signal generator.

Square

A square wave signal generator.

ToSamples

Converts a Signal to an Iterator yielding Samples of the signal.

Traits

Signal

A trait that allows us to treat Iterators that yield Frames as a multi-channel PCM signal.

Step

Types that may be used to give a phase step size based on some hz / sample rate.

Functions

equilibrium

Provides an iterator that endlessly yields Frames of type F at equilibrium.

from_interleaved_samples

An iterator that converts the given Iterator yielding Samples to a Signal yielding frames of type F.

gen

A signal that generates frames using the given function.

gen_mut

A signal that generates frames using the given function which may mutate some state.

noise

Produces a Signal that yields random values between -1.0..1.0.

noise_simplex

Produces a 1-dimensional simplex noise Signal.

phase

Creates a Phase that continuously steps forward by the given step size yielder.

rate

Creates a frame Rate (aka sample rate) representing the rate at which a signal may be sampled.

saw

Produces a Signal that yields a saw wave oscillating at the given hz.

sine

Produces a Signal that yields a sine wave oscillating at the given hz.

square

Produces a Signal that yields a square wave oscillating at the given hz.