Build with this node

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

Ask Studio

@maruaudio/dsp/modulation/flanger is a mono flanger: a short sine-modulated fractional delay over @maru/delays-fractional, with signed feedback and a dry/wet mix.

lfo = 0.5 + 0.5 × sin(2π·phase) // 0 to 1
d = (1 ms + depth × lfo) × sampleRate / 1000
wet = read(d); write(x + wet × feedback)
y = fround(x × (1 − mix) + wet × mix)

The delay sweeps upward from a fixed 1 ms minimum by the depth in milliseconds.

Parameters

SetterRange the setter enforcesDefault
setFlangerRate0.01 to 20 Hz0.5 Hz
setFlangerDepth0 to 10 ms sweep above the 1 ms minimum2 ms
setFlangerFeedback−0.75 to 0.750
setFlangerMix0 to 10.5
setFlangerPhaseOffset−180 to 180 degrees, stored as 0 to 1 cycles; also sets the phase0°

Lifecycle

initFlangerNode allocates the delay ring (50 ms plus two frames at the init rate; 2,402 frames at 48 kHz) → setters → flangerNodeTick → resetFlangerNode, which clears the line and returns the phase to the offset. clearFlangerNodeStep(state, cursor, budget) clears the line in bounded steps for live replacement, then finalizeFlangerNodeClear resets the write index and phase. Ticks allocate nothing and do no I/O.

When to use it

A swept comb filter on guitars, drums or full mixes. Negative feedback inverts the regenerated signal; two states with phase offsets 180° apart form a phase-locked stereo pair.

Limits

  • Mono sample tick; one state per channel.
  • There is no sample-rate prepare: create a new state for a new rate.
  • The line stores x + wet × feedback clamped to ±1 at f32.
  • Parameter changes apply at once; a phase-offset change jumps the phase.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Rate ratefloatsetFlangerRate
Milliseconds milliseconds

Sweep span above the fixed 1 ms comb-delay minimum.

floatsetFlangerDepth
Feedback feedbackfloatsetFlangerFeedback
Mix mixfloatsetFlangerMix
Degrees degrees

Static phase offset for phase-locked stereo instances.

floatsetFlangerPhaseOffset

Ports

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

One sample per flangerNodeTick call.

Dependencies

Dependents

Used by