Skip to main content

Module preset

Module preset 

Source
Expand description

Preset = a stereo audio graph parameterised by TrackParams + GlobalParams.

Math-heavy modulation lives inside lfo(|t| …) closures that read Shared atomics cloned at build time (lock-free). Everything is f64-throughout (FunDSP hacker module) so multi-hour playback stays phase-stable — f32 time counters drift at ~5 min at 48 kHz.

Structs§

FreqMod
Shared bundle of everything a freq-generating closure needs to apply arp + LFO on top of a base pitch. Cloning it is just a handful of Arc refcount bumps.
GlobalParams
LfoBundle
Lightweight bundle of the three Shared atomics that drive a track’s per-voice LFO. Clone is ~3× Arc-clone (refcount bumps) — cheap.
Preset

Enums§

PresetKind

Constants§

ALL_KINDS
All preset kinds in cycle order. Used by the TUI t / T keys.
LFO_CUTOFF
LFO_FREQ
LFO_GAIN
LFO_OFF
LFO_REVERB
LFO_TARGETS
MASTER_SHELF_HZ
MIN_SHELF_GAIN

Functions§

brightness_to_lp_cutoff
Map brightness to the master lowpass cutoff (Hz). 0 → 3000 Hz (hard cut of reverb HF resonances) 0.6 → ~8.6 kHz (default — mellow) 1.0 → 18 kHz (effective bypass)
brightness_to_shelf_gain
Map brightness [0..1] → shelf amplitude gain [MIN..1.0] linearly.
lerp3
Three-point linear interpolation: c=0 → a, c=0.5 → b, c=1 → d. Used by every preset’s character morph so the neutral 0.5 setting reproduces the hand-tuned original formula exactly.
lfo_target_name
master_bus
Stereo master bus: per-channel high-shelf (tilt) → lowpass (hard cut) → limiter. Both EQ stages driven by the same brightness.
shelf_gain_db
Amplitude → dB for header readout.