sfxr's "phaser" is a comb filter, the sound plus a copy delayed by up
to 2.9 ms. That is a flanger, not the phaser a guitarist knows. Both
effects come in as nodes of their own, so each name fits its sound and
sfxr is covered in full. Both run on the FX worklet like the
Bitcrusher, because a feedback loop in Web Audio costs a render quantum
per round.
- Phaser: first-order allpasses (Stages 2, 4, 6, 8, 12) around
Frequency, moved by a sine LFO Depth octaves wide at Rate Hz, with
Feedback and Mix. An Envelope can move Frequency and Mix.
- Flanger: a delay line of Offset ms. Sweep moves it on in ms/s from
the start of the voice, an LFO adds up to Depth ms. As in sfxr the
delay is mirrored at 0, and it never goes past 20 ms. Feedback comes
back exactly one delay later. An Envelope can move Offset and Mix.
- Mix 0 leaves the sound as it is, 1 is half sound and half copy. The
notches are deepest there and the peaks stay at the sound's level.
sfxr adds both at full, so its sound comes out 6 dB louder.
- The Flanger's processor gets the start of its voice and begins the
sweep on that sample. stageNodes takes it as a new argument `at`.
- Explosion gets a Flanger in one draw out of two, with sfxr's offset
and sweep and no LFO. Offset is offset^2 * 2.89 ms, Sweep is
ramp^2 * 125 ms/s, signed so the direction holds.
- Randomize draws a Flanger's offset and sweep like sfxr. Its LFO and
feedback and all of a Phaser are drawn within bounds of their own.
Mix and Stages stay, as a Bitcrusher's Mix does. Mutate moves them
too, and a 0 stays 0.
- New instrument preset Phased Pad: saw, Envelope, low-pass, Phaser of
six stages. The other 14 are unchanged.
- The Bitcrusher's worklet setup is now shared with both nodes
(workletNodes), its behaviour is unchanged.
Tests:
- Unit phaser (new): 8 green. Counter-check with clamping at 0 instead
of mirroring and a flipped allpass coefficient: 3 red.
- Unit soundfx, sound-library, chip-presets: 45 / 76 / 14 green.
Counter-checks: start time not passed on, phaser frequency eased
linearly, sweep sign dropped, Phaser left out of Mutate, each red.
- Unit core, viewport, graph: 179 files, 2979 tests green.
- e2e 34 (melektaus-atx): ALL PASSED, 70 checks (1 new), first run.
Chrome offline: 1 kHz notch RMS 0.0000 with two stages, 0.5657
with four. Flanger echo after 48 samples, swept echo at 533/534.
About 47 Phasers (12 stages) or 63 Flangers fill the audio thread.
- Gate (melektaus-atx): CHECK EXIT 0, 257 files, 3991 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>