DaisySP DSP Module Catalog & API Reference¶
This reference document provides an exhaustive, parameter-by-parameter catalog of all 60+ DSP modules across both the MIT Core and LGPL Submodule of the DaisySP library.
1. Synthesis Modules¶
Oscillator (MIT)¶
- Header:
Synthesis/oscillator.h - Waveforms:
WAVE_SIN,WAVE_TRI,WAVE_SAW,WAVE_RAMP,WAVE_SQUARE,WAVE_POLYBLEP_TRI,WAVE_POLYBLEP_SAW,WAVE_POLYBLEP_SQUARE - API:
void Init(float sample_rate): Sets defaults (100 Hz, amp 0.5, sine).void SetWaveform(uint8_t wf): Selects waveform enum.void SetFreq(float freq): Sets fundamental frequency in Hz.void SetAmp(float amp): Sets amplitude (\(0.0 - 1.0\)).void SetPw(float pw): Sets pulse width for square waveforms (\(0.0 - 1.0\)).bool IsEOR(): True if cycle is at end-of-rise.float Process(): Computes next audio sample.
Fm2 (MIT)¶
- Header:
Synthesis/fm2.h - Architecture: 2-operator Phase Modulation (FM).
- API:
void Init(float sample_rate): Initializes carrier and modulator.void SetFrequency(float freq): Carrier frequency in Hz.void SetRatio(float ratio): Ratio of modulator to carrier.void SetIndex(float index): Modulation depth / index.float Process(): Evaluates FM output sample.
VariableShapeOscillator (MIT)¶
- Header:
Synthesis/variableshapeosc.h - Origin: Ported from Mutable Instruments Plaits (
variable_shape_oscillator.h). - API:
void Init(float sample_rate)void SetFreq(float freq)void SetWaveshape(float shape): \(0.0\) = saw/ramp/triangle, \(1.0\) = square.void SetPW(float pw): Controls symmetry/pulse width.void SetSync(bool sync): Enables internal hard sync oscillator.float Process()
VariableSawOscillator (MIT)¶
- Header:
Synthesis/variablesawosc.h - Origin: Mutable Instruments Plaits. Morphs between variable ramp slopes and notches.
- API:
Init(sr),SetFreq(f),SetPW(pw),SetWaveshape(shape),Process().
FormantOscillator (MIT)¶
- Header:
Synthesis/formantosc.h - Origin: Mutable Instruments Plaits. Dual-formant vocal tract synthesizer.
- API:
Init(sr),SetCarrierFreq(f),SetFormantFreq(f),SetPhaseShift(phase),Process().
HarmonicOscillator (MIT)¶
- Header:
Synthesis/harmonic_osc.h - Architecture: Additive synthesis generating harmonic partials with arbitrary weights.
- API:
Init(sr),SetFreq(f),SetAmplitudes(const float* amps),Process().
OscillatorBank (MIT)¶
- Header:
Synthesis/oscillatorbank.h - Architecture: Parallel detuned oscillator cluster for supersaw and swarm textures.
- API:
Init(sr),SetFreq(f),SetAmplitudes(amps),SetGain(gain),Process().
VosimOscillator (MIT)¶
- Header:
Synthesis/vosim.h - Architecture: Voice simulation decaying sin-squared pulse trains.
- API:
Init(sr),SetFreq(f),SetFormantFreq(f1, f2),SetShape(shape),Process().
ZOscillator (MIT)¶
- Header:
Synthesis/zoscillator.h - Origin: Inspired by Casio CZ phase-distortion and Mutable Instruments Plaits.
- API:
Init(sr),SetFreq(f),SetFormantFreq(f),SetShape(s),SetMode(m),Process().
BlOsc (LGPL)¶
- Header:
DaisySP-LGPL/Source/Synthesis/blosc.h - Origin: Soundpipe / Faust (Julius Smith).
- Waveforms:
WAVE_TRIANGLE,WAVE_SAW,WAVE_SQUARE,WAVE_OFF. - API:
Init(sr),SetFreq(f),SetAmp(a),SetPw(pw),Process().
2. Filter Modules¶
Svf (MIT)¶
- Header:
Filters/svf.h - Architecture: Double-sampled stable Chamberlin state-variable filter.
- Outputs: Simultaneous Lowpass, Highpass, Bandpass, Notch, and Peak.
- API:
void Init(float sample_rate)void SetFreq(float freq): Cutoff frequency in Hz (\(0\) to \(f_s/3\)).void SetRes(float res): Resonance (\(0.0 - 1.0\)).void SetDrive(float drive): Non-linear saturation factor.void Process(float in): Evaluates filter states (returnsvoid).float Low(): Extracts lowpass output.float High(): Extracts highpass output.float Band(): Extracts bandpass output.float Notch(): Extracts notch output.float Peak(): Extracts peak output.
LadderFilter (MIT)¶
- Header:
Filters/ladder.h - Architecture: Huovilainen New Moog (HNM) 4-pole transistor ladder with 4x oversampling.
- Modes:
FilterMode::LP24,LP12,BP24,BP12,HP24,HP12. - API:
void Init(float sample_rate)void SetFilterMode(FilterMode mode)void SetFreq(float freq): Cutoff in Hz (\(5\text{ Hz}\) to Nyquist).void SetRes(float res): Resonance (\(0.0 - 1.8\), self-oscillates).void SetPassbandGain(float pbg): Mitigates bass drop at high resonance (\(0.0 - 0.5\)).void SetInputDrive(float drv): Drive into tanh clipper (\(0.0 - 4.0\)).float Process(float in): Single sample processing.void ProcessBlock(float* buf, size_t size): In-place block processing.
FIR (MIT)¶
- Header:
Filters/fir.h - Architecture: Template
FIR<size_t max_size, size_t max_block>. Automatically activatesFIRFilterImplARM(CMSIS-DSP SIMD) on ARM targets with-DUSE_ARM_DSP. - API:
Init(const float* ir, size_t len, bool reverse),Process(float in),ProcessBlock(src, dst, size).
OnePole (MIT)¶
- Header:
Filters/onepole.h - API:
Init(),SetFrequency(f),SetMode(FILTER_MODE_LOW_PASS / HIGH_PASS),Process(in).
Soap (MIT)¶
- Header:
Filters/soap.h - Architecture: Tom Erbe's Second Order All Pass filter.
- API:
Init(sr),SetCenterFreq(f),SetFilterBandwidth(bw),Process(in),Bandpass(),Bandreject().
LGPL Filters¶
MoogLadder: Csound Moog ladder model (Init,SetFreq,SetRes,Process).Biquad: Direct Form I/II biquad IIR filter (Init,SetCutoff,SetRes,Process).Tone/ATone: Csound 1-pole Lowpass and Highpass filters.Comb/Allpass: Feedback delay filters with user buffers.Mode: 2nd-order resonant modal filter.NlFilt: Nonlinear strange attractor feedback filter.
3. Effects Processors¶
Chorus (MIT)¶
- Header:
Effects/chorus.h - Architecture: Stereo delay modulation network.
- API:
Init(sr),SetLfoFreq(f),SetLfoDepth(d),SetDelayMs(ms),SetPan(l, r),Process(in),GetLeft(),GetRight().
Flanger (MIT)¶
- Header:
Effects/flanger.h - API:
Init(sr),SetLfoFreq(f),SetLfoDepth(d),SetFeedback(fb),Process(in).
Phaser (MIT)¶
- Header:
Effects/phaser.h - API:
Init(sr),SetLfoFreq(f),SetLfoDepth(d),SetFeedback(fb),SetPoles(p),Process(in).
PitchShifter (MIT)¶
- Header:
Effects/pitchshifter.h - Memory Notice: Allocates internal 16K float delay lines (~128 KB). Place in global memory or SDRAM.
- API:
Init(sr),SetTransposition(semitones),SetDelSize(samples),SetFun(slew),Process(in).
Overdrive (MIT)¶
- Header:
Effects/overdrive.h - API:
Init(),SetDrive(drive)(\(0.0 - 1.0\)),Process(in).
Wavefolder (MIT)¶
- Header:
Effects/wavefolder.h - API:
Init(),SetGain(gain),SetOffset(offset),Process(in).
Decimator (MIT)¶
- Header:
Effects/decimator.h - API:
Init(),SetBitcrushFactor(factor),SetDownsampleFactor(factor),SetBitsToCrush(bits),Process(in).
SampleRateReducer (MIT)¶
- Header:
Effects/sampleratereducer.h - API:
Init(),SetFreq(f),Process(in).
Tremolo (MIT)¶
- Header:
Effects/tremolo.h - API:
Init(sr),SetFreq(f),SetDepth(d),SetWaveform(wf),Process(in).
Autowah (MIT)¶
- Header:
Effects/autowah.h - API:
Init(sr),SetWah(wah),SetDryWet(dw),SetLevel(lvl),Process(in).
ReverbSc (LGPL)¶
- Header:
DaisySP-LGPL/Source/Effects/reverbsc.h - Memory Notice: Allocates
98,936floats (~395 KB). Must be placed in SDRAM viaDSY_SDRAM_BSS. - API:
int Init(float sample_rate)void SetFeedback(float fb): Reverb tail length (\(0.0 - 1.0\), \(1.0\) is infinite).void SetLpFreq(float freq): Lowpass damping cutoff in Hz.int Process(const float &in1, const float &in2, float *out1, float *out2)
4. Drum & Percussion Synthesis¶
AnalogBassDrum (MIT)¶
- Header:
Drums/analogbassdrum.h - API:
Init(sr),SetFreq(f),SetTone(t),SetDecay(d),SetAttackFmAmount(a),SetSelfFmAmount(s),SetSustain(bool),SetAccent(a),Trig(),Process(trigger_bool). - Output Level & Frequency Caveats:
- Low Output Amplitude: The raw output of
AnalogBassDrumpeaks at only \(\approx 0.30\) during its initial 1 ms click transient, and its resonant sine body quickly drops to \(\approx 0.034\) (RMS \(\approx 0.032\), roughly \(-20\text{ dBFS}\) relative to snare/tom models). It requires substantial make-up gain (\(+15\) to \(+20\text{ dB}\)) when mixed with other drum voices. - Small Speaker / Audibility Hazard: The bridged-T resonator produces a near-pure sine wave with virtually no upper harmonics. At typical kick fundamentals (\(40 - 60\text{ Hz}\)), it is practically inaudible on miniature built-in hardware speakers (whose acoustic roll-off is \(>150\text{ Hz}\)).
- SVF Runaway Resonance: SVF resonance is calculated as \(\text{res} = 0.4 \times q \times f\). Above \(\approx 90\text{ Hz}\) or with high decay values, \(\text{res}\) saturates at \(1.0\) (damping drops to \(0.0\)), causing perpetual undamped oscillation that starves control ISRs.
- Usage Guideline: For punchy, modern kicks that project on built-in speakers and headphones, prefer
SyntheticBassDrumor add cubic saturation/drive and beater noise.
SyntheticBassDrum (MIT)¶
- Header:
Drums/synthbassdrum.h - API:
Init(sr),SetFreq(f),SetTone(t),SetDecay(d),SetDirtiness(dirt),SetFmEnvelopeAmount(fm),SetFmEnvelopeDecay(fmd),SetAccent(a),Trig(),Process(trigger_bool). - Acoustic Characteristics & Advantages:
- High Output Energy: Modeled after a 909-style kick drum (distorted sine, transistor VCA, pitch FM envelope, click, and attack noise). Evaluates at \(\approx 0.90\) peak and \(\approx 0.38\) RMS (\(+21\text{ dB}\) higher RMS energy than
AnalogBassDrum), naturally balancing alongside snares and cymbals. - Harmonic Presence for Small Speakers: The
SetDirtiness(dirt)parameter controls a distorted sine shaper that injects rich odd harmonics into the body. These mid-frequency harmonics (\(100 - 300\text{ Hz}\)) remain clearly audible even on tiny onboard speakers. - Stable Oscillator: Does not use the fragile SVF bridged-T resonator; completely immune to runaway self-oscillation across any tuning range (\(40 - 200\text{ Hz}\)).
AnalogSnareDrum (MIT)¶
- Header:
Drums/analogsnaredrum.h - API:
Init(sr),SetFreq(f),SetTone(t),SetDecay(d),SetSnappy(s),SetAccent(a),Trig(),Process(trigger_bool). - Critical DSP & Performance Hazards:
- Undamped SVF Resonance: The resonance for each of the 5 modal resonators is scaled via \(\text{res} = 0.2 \times f \times q\). For typical tuning (\(120 - 400\text{ Hz}\)) and decay values, the calculated resonance argument exceeds \(1.0\) (often \(3.7 - 10.5\)). Inside
Svf::SetRes(), this clamps to \(1.0\), which drives damping to zero (\(\text{damp} = 2.0 \times (1.0 - \text{res}^{0.25}) = 0.0\)). Consequently, all 5 resonators enter perpetual undamped self-oscillation, ringing continuously at \(\approx 0.035\) amplitude and preventing voice activity gates from sleeping. - Severe Per-Sample CPU Load: In
AnalogSnareDrum::Process(), filter coefficients, resonance, and envelope scalings are evaluated inside the per-sample loop rather than at control rate. Each sample computes 14powf()and 6sinf()calls across 6 SVF filter instances. On ARM Cortex-M7 (STM32H750 @ 480 MHz), this single module consumes \(\mathbf{65\% - 75\%}\) of the entire 1.0 ms audio block budget. - Polyphonic / Overlap DMA Underflow: When overlapped with any other voice (e.g. kick, clap, or hats), aggregate CPU load easily exceeds \(100\%\), causing hardware audio DMA buffer underruns and producing harsh digital static/clicks.
- Usage Guideline: Avoid
AnalogSnareDrumin polyphonic synthesizers or drum machines where multiple voices sound simultaneously. Replace withSyntheticSnareDrumor a custom dual-mode sine oscillator + bandpass noise voice where decay and filter parameters are computed at block rate.
HiHat (MIT)¶
- Header:
Drums/hihat.h - API:
Init(sr),SetFreq(f),SetTone(t),SetDecay(d),SetNoisiness(n),SetAccent(a),SetSustain(bool),Process(trigger_bool).
SyntheticSnareDrum (MIT)¶
- Header:
Drums/synthsnaredrum.h - API:
Init(sr),SetFreq(f),SetSnappy(s),SetDecay(d),Trig(),Process(trigger_bool).
5. Physical Modeling Synthesis¶
StringVoice (MIT)¶
- Header:
PhysicalModeling/stringvoice.h - Origin: Mutable Instruments Rings / Plaits.
- API:
Init(sr),SetFreq(f),SetAccent(a),SetStructure(s),SetBrightness(b),SetDamping(d),SetSustain(bool),Trig(),Process(trigger_bool).
ModalVoice (MIT)¶
- Header:
PhysicalModeling/modalvoice.h - Origin: Mutable Instruments Rings / Plaits.
- API:
Init(sr),SetFreq(f),SetAccent(a),SetStructure(s),SetBrightness(b),SetDamping(d),SetSustain(bool),Trig(),Process(trigger_bool).
Resonator (MIT)¶
- Header:
PhysicalModeling/resonator.h - API:
Init(position, resolution, sr),Process(f, structure, brightness, damping, in, out).
Drip (MIT)¶
- Header:
PhysicalModeling/drip.h - API:
Init(sr, dettack),Process(trig).
6. Dynamics & Sampling¶
Limiter (MIT)¶
- Header:
Dynamics/limiter.h - API:
Init(),ProcessBlock(float *in, size_t size, float pre_gain).
CrossFade (MIT)¶
- Header:
Dynamics/crossfade.h - Curves:
CROSSFADE_LIN,CROSSFADE_CPOW,CROSSFADE_LOG,CROSSFADE_EXP. - API:
Init(curve),SetPos(pos)(\(0.0 - 1.0\)),Process(in1, in2).
GranularPlayer (MIT)¶
- Header:
Sampling/granularplayer.h - API:
Init(float* sample, int size, float sample_rate),Process(float speed, float transposition, float grain_size).
Compressor (LGPL)¶
- Header:
DaisySP-LGPL/Source/Dynamics/compressor.h - API:
Init(sr),SetThreshold(db),SetRatio(ratio),SetAttack(s),SetRelease(s),SetMakeup(db),Process(in),Process(in, key_sidechain).
Balance (LGPL)¶
- Header:
DaisySP-LGPL/Source/Dynamics/balance.h - API:
Init(sr),Process(sig, comparator_sig).