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:
- equilibrium for generating "silent" frames.
- phase for a stepping phase, useful for oscillators.
- sine for generating a sine waveform.
- saw for generating a sawtooth waveform.
- square for generating a square waveform.
- noise for generating a noise waveform.
- noise_simplex for generating a 1D simplex noise waveform.
- gen for generating frames of type F from some
Fn() -> F
. - gen_mut for generating frames of type F from some
FnMut() -> F
. - from_iter for converting an iterator yielding frames to a signal.
- from_interleaved_samples_iter for converting an iterator yielding interleaved samples to a signal.
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 |
BranchRcA |
One of the two |
BranchRcB |
One of the two |
BranchRefA |
One of the two |
BranchRefB |
One of the two |
Buffered |
Buffers the signal using the given ring buffer. |
BufferedFrames |
An iterator that pops elements from the inner bounded ring buffer and yields them. |
Bus |
A type which allows for |
ClipAmp |
Clips samples in each frame yielded by |
ConstHz |
A constant phase step size. |
Delay |
Delays the |
DetectEnvelope |
An adaptor that detects and yields the envelope of the signal. |
Equilibrium |
An iterator that endlessly yields |
Fork |
Represents a forked |
FromInterleavedSamplesIterator |
An iterator that converts an iterator of |
FromIterator |
A type that wraps an Iterator and provides a |
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. |
Inspect |
A signal that calls its enclosing function and returns the original value. The signal may mutate state. |
IntoInterleavedSamples |
Converts a |
IntoInterleavedSamplesIterator |
Converts the |
Map |
A signal that maps from one signal to another |
MulAmp |
An iterator that yields the product of the frames yielded by both |
MulHz |
Multiplies the rate at which frames of |
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 |
Output |
An output node to which some signal |
Phase |
An iterator that yields a phase, useful for waveforms like Sine or Saw. |
Rate |
The rate at which phrase a Signal is sampled. |
Rms |
An adaptor that yields the RMS of the signal. |
Saw |
A saw wave signal generator. |
ScaleAmp |
An |
ScaleAmpPerChannel |
An |
Sine |
A sine wave signal generator. |
Square |
A square wave signal generator. |
Take |
An iterator that yields |
UntilExhausted |
Yields frames from the signal until the |
ZipMap |
A signal that iterates two signals in parallel and combines them with a function. |
Traits
Signal |
Types that yield |
Step |
Types that may be used to give a phase step size based on some |
Functions
equilibrium |
Provides an iterator that endlessly yields |
from_interleaved_samples_iter |
Create a new |
from_iter |
Create a new |
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. |
lift |
Consumes the given |
noise |
Produces a |
noise_simplex |
Produces a 1-dimensional simplex noise |
phase |
Creates a |
rate |
Creates a frame |
saw |
Produces a |
sine |
Produces a |
square |
Produces a |