@maruaudio/dsp/modulation/vibrato is a fully wet, sine-swept fractional delay of centre × (1 + depth × sin(2π·phase)) samples, read with the linear interpolation of @maru/delays-fractional. The tick writes the input before reading, the conventional DelayNode order, so depth 1 may reach zero delay and a zero-delay read returns the current sample. With the centre bound to 2.5 ms, this is the public web module's Web Audio graph.
Parameters
| Setter | Range the setter enforces | Default |
|---|---|---|
setVibratoRate | 0.1 to 20 Hz | 5 Hz |
setVibratoDepth | 0 to 1 | 0.5 |
setVibratoDelay | 1 to 20 ms centre delay | 6 ms |
setVibratoPhaseOffset | −180 to 180 degrees, NaN → 0, stored as 0 to 1 cycles | 0° |
A phase-offset change moves the running phase by the difference from the previous offset; repeating the same offset changes nothing.
Lifecycle
initVibratoNode allocates the delay ring (50 ms plus two frames at the init rate) → prepareVibratoNodeSampleRate re-derives the delay inside that capacity, clearing history when the active length changes → setters → vibratoNodeTick → resetVibratoNode, which clears the line and returns the phase to the offset. For live replacement, clearVibratoNodeStep(state, cursor, budget) clears in bounded steps until it returns the line length, then finalizeVibratoNodeClear. Ticks allocate nothing and do no I/O.
When to use it
Periodic pitch modulation of a voice, guitar or keys with no dry signal; any dry blend happens outside. Two states with opposed phase offsets give a phase-locked stereo pair.
Limits
- Mono sample tick, fully wet.
- The delay line stores the input clamped to ±1 at f32.
- The swept delay is clamped to the ring length minus two frames.
- The phase accumulator is f32; parameter changes apply at once.