Skip to main content

Crate alpha2_audio

Crate alpha2_audio 

Source
Expand description

Platform-independent, real-time-safe audio DSP primitives and graph.

Structs§

AudioGraph
Clip chain -> track bus -> master bus graph with deterministic latency aggregation.
AudioGraphState
Complete graph history captured between offline chunks.
AutomatedGain
Sample-accurate gain driven by an immutable automation curve.
AutomationCurve
Immutable piecewise-linear automation prepared off the realtime thread.
AutomationPoint
One sample-addressed automation point.
Biquad
Two-channel transposed-direct-form-II biquad.
ChainStateError
Where a ProcessorChain refused a saved state, and why. The chain is left as it was.
Compressor
Linked-channel compressor with deterministic lookahead and soft attack/release.
Ducker
Sidechain ducker. Inputs are program channels followed by matching sidechain channels.
EnvelopeFollower
Reusable peak envelope follower.
EqualPowerCrossfade
Equal-power crossfade between two planar input buses.
Gain
Stateless linear amplitude multiplier.
Interpolator
The band-limited interpolation a clip played at another speed reads its source through: the same Kaiser-windowed sinc as Resampler (16 taps a side at unity, cutoff 0.97 of the Nyquist frequency, beta 9), at any real source position. Played faster than unity, the cutoff falls to the output’s Nyquist frequency and the filter widens in proportion, as a falling rate does, so what the speed raises past the output’s Nyquist frequency is removed rather than folded back. Slower, the source’s Nyquist frequency bounds it, so no image of the source’s spectrum is heard.
LinearFade
Sample-addressed linear fade independent of host block size.
LoudnessMeter
A streaming BS.1770-4 / EBU R128 loudness meter.
LoudnessNormalization
A static gain that brings a measured mix to a loudness target without letting its true peak exceed a ceiling, or its sample peak reach a master limiter after it.
LoudnessReport
What a LoudnessMeter has measured.
PeakLimiter
Linked-channel peak limiter with instantaneous attack and exponential release.
ProcessCtx
Immutable information for one DSP invocation.
ProcessorChain
Ordered processor chain with all realtime scratch allocated by prepare.
ResampleError
Why a converter could not be made.
Resampler
A band-limited converter from one sample rate to another.
SchroederReverb
Allocation-free prepared Schroeder reverb with four combs and two allpasses.
StateBlob
Opaque processor state saved outside the real-time process path.
TimeStretchProcessor
Deterministic two-tap delay-line pitch shifter with a fixed prepared window (20 ms).
Waveform
A finished waveform summary: its levels, finest first.
WaveformBucket
The extremes and RMS of one run of samples of one channel.
WaveformLevel
One zoom level of a Waveform.
WaveformSummary
Builds a Waveform from planar samples streamed in blocks.

Enums§

BiquadKind
Common parametric equalizer shapes.
ChainError
Why a ProcessorChain refuses a processor.
ChannelLayout
Validated channel organization used at every host boundary.
FadeDirection
Direction of a linear amplitude fade.
GraphStateError
Where an AudioGraph refused a saved state, and why. The graph is left as it was.
LoudnessError
Why a meter cannot be configured or fed.
StateError
Why a processor, a crate::ProcessorChain or an crate::AudioGraph refuses a saved state. A refused state changes nothing: what refuses it is left as it was.
TransportState
Current host transport state supplied without consulting a platform clock.
WaveformError
Why a waveform summary cannot be configured or fed.

Constants§

ABSOLUTE_GATE_LUFS
The level below which a block never counts, in LUFS.
LIMITER_MARGIN_DB
How far below a master limiter’s threshold a normalized mix keeps its sample peak, in dB, so the limiter (which acts only on a sample above its threshold) leaves it alone. It covers the rounding of the 32-bit gain and of each sample multiplied by it (a few parts in 10^7, about 2e-6 dB) a thousand times over, and is far below an audible level change.
MAX_DOWNSAMPLE_FACTOR
The most the rate may fall: a source rate at most this many times the target rate. A falling rate widens the filter in proportion (16 taps a side per factor), and past this fall the filter alone would not fit the table. 768 kHz converts down to 94 Hz.
MAX_FILTERED_SPEED
The fastest playback whose filter narrows with its speed. Faster clips keep this filter, so one output sample weighs at most 2 * HALF_TAPS * MAX_FILTERED_SPEED source samples.
MAX_FREQUENCY_FRACTION
Highest frequency a filter renders, as a fraction of the sample rate.
MAX_PEAKING_GAIN_DB
Largest peaking gain a filter renders, in decibels either way.
MAX_RATIO
Largest ratio a compressor renders.
MAX_RESAMPLE_RATE
The highest rate either side may have.
MAX_WAVEFORM_LEVELS
Most zoom levels: a 1-sample base reaches 4^15 samples, over six hours at 48 kHz, which is coarser than any timeline shows.
MIN_FREQUENCY_HZ
Lowest frequency a filter renders, in hertz.
Q_RANGE
The resonances a filter renders.

Traits§

Processor
Stateful DSP unit whose process method performs no allocation or locking.