Skip to main content

songbird-plugins

16 stock DSP plugins — Rust ports of the C++ originals. Every plugin implements the Plugin trait for a uniform interface across effects and instruments.

Plugin Inventory

Effects (10)

PluginType NameDescriptionKey Parameters
ChannelStripsongbirdStrip9-stage channel strip (HPF → gate → EQ → transient shaper → compressor → saturation → stereo width → depth → limiter)28 params: gain, pan, HPF freq, gate threshold, 3-band EQ, comp ratio/threshold/attack/release, saturation drive, stereo width, depth amount, limiter ceiling
ReverbsongbirdReverbFreeverb algorithm with pre-delayroom_size, damping, wet, dry, width, predelay
DelaysongbirdDelayStereo delay with ping-pong modedelay_time_l, delay_time_r, feedback, wet, dry, ping_pong, sync
ChorussongbirdChorusStereo chorus with LFO modulationrate, depth, mix, voices, spread
PhasersongbirdPhaserMulti-stage allpass phaserrate, depth, feedback, stages, mix
FlangersongbirdFlangerFlanging via short modulated delayrate, depth, feedback, mix
CompressorsongbirdCompressorDynamic range compressorthreshold, ratio, attack, release, knee, makeup_gain
DistortionsongbirdDistortionMulti-mode distortion (soft clip, hard clip, fuzz, bitcrush)drive, mode, tone, mix
DoublersongbirdDoublerStereo doubling via micro-delays + detuningdelay, detune, width, mix
ScriptFXsongbirdScriptFXUser-scriptable DSP (JavaScript/Faust/WASM)script_source, custom params

Instruments (6)

PluginType NameDescriptionKey Parameters
Synth4Oscsongbird4OSC4-oscillator subtractive synth4x (waveform, level, detune, octave), filter (cutoff, resonance, type), ADSR (amp + filter), LFO
SynthStksongbirdSTKSynthesis toolkit (6 STK algorithms: BlitSaw, BlitSquare, SineWave, Noise, BiQuad, ADSR)algorithm, cutoff, resonance, adsr
Synth303songbird303Acid bass synth (diode ladder filter)cutoff, resonance, env_mod, decay, accent, waveform
SamplersongbirdSamplerMulti-sample playback with velocity layersroot_note, sample_start, sample_end, loop_start, loop_end, adsr
DrumMachinesongbirdDrumMachine16-pad drum machine with per-pad controls16x (sample, volume, pan, pitch, decay)
MetronomesongbirdMetronomeClick track generator (accent on beat 1)volume, accent_volume, frequency, accent_frequency

Plugin Trait

All plugins implement this interface:
pub trait Plugin: Send {
    fn type_name(&self) -> &str;           // Factory identifier (e.g., "songbirdReverb")
    fn name(&self) -> &str;                // Display name (e.g., "Reverb")
    fn initialize(&mut self, sample_rate: f64);
    fn reset(&mut self);                   // Clear all internal state (delays, filters, etc.)
    fn process(&mut self, buffer: &mut AudioBuffer, midi_events: &[MidiEvent]);
    fn params(&self) -> Vec<PluginParam>;  // Current parameter snapshot
    fn set_param(&mut self, name: &str, value: f64);
    fn save_state(&self) -> Vec<u8>;       // Binary state for recall
    fn load_state(&mut self, data: &[u8]);
    fn tail_seconds(&self) -> f64;         // Reverb tail, delay feedback, etc.
    fn latency_samples(&self) -> usize;    // Plugin latency for PDC
    fn accepts_midi(&self) -> bool;        // true for instruments
    fn produces_midi(&self) -> bool;       // true for MIDI effects
}

Plugin Factory

use songbird_plugins::{create_plugin, stock_plugin_types};

// Create by type name
let reverb = create_plugin("songbirdReverb").unwrap();

// List all stock plugin type names
for name in stock_plugin_types() {
    println!("{name}");
}

MidiEvent

pub enum MidiEvent {
    NoteOn { channel: u8, note: u8, velocity: f32 },
    NoteOff { channel: u8, note: u8 },
    CC { channel: u8, cc: u8, value: f32 },
    PitchBend { channel: u8, value: f32 },       // -1.0 to 1.0
    Aftertouch { channel: u8, pressure: f32 },
    PolyAftertouch { channel: u8, note: u8, pressure: f32 },
    ProgramChange { channel: u8, program: u8 },
}

AudioBuffer

Thin wrapper over raw float pointers. Supports up to 8 channels with zero heap allocation:
pub struct AudioBuffer {
    channels: [*mut f32; 8],
    num_channels: usize,
    num_samples: usize,
}

Conventions

  • Parameter names are snake_case strings (e.g., "delay_time_l", "filter_cutoff")
  • Parameter values are normalized f64 with min/max/default metadata in PluginParam
  • State serialization uses serde_json internally (JSON bytes via save_state() / load_state())
  • DSP is deterministic — same input + same state = same output, enabling golden-output regression tests
  • All plugins are Send — safe to move between threads for parallel graph processing

Testing

cargo test -p songbird-plugins  # Unit tests + factory tests
Factory tests verify:
  1. All 16 plugins can be created from their type name
  2. Unknown type names return None
  3. State round-trip: create → modify param → save → create fresh → load → params match