nanodsp¶
High-performance Python DSP toolkit built on C++ libraries via nanobind. All processing uses float32 in a planar [channels, frames] layout with block-based APIs that accept and return AudioBuffer objects.
Features¶
- 190+ DSP functions -- filters, effects, dynamics, reverb, synthesis, analysis, spectral processing, granular synthesis
- 11 C++ backends -- signalsmith, DaisySP, STK, madronalib, HISSTools, CHOC, GrainflowLib, fxdsp, DspFilters, vafilters, PolyBLEP
- Zero-copy where possible -- numpy arrays pass directly to C++ with GIL release for true multi-threaded parallelism
- CLI included -- process, analyze, synthesize, convert, and benchmark audio from the command line
- 30 built-in presets -- mastering, voice, spatial, dynamics, creative, lo-fi, cleanup
Quick start¶
from nanodsp.buffer import AudioBuffer
from nanodsp.effects import filters, dynamics
from nanodsp import analysis
buf = (
AudioBuffer.from_file("input.wav")
.pipe(filters.highpass, cutoff_hz=80.0)
.pipe(dynamics.compress, threshold=-18.0, ratio=4.0)
.pipe(analysis.normalize_lufs, target_lufs=-14.0)
)
buf.write("output.wav")
Install¶
Or build from source:
Backends¶
| Library | License | What it provides |
|---|---|---|
| signalsmith-dsp | MIT | Filters, FFT, delay, envelopes, spectral processing, rates, mix |
| DaisySP | MIT | Oscillators, effects, dynamics, drums, physical modeling, noise |
| STK | MIT | Physical modeling instruments, generators, filters, delays, effects |
| madronalib | MIT | FDN reverbs, resampling, generators, projections, windows |
| HISSTools Library | BSD-3 | Convolution, spectral processing, statistical analysis, windows |
| CHOC | ISC | FLAC codec (read/write) |
| GrainflowLib | MIT | Granular synthesis |
| fxdsp | MIT | Antialiased waveshaping, classic reverbs, formant filter, PSOLA, ping-pong delay, frequency shifter, ring modulator |
| DspFilters | MIT | Multi-order IIR filter design |
| vafilters | MIT | Virtual analog filters (Moog, Diode, Korg35, Oberheim) |
| PolyBLEP et al. | MIT | Band-limited oscillators |