Build with this node

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

Ask Studio

@maruaudio/dsp/acoustics/room-convolver convolves live audio with a simulated room impulse response of up to 3 s for one or two microphones and one or two sources, and mixes dry and wet. It owns no convolution arithmetic: it composes @maru/filters-partitioned-convolution in its two-stage zero-latency layout (a 128-tap head, 128-frame partitions and a 2048-frame tail, 4096 above 64 kHz). It owns the double-banked IR buffer a budgeted RIR assembly writes, and swaps responses with a 50 ms equal-power crossfade.

Parameters

CallAcceptsDefault
initRoomConvolver(rate, maxMics, maxIrSeconds, maxSources)Mics and sources 1 or 2; seconds clamped to (0, 3]; a rate below 1 becomes 48 kHz1 source; silent, dry 1, wet 1
setRoomConvolverMix(dry, wet)Linear targets, followed per sample by a 5 ms one-pole; NaN becomes 01, 1
setRoomConvolverInputMode(mode)ROOM_CONVOLVER_INPUT_MEAN, (L + R) / 2, or INPUT_POWER, (L + R) / √2mean
submitRoomConvolverBank(bank, frames, mics, gain)Frames clamped to the capacity; refused for the bank being preparednone

Lifecycle

initRoomConvolver allocates everything → claimRoomConvolverBank (never the bank being prepared from), write the IR at roomConvolverBankOffset, submitRoomConvolverBank → once per render quantum stepRoomConvolver(maxPartitions), which begins the newest submission, transforms a partition budget per convolver and commits both together → processRoomConvolverBlock. resetRoomConvolver clears audio history and keeps the loaded responses; clearRoomConvolver discards them too.

When to use it

The convolution half of a simulated room: a module recomputes the response a budget at a time and hands each finished one here, crossfaded while audio plays.

Limits

  • Zero latency, so the dry path needs no compensation. Output is stereo, mic 0 left and mic 1 right; a one-mic IR feeds both sides and a mono output takes the wet pair's mean. With two sources each input drives its own pair; one submitted source loads both at half gain.
  • A swap starts at the second tail boundary (at most 2T frames). A newer submission restarts a preparation but waits during a swap or crossfade.
  • Rate clamped to at most 768 kHz; buffer offsets are the caller's contract.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Mode mode

ROOM_CONVOLVER_INPUT_MEAN or ROOM_CONVOLVER_INPUT_POWER.

floatsetRoomConvolverInputMode

Dependencies

Dependents

No other node imports this one.

Used by