Build with this node

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

Ask Studio

@maruaudio/dsp/physical/modal-resonator-bank drives up to 16 modes from one common excitation and sums them: each mode is @maru/physical-modal's coupled-form recurrence with its own frequency, T60 and gain, and each tick also records every mode's displacement and finite-difference velocity for a body or radiation readout. A pool packs many banks into one set of typed arrays. The caller supplies excitation and mode recipe. Algorithm version 1.

const bank = initModalResonatorBank(48000)
configureModalResonatorBankMode(bank, 0, 660, 0.72, 0.36, 0) // index, Hz, T60 s, gain, roll-off
setModalResonatorBankModeCount(bank, 1)
const y = modalResonatorBankTick(bank, x)

Parameters

SetterRange the setter enforcesDefault
configureModalResonatorBankMode index0 to 15; others are ignorednone
frequency, T600 Hz to 0.495 × the rate; 0.001 to 60 sunset modes are silent
gain, roll-offGain 0 to 4; non-zero roll-off applies min(1, 1000 / f)none
setModalResonatorBankModeCountFloored, 0 to 160
setModalResonatorBankOutputGain0 to 4, linear1

Lifecycle

initModalResonatorBank(rate) or initModalResonatorBankPool(banks, rate) allocates (a non-positive rate becomes 48 kHz) → configure modes on the control thread, which clears that mode's state → modalResonatorBankTick, processModalResonatorBankBlock(source, target, from, to), modalResonatorBankPoolTick or modalResonatorBankPoolTickEleven → resetModalResonatorBank or resetModalResonatorBankPool, which clear state and keep the modes. Ticks allocate nothing and run at most 16 modes a bank.

When to use it

A struck bar, plate or bell built from a mode table, or a sympathetic field such as a piano's: the eleven-bank traversal advances the 88-key, two-partial field in one pass.

Limits

  • Mono sample tick; the block function writes only [from, to). f32 state, coefficients and sum; readouts outside the active mode count return 0.
  • The clamps are the kernel node's conditional clamps: a NaN passes through.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Gain gainfloatsetModalResonatorBankOutputGain
Count countfloatsetModalResonatorBankModeCount

Dependencies

Dependents

Used by