InfiniteDSP Core
A modular, high-performance audio DSP library for Rust, designed for real-time synthesis and effects processing.
It is no_std compatible (requires alloc), making it suitable for embedded audio applications as well as desktop software.
Features
no_stdCompatible: Built for portability usinglibmandalloc.- Type-Safe Channel System: Explicit
MonoandStereotypes prevent routing errors. - Modular Architecture: Build complex audio chains using
DspChainandMixer. - Static Dispatch: Use
StaticDspChainfor zero-overhead composition of processors, allowing for aggressive compiler inlining. - AudioParam System: All parameters can be static, linked to thread-safe controls (atomics), or modulated by other audio signals (e.g., LFOs, Envelopes) at sample rate.
- Signal Math: Combine signals easily with
AddandMultiplyprocessors. - SIMD Optimization: Uses
widefor SIMD-accelerated processing where applicable. - Graph Visualization: Generate ASCII diagrams of your signal chain for easy debugging (
chain.get_graph()). - Spectral Processing: Includes a robust Overlap-Add (OLA) engine for FFT-based effects.
- Comprehensive Effect Suite:
- Time: Delay (Standard & LowMem), Tape Delay (with saturation & flutter), PingPongDelay, Reverb (Schroeder, Standard & LowMem).
- Filter: Biquad (LowPass, HighPass, BandPass, Notch), Ladder Filter (Moog-style, both Iterative and Predictive ZDF), State Variable Filter (TPT/ZDF).
- Dynamics: Compressor, Limiter, Distortion (Soft/Hard Clip, BitCrush, Foldback).
- Modulation: Phaser, Tremolo, Ring Modulator, Chorus, Flanger.
- Spectral: FFT Pitch Shift, Granular Pitch Shift, Spectral Filter.
- Utility: Gain, Offset, Stereo Panner, Stereo Widener, MapRange, TimedGate.
- Synthesis:
- Oscillators: Sine, Triangle, Saw, Square (PolyBLEP anti-aliased), Noise.
- Physical Modeling: Karplus-Strong (String), Brass Model.
- Control: LFO, ADSR Envelope (with retrigger support).
Benchmarks
Performance is tracked over time to ensure no regressions. View Benchmark Charts
Documentation
Demos
Listen to some of the examples generated with this library:
Showcase
Check out these projects built with infinitedsp-core:
Project Structure
src/core: Core traits and infrastructure (FrameProcessor,AudioParam,DspChain,Ola,ParallelMixer,SummingMixer,Stereo).src/effects: Audio effects implementations.src/synthesis: Sound generators and control signals.examples_app: A separate workspace member containing runnable examples usingcpal.
Usage
Add infinitedsp-core to your dependencies.
use DspChain;
use AudioParam;
use Mono;
use ;
use Delay;
// Create an oscillator (Mono source)
let osc = new;
// Create a delay effect (Mono effect)
let delay = new;
// Chain them together. The chain is typed as DspChain<Mono>.
let mut chain = new.and;
// Print the signal chain (requires 'debug_visualize' feature)
println!;
// Process a buffer
let mut buffer = ;
chain.process;
Feature Flags
debug_visualize: Enablesget_graph()andvisualize()methods for debugging signal chains. Disabled by default to minimize binary size for embedded targets.
Running Examples
The project includes several runnable examples in the examples_app folder that demonstrate different capabilities using cpal for real-time audio output.
Run an example using:
Available Examples:
infinitedsp_demo: A complex polyphonic demo showcasing 30 voices, filters, envelopes, and effects (Stereo).filter_sweep: ComparesPredictiveLadderFiltervsLadderFilterwith an LFO sweep (Mono).dual_mono_demo: Demonstrates independent processing of Left/Right channels (Ping-Pong Delay).ping_pong_demo: Demonstrates the stereo PingPongDelay effect.trance_synth: A massive stereo supersaw trance pluck with delay, reverb, and a sequencer.karplus_demo: Physical modeling of a guitar string (Karplus-Strong algorithm) (Mono).svf_demo: State Variable Filter demonstration (BandPass sweep).spectral_demo: FFT-based Pitch Shifting using the Overlap-Add (OLA) engine.granular_demo: Time-domain Granular Pitch Shifting.modulation_demo: Showcases Tremolo, Chorus, and Tape Delay.phaser_demo: 6-stage Phaser effect.effects_demo: Demonstrates signal math (Add/Multiply) and distortion.
Documentation
To generate and view the API documentation:
AI Contribution Policy
This project allows and encourages experimentation with AI agents for code generation and optimization. However, all AI-generated contributions must be strictly verified by a human maintainer. This verification includes:
- Code Review: Ensuring the code is idiomatic, safe, and follows project standards.
- Audio Verification: Listening to the output to ensure correctness and high audio quality (no artifacts, correct DSP behavior).
License
This project is licensed under the MIT License - see the LICENSE file for details.