Build with this node

Start with a prompt in Studio, or copy it into your own coding agent.

Ask Studio

@maruaudio/dsp/filters/multimode-cascade is the CHOMPI firmware's two-pole resonant multimode filter (BasicMMF): two cascaded one-pole integrators with band-pass feedback.

buf0 += f·(in − buf0 + fb·(buf0 − buf1))
buf1 += f·(buf0 − buf1)
fb = res + res / (1 − f)

Low-pass reads buf1, high-pass in − buf0, band-pass buf0 − buf1. Every operation is rounded to f32 in source order.

Parameters

SetterRange as codedDefaultUnit
setMultimodeCascadeModeMULTIMODE_CASCADE_LOWPASS (0), HIGHPASS (1), BANDPASS (2); any other value outputs 0Low-passmode
setMultimodeCascadeFrequencyNot clamped; the source's domain is 0 to below 10.5per-sample integrator coefficient, not Hz
setMultimodeCascadeResonanceNot clamped0.5resonance

setMultimodeCascadeControls sets frequency and resonance with one feedback update, identical to calling both setters. Each setter recomputes fb at once.

Lifecycle

initMultimodeCascadeNode (low-pass, f 0.5, res 0.5, fb 1.5) → setters → multimodeCascadeNodeTick per sample → resetMultimodeCascadeNode, which clears both integrators and keeps mode and controls. There is no sample-rate input or prepare step.

When to use it

A compact resonant filter where the firmware's behaviour must be reproduced exactly, or a building block for a sweepable filter such as @maru/filters-dj-filter, which keeps its coefficient at or below 0.99.

Limits

  • Mono sample tick. The coefficient is per sample, so the response is calibrated to 48 kHz and scales with any other rate.
  • Unguarded like the source: frequency = 1 divides by zero, and high resonance near the top of the range self-oscillates and can grow without bound. Callers bound their controls.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Mode mode

`SetMode`: an unknown mode outputs silence, as the source's default.

floatsetMultimodeCascadeMode
Frequency frequency

`SetFreq`: per-sample coefficient; recomputes the feedback amount.

floatsetMultimodeCascadeFrequency
Resonance resonance

`SetRes`: recomputes the feedback amount at the current frequency.

floatsetMultimodeCascadeResonance

Ports

  • In ininput · audio · mono
  • Out outoutput · audio · mono

One sample per multimodeCascadeNodeTick call.

Dependencies

None: this node imports no other node.

Dependents

Used by