@maruaudio/dsp/distortion/direct-overdrive ports the DaisySP Overdrive: a drive-dependent input gain, the bounded rational soft clip x (27 + x²)/(27 + 9x²) with x clamped to ±3, and a reciprocal output gain calibrated from the same control, all in f32. It has no oversampling, FIR, buffer or latency.
d = 2 × clamp(drive, 0, 1)
pre = d/2 + (24·d⁵ − d/2) · d²
post = 1 / softClip(0.33 + d(2 − d) · (pre − 0.33))
y = softClip(pre × x) × postParameters
| Setter | Range the setter enforces | Default |
|---|---|---|
setDirectOverdriveDrive | 0 to 1; NaN → 0 (DaisySP fclamp) | 0.5 |
initDirectOverdriveNode() takes no sample rate. The state holds the doubled drive and the two derived gains.
Lifecycle
initDirectOverdriveNode → setDirectOverdriveDrive → directOverdriveNodeTick. There is no signal history, so nothing needs a reset when a host retires or re-enables it. Ticks allocate nothing and do no I/O.
When to use it
A zero-latency overdrive whose gain and output level both follow one control, matching a DaisySP-based device sample for sample.
Limits
- Mono sample tick, wet only, no oversampling: high drive aliases.
- The soft clip saturates at ±1 for pre-gained inputs beyond ±3, so the output peaks at
post. - Drive changes apply at once, with no smoothing.