@maruaudio/dsp/filters/string-readout colours a string or body signal with up to three RBJ biquad sections in series: a high-pass low cut (Q 0.7071), a peaking band and a high shelf (Q 0.7071), each a @maru/filters-biquad state. A section runs only when it is engaged. With all three off, the tick returns its input unchanged, as a double.
const state = createStringReadout(); prepareStringReadout(state, 48000)
state.bandGain = -6; configureStringReadout(state)
const y = stringReadoutTick(state, x)Parameters
There are no setters. The caller writes the state fields, then calls configureStringReadout, which copies them into the biquads and updates their coefficients. The fields are not clamped.
| Field | Engages the section when | Default | Unit |
|---|---|---|---|
cutoff | > 0 (high-pass frequency) | 0 (off) | Hz |
bandGain | !== 0 | 0 (off) | dB |
bandFrequency | with bandGain | 55 | Hz |
bandQ | with bandGain | 4 | Q |
shelfGain | !== 0 | 0 (off) | dB |
shelfFrequency | with shelfGain | 1000 | Hz |
Lifecycle
createStringReadout (biquads at 48 kHz) → prepareStringReadout(state, rate) → field writes and configureStringReadout → stringReadoutTick → resetStringReadout. Prepare sets the rate, configures and clears all three histories. Configure runs outside the tick and clears any section it turns off, so a section switched back on does not replay an old tail. Reset clears the histories and keeps the fields.
When to use it
The radiation stage after a physical string or piano model: trim low rumble, cut or lift one resonance region and tilt the top end, with exact bypass when every control is neutral.
Limits
- Mono sample tick; coefficient changes apply at once, with no smoothing.
- Fields bypass the biquad setters, so the biquad clamps do not apply.
- When any section is engaged the input is rounded to f32 before filtering.