Build with this node

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

Ask Studio

@maruaudio/dsp/delays/reverse-delay plays each completed window of input backwards while the next window records. At window position p it reads the caller-owned @maru/delays-fractional ring 2p + 1 samples back, so the read walks backwards through the previous window. A Hann fade, 0.5 − 0.5·cos(π·d/fade) within fade samples of either window edge, suppresses splice clicks. The write is clamp(x + wet·feedback, −1, 1). It is wet only.

const state = initReverseDelay(48000)
configureReverseDelay(state, 250, 0.3, 5, 0)
reverseDelayTick(state, ringL, ringR, left, right) // state.outLeft, state.outRight

Parameters

configureReverseDelay(state, windowMs, feedback, fadePercent, outputDb); a non-finite value takes the default, then clamps.

ArgumentRange the code appliesDefaultUnit
windowMs20 to 500, rounded to frames100ms
feedback0 to 0.750linear
fadePercent1 to 25 % of the window, at least 1 frame5%
outputDb−24 to 00dB

Lifecycle

initReverseDelay(sampleRate) (8 to 192 kHz, NaN gives 48 kHz) and the two rings are created outside processing → configureReverseDelay → reverseDelayTick(state, lineLeft, lineRight, left, right) → resetReverseDelay, which restarts the window and clears the outputs. The caller owns the rings' reset and clear, configuration fades and the dry/wet blend. Ring capacity must be at least 2 × window + 2 samples.

When to use it

Backwards swells and reversed echoes on a guitar, vocal or drum part, in time with a window length.

Limits

  • Stereo, wet only. Edge fades mean it is not gapless file reversal.
  • Input is bounded to ±16 (NaN 0) before the write clamp.
  • A window change restarts the position only if it falls outside the new window.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Dependencies

Dependents

Used by