The modules
audiodsp is CircuitPython’s audio system for MicroPython and CPython:
audiocore, audiomixer, synthio (including MidiTrack), the effects
modules (audiofilters, audiodelays, audiofreeverb, audiospeed),
audiomp3, and CircuitPython’s play(), stop(), pause() and resume()
output semantics. Import names stay audiocore, synthio and the rest,
matching CircuitPython, so source runs unchanged; the few behaviours that
differ are in
Where audiodsp differs from CircuitPython.
It adds modules CircuitPython doesn’t have (why each exists). Each has a page here or a guide:
Module |
What it does |
Where |
|---|---|---|
|
Biquad and all-pass filters whose tails reach exact zero |
|
|
Compression, limiting, expansion, gating, transient shaping |
|
|
A delay with a filter, a soft-clip and a cross-feed in its feedback loop |
|
|
|
|
|
A waveshaper whose curve is data, and an exact-ratio sample-and-hold |
|
|
A transistor ladder filter |
|
|
A reverberation tank whose line lengths and taps come from Python |
|
|
Multiply one stream by another, divide one down in frequency, and |
|
|
Apply an impulse response by partitioned FFT |
|
|
A band-limited oscillator read sample by sample |
|
|
A bank of resonators |
|
|
A whole patch rendered by one C call per block |
|
|
Recorded notes played at any pitch, looped, under an envelope |
|
|
Band levels for a spectrum meter |
|
|
Speech features and voice activity for a wake word model |
|
|
Ogg Vorbis files |
|
|
The audio pull, off the interpreter thread |
Beside the core
Two pure-Python modules sit beside the CircuitPython-compatible core:
lib/audiodsp_util/—float32(value)andfloat32_bits(value),structand nothing else. A Python float is the interpreter’s own width: a double here, a single on every board. So a setting written in Python —node.mix = 0.35— is two different numbers, and the node renders different bytes on a board than on a desktop before its kernel is reached. Put a derived setting throughfloat32and both targets hold the number the board would have held. See docs/correctness-standard.md.lib/audiorender/— renders a whole composition offline: tracks, tempo map, notes and automation in, a mixed stereo master and a level report out. This is the one part of the repository written for a desktop rather than a board — numpy throughout, a whole song in memory — so it ships in the wheel and is never frozen into firmware. It has its own README.
Instruments and effects built on these modules are in their own libraries,
audioinstruments and
audioeffects, which also define
the component contract they share. audiorender drives any component that
speaks that contract and doesn’t need either library installed. What stays the
same across releases, for audiodsp and for them, is in
Sound stability.