Skip to main content

Crate aura_dsp

Crate aura_dsp 

Source
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 output
  • full — 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

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

Re-exports§

pub use error::DspError;
pub use error::Result;

Modules§

acoustics
Acoustic simulation wrappers around the goonj crate.
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 from lx-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.