@maruaudio/dsp/filters/parametric-eq is a fused cascade of up to eight RBJ cookbook bands in transposed direct form II. Cuts add up to three Butterworth sections (12 to 48 dB per octave). Coefficients are rounded to f32; TDF2 state and control banks are Float64, never rounded. Controls glide, type and slope changes crossfade, and a derived headroom trim keeps the cascade inside full scale.
const state = initParametricEqNode(48000, 6)
setParametricEqBandGainDb(state, 2, 4)
const y = parametricEqNodeTick(state, x) // updates coefficients when neededParameters
Band setters take (state, band, value) and ignore a band outside 0 to 7.
| Setter | Range the setter enforces | Default | Unit |
|---|---|---|---|
setParametricEqBandEnabled | ≥ 0.5 on; ramps over 64 samples | Bands 0 to 3 on | flag |
setParametricEqBandType | Rounded, 0 to 5: BELL, LOW_SHELF, HIGH_SHELF, LOW_CUT, HIGH_CUT, NOTCH | Low cut, low shelf, bell, bell, high shelf, high cut × 3 | type |
setParametricEqBandFrequency | 20 Hz to the lower of 20 kHz and 0.45 × rate | 30, 120, 500, 2000, 8000, 18000 × 3 | Hz |
setParametricEqBandQ | 0.025 to 40 | 0.7071; bells 1 | Q |
setParametricEqBandGainDb | −30 to +30 | 0 | dB |
setParametricEqBandSlope | Rounded, 0 to 3 (12 to 48 dB/oct); used by cut types | 0 | index |
setParametricEqOutputGainDb | −24 to +24 | 0 | dB |
Lifecycle
initParametricEqNode(sampleRate, bandCount) allocates eight-band banks; the active count (1 to 8) is fixed → setters → parametricEqNodeTick → resetParametricEqNode. Setup writes settle before the first sample; later frequency, Q, gain and trim glide through a 10 ms one-pole. prepareParametricEqNodeSampleRate re-derives smoother, ceilings and caches without allocating. Reset clears histories and re-settles the stored controls.
When to use it
Corrective and tonal EQ on a channel or bus, with automation that glides. @maru/filters-eq3 is the fixed three-band alternative.
Limits
- Mono sample tick; with every band off and unity trim it returns the input.
- The headroom trim is a scalar gain from bounded response probes at events, not a limiter.
audio-kernelskeeps a six-band PCM adapter.