Expand description
§aura-dsp — Audio DSP primitives
JUCE analogue: juce_dsp (processors, filters, oscillators, FX, maths).
MIDI messages/buffers live in aura-midi (not here).
Core synthesis/FX stack forked from naad (Sanskrit: primordial sound)
and now maintained as part of AURA:
oscillators, filters, envelopes, wavetables, modulation, delay, effects,
noise, tuning. Product-grade LX FX / analysis modules land under this crate
over time (fx/, analysis/) — not as separate product-only silos in the
framework tree.
Historical: this crate was forked from naad v1.2.5 (GPL-3.0-only, part of the AGNOS ecosystem — dhvani / svara).
§Architecture
All processing methods work on contiguous &mut [f32] slices. Hot-path
methods (next_sample, process_sample) are #[inline] for cross-crate
optimization. Buffer methods (fill_buffer, process_buffer) iterate
over slices, enabling SIMD auto-vectorization when compiled with
appropriate target features (-C target-cpu=native).
dhvani (the sound engine) handles buffer alignment and SIMD dispatch. aura-dsp provides the scalar reference implementations.
§Quick Start
use aura_dsp::oscillator::{Oscillator, Waveform};
use aura_dsp::envelope::Adsr;
use aura_dsp::filter::{BiquadFilter, FilterType};
// Create a 440 Hz sine oscillator
let mut osc = Oscillator::new(Waveform::Sine, 440.0, 44100.0).unwrap();
// Create an ADSR envelope
let mut env = Adsr::new(0.01, 0.1, 0.7, 0.3).unwrap();
// Create a low-pass filter at 2kHz
let mut filter = BiquadFilter::new(FilterType::LowPass, 44100.0, 2000.0, 0.707).unwrap();
// Generate a sample
env.gate_on();
let sample = osc.next_sample() * env.next_value();
let filtered = filter.process_sample(sample);§Feature Flags
default— All core primitives (oscillators, filters, envelopes, effects, dynamics, EQ, reverb, voice, mod matrix, panning, smoothing, tuning, noise, delay, wavetable,dsp_util)synthesis— Synthesis algorithm modules (subtractive, FM, drum, formant, additive, vocoder, granular, physical modeling)acoustics— Room simulation, convolution reverb, binaural, FDN, analysis, ambisonics (via goonj)logging— Enable tracing-subscriber for structured logging outputfull— All features enabled
§API Conventions
These conventions apply uniformly across the crate. Knowing them up front avoids surprises when wiring aura-dsp into a host (dhvani, svara, etc.).
§Encapsulation
- Stateful types with non-trivial invariants (e.g.
oscillator::Oscillator,filter::BiquadFilter,wavetable::Wavetable) keep their fields private and expose validated setters. Modifying state requires a constructor or a typed mutator — there is no way to silently break the invariant. - Parameter structs that are pure value-bags read directly by their owning
type (e.g.
dynamics::Compressor::threshold_db,envelope::Adsr::sustain_level) keeppubfields. They are documented when modifying them bypasses constructor-time clamping; callers may set arbitraryf32values and accept whatever output the algorithm produces.
Rule of thumb: if changing a field requires recomputing cached coefficients
or affects internal state coupling, it is private. If it only feeds a
direct read in the next-sample loop, it may be pub.
§Constructor return types
- Constructors that validate
sample_rate,frequency, or other range-restricted inputs returnResult. Examples:oscillator::Oscillator::new,filter::BiquadFilter::new,envelope::Adsr::new. - Constructors that only clamp inputs (e.g. amplitude to
0..=1) are infallible — they take anyf32and store the clamped result. Examples:dynamics::LevelDetector::new,smoothing::ParamSmoother::new. - Index-based mutators (
set_operator_freq,set_band_gain) that may receive an out-of-range index returnOption<()>orResult<()>so callers can detect — and not silently ignore — bad indices.
Re-exports§
Modules§
- acoustics
- Acoustic simulation wrappers around the
goonjcrate. - analysis
- Portable analysis: FFT/SNAP maths, spectrum, meter blocks (no vault/MD/*Shared). Portable analysis primitives for plugins / hosts.
- dc_
blocker - One-pole DC blocker for bus / master paths.
- delay
- Delay lines, comb filters, and allpass delay networks.
- dsp_
util - DSP utility functions: dB conversion, clipping, interpolation.
- dynamics
- Dynamics processors: compressor, limiter, and noise gate.
- effects
- Audio effects: chorus, flanger, phaser, and distortion.
- envelope
- ADSR envelope generator and multi-stage envelopes.
- eq
- Parametric and graphic equalizers.
- error
- Error types for the aura-dsp synthesis crate.
- filter
- Biquad, state-variable, and ladder filters.
- fx
- LX product-grade FX (from
lx-dsp): TDF-II biquad, mastering, meters, … Product-grade FX / metering ported fromlx-dsp(LX Audiolabs plugins). - mod_
matrix - Modulation matrix for flexible source-to-destination routing.
- mod_
route_ table - Fixed-capacity modulation route table.
- modulation
- Modulation sources: LFO, FM synthesis, and ring modulation.
- noise
- Noise generators: white, pink (Voss-McCartney), and brown noise.
- oscillator
- Oscillator module with band-limited waveform generation.
- panning
- Stereo panning utilities.
- reverb
- Algorithmic reverb based on the Schroeder topology.
- smoothing
- Parameter smoothing for click-free transitions.
- synth
- Synthesis algorithm modules.
- tempo
- Tempo / beat math for synced clocks and sequencers.
- tuning
- Tuning and pitch utilities.
- voice
- Voice management for polyphonic synthesis.
- wavetable
- Wavetable synthesis with morphing support.
Functions§
- flush_
denormal - Flush denormal floating-point values to zero.