@maruaudio/dsp/filters/dj-filter is the CHOMPI firmware's one-knob DJ filter. Below the centre the control closes a resonant low-pass; above it, it opens a resonant high-pass. Each channel runs a low-pass then a high-pass @maru/filters-multimode-cascade section. The control maps to cubed targets, lp = clamp(0.01 + 2c, 0, lpMax)³ and hp = clamp(1.9c − 1, 0, hpMax)³, which the coefficients chase each sample through fonepole(0.0002) (@maru/modulation-f32-slew). All arithmetic is f32.
Parameters
| Setter or init | Range as coded | Default | Unit |
|---|---|---|---|
initDjFilterNode(range) | DJ_FILTER_RANGE_TAPE (lp ≤ 0.99, hp ≤ 1) or DJ_FILTER_RANGE_TEMPO (lp ≤ 0.98, hp ≤ 0.9) | TAPE | clamp set |
setDjFilterControl | Not clamped; 0 closed low-pass, 0.5 open, 1 high-pass; above 1 pushes the high-pass further | 0 | normalized |
setDjFilterResonance | Scaled by 0.95, not clamped | 0.6 on the sections at init | resonance |
While the smoothed high-pass coefficient exceeds 0.8, the high-pass resonance becomes res·5·(1 − control), and stays so until the next resonance set.
Lifecycle
initDjFilterNode → setDjFilterControl and setDjFilterResonance → djFilterNodeTickStereo(state, l, r) (results in outLeft, outRight) or djFilterNodeTickMono → resetDjFilterNode. Members the source leaves uninitialized start at zero, so the filter opens from fully closed over about 0.1 s after init. Reset clears history and smoothing and keeps the control, its targets and the last applied resonance.
When to use it
A single performance knob that sweeps from dark to thin, on a stereo bus or on one voice.
Limits
- Stereo or mono; do not mix the two tick forms on one state. The mono tick runs the left chain alone and equals either stereo output for identical inputs.
- Per-sample coefficients with no rate input: calibrated to 48 kHz.
- Four cascade sections and two one-pole slews per sample.