Sound FX: Phaser #341

Closed
opened 2026-10-06 20:04:09 +02:00 by meleki · 2 comments
Owner

Aus der Planung von #329 (Gespräch 2026-10-06), dort bewusst ausgeklammert. sfxr hat einen Phaser, der im Chip-Node von #329 nicht enthalten ist.

Ein FX-Node Phaser im Sound FX und im Instrument.

Vorschlag:

  • Wie bei sfxr: ein kurzes Delay, das mit dem trockenen Signal gemischt wird. Die Verzögerung ändert sich mit Offset und Sweep.
  • Mit Web Audio aus einem DelayNode plus Gain, die Verzögerung als AudioParam. Damit lässt sie sich rampen und von einem Envelope bewegen, ohne Worklet.
  • Mix wie beim Mix-Node.

Rückfragen:

  • sfxr-Phaser (ein Delay mit Sweep, klingt eher nach Flanger) oder ein klassischer Phaser mit mehreren Allpass-Stufen und LFO?
  • Soll er bei den Presets von #329 mitwürfeln?
Aus der Planung von #329 (Gespräch 2026-10-06), dort bewusst ausgeklammert. sfxr hat einen Phaser, der im Chip-Node von #329 nicht enthalten ist. Ein FX-Node *Phaser* im Sound FX und im Instrument. Vorschlag: - Wie bei sfxr: ein kurzes Delay, das mit dem trockenen Signal gemischt wird. Die Verzögerung ändert sich mit **Offset** und **Sweep**. - Mit Web Audio aus einem `DelayNode` plus Gain, die Verzögerung als `AudioParam`. Damit lässt sie sich rampen und von einem Envelope bewegen, ohne Worklet. - **Mix** wie beim *Mix*-Node. Rückfragen: - **sfxr-Phaser** (ein Delay mit Sweep, klingt eher nach Flanger) oder ein **klassischer Phaser** mit mehreren Allpass-Stufen und LFO? - Soll er bei den Presets von #329 mitwürfeln?
meleki added the new label 2026-10-06 20:04:09 +02:00
admin added this to the Development project 2026-10-06 21:50:48 +02:00
admin added question and removed new labels 2026-10-07 07:12:06 +02:00
admin moved this to Next in Development on 2026-10-07 07:12:17 +02:00
admin removed the question label 2026-10-07 11:10:42 +02:00
Author
Owner

Plan (entschieden: 1c, 2a)

Zwei Nodes, beide im Sound FX und im Instrument, beide auf dem FX-Worklet (wie der Bitcrusher), damit die Rückkopplung ohne die Mindestverzögerung von Web Audio (128 Samples in einem Kreis) auskommt.

  • Phaser (der klassische): eine Kette von Allpass-Stufen erster Ordnung, deren Frequenz ein LFO (Sinus) in Oktaven um Frequency bewegt.
    • Stages (2, 4, 6, 8, 12) als Einstellung, Frequency (Hz), Rate (Hz), Depth (Oktaven), Feedback, Mix.
    • Ein Envelope kann Frequency und Mix bewegen.
  • Flanger (der „Phaser“ von sfxr): das Signal plus eine Kopie, die um Offset (ms) verzögert ist. Sweep (ms/s) schiebt die Verzögerung ab Notenbeginn gleichmäßig weiter, ein LFO (Rate, Depth in ms) lässt sie schwingen. Dazu Feedback und Mix.
    • Wie bei sfxr wird die Verzögerung an 0 gespiegelt, ein Offset mit fallendem Sweep läuft also durch 0 und wieder hinauf.
    • Ein Envelope kann Offset und Mix bewegen.
  • Mix: 0 lässt den Klang, wie er ist. 1 ist halb Klang, halb Effekt, dort sind die Kerben am tiefsten. Die Spitzen bleiben dabei bei voller Lautstärke, nichts wird lauter.

Presets (2a):

  • Explosion bekommt wie bei sfxr zu 50 % einen Flanger (Offset und Sweep aus sfxrs Generator, ohne LFO).
  • Randomize würfelt die Zahlen von Phaser und Flanger mit (Offset und Sweep wie sfxrs Randomize, die übrigen in sinnvollen Grenzen). Mix und Stages bleiben, wie beim Bitcrusher.
  • Mutate verschiebt sie wie die anderen Zahlen.
  • Neues Instrument Phased Pad mit dem Phaser. Die anderen 14 bleiben unverändert.

Umrechnung von sfxr: Offset = offset² · 2,89 ms, Sweep = ramp² · 125 ms/s (Vorzeichen so, dass die Richtung stimmt).

## Plan (entschieden: 1c, 2a) **Zwei Nodes**, beide im Sound FX und im Instrument, beide auf dem FX-Worklet (wie der Bitcrusher), damit die Rückkopplung ohne die Mindestverzögerung von Web Audio (128 Samples in einem Kreis) auskommt. - **Phaser** (der klassische): eine Kette von Allpass-Stufen erster Ordnung, deren Frequenz ein LFO (Sinus) in Oktaven um *Frequency* bewegt. - *Stages* (2, 4, 6, 8, 12) als Einstellung, *Frequency* (Hz), *Rate* (Hz), *Depth* (Oktaven), *Feedback*, *Mix*. - Ein Envelope kann *Frequency* und *Mix* bewegen. - **Flanger** (der „Phaser“ von sfxr): das Signal plus eine Kopie, die um *Offset* (ms) verzögert ist. *Sweep* (ms/s) schiebt die Verzögerung ab Notenbeginn gleichmäßig weiter, ein LFO (*Rate*, *Depth* in ms) lässt sie schwingen. Dazu *Feedback* und *Mix*. - Wie bei sfxr wird die Verzögerung an 0 gespiegelt, ein *Offset* mit fallendem *Sweep* läuft also durch 0 und wieder hinauf. - Ein Envelope kann *Offset* und *Mix* bewegen. - **Mix:** 0 lässt den Klang, wie er ist. 1 ist halb Klang, halb Effekt, dort sind die Kerben am tiefsten. Die Spitzen bleiben dabei bei voller Lautstärke, nichts wird lauter. **Presets (2a):** - *Explosion* bekommt wie bei sfxr zu 50 % einen Flanger (Offset und Sweep aus sfxrs Generator, ohne LFO). - Randomize würfelt die Zahlen von Phaser und Flanger mit (Offset und Sweep wie sfxrs Randomize, die übrigen in sinnvollen Grenzen). *Mix* und *Stages* bleiben, wie beim Bitcrusher. - Mutate verschiebt sie wie die anderen Zahlen. - Neues Instrument **Phased Pad** mit dem Phaser. Die anderen 14 bleiben unverändert. Umrechnung von sfxr: *Offset* = offset² · 2,89 ms, *Sweep* = ramp² · 125 ms/s (Vorzeichen so, dass die Richtung stimmt).
admin moved this to Done in Development on 2026-10-07 12:11:48 +02:00
Author
Owner

Done in 01fd6e6, wiki in 5100f69 (Sounds: new section Phaser and Flanger, Instruments, Development).

As planned (1c, 2a), two nodes:

  • Phaser (the classic one): first-order allpass stages (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 (sfxr's "phaser"): the sound plus a copy Offset ms later. Sweep (ms/s) moves the delay on from the start of the voice, to the sample. An LFO (Rate, Depth in ms) can swing it as well. As in sfxr the delay is mirrored at 0. An Envelope can move Offset and Mix.
  • Both run on the FX worklet, so a feedback round does not cost a render quantum as it does in the Delay.
  • Presets: Explosion gets a Flanger in one draw out of two, with sfxr's offset and sweep. Randomize and Mutate take both nodes along. New instrument Phased Pad (saw through a six-stage Phaser). The other 14 instruments are unchanged.

Decisions I made myself

  • Mix: 0 leaves the sound as it is, 1 is half sound and half copy. The notches are deepest there and it never gets louder. sfxr adds both at full, so its sound is 6 dB louder.
  • Longest Flanger delay: 20 ms instead of sfxr's 2.9 ms, so it works as a normal flanger too. A long sweep therefore runs further than in sfxr.
  • Envelope targets: only Frequency / Offset and Mix, not the LFO and not Feedback.
  • Randomize bounds for what sfxr does not have (all of the Phaser, LFO and feedback of the Flanger): Rate 0.05 to 5 Hz, Phaser frequency 200 Hz to 4 kHz.

Tests

Unit phaser (new)                            → 8 green; counter-check 3 red, reset green
Unit soundfx / sound-library / chip-presets  → 45 / 76 / 14 green, every counter-check red
Unit core, viewport, graph                   → 179 files, 2979 green
e2e 34 (melektaus-atx)                       → ALL PASSED, 70 checks (1 new), first run
Gate (melektaus-atx)                         → CHECK EXIT 0, 257 files, 3991 tests
  • Offline in Chrome: a 1 kHz sine through 2 stages at 1 kHz has RMS 0.0000, through 4 stages 0.5657 (unchanged). The Flanger echo comes exactly after 48 samples (1 ms), with Sweep at sample 533/534 as computed.
  • Load: about 47 Phasers with 12 stages or 63 Flangers fill the audio thread.
  • No CI run for this push, automatic runs are switched off for now.

Not checked

  • How it sounds. I only measured, I did not listen.
  • How the new nodes look in the graph and the Inspector, there is no screenshot.
  • The new e2e check had no counter-check, those ran in the unit tests only.
Done in `01fd6e6`, wiki in `5100f69` (*Sounds*: new section *Phaser and Flanger*, *Instruments*, *Development*). As planned (1c, 2a), two nodes: - **Phaser** (the classic one): first-order allpass stages (*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** (sfxr's "phaser"): the sound plus a copy *Offset* ms later. *Sweep* (ms/s) moves the delay on from the start of the voice, to the sample. An LFO (*Rate*, *Depth* in ms) can swing it as well. As in sfxr the delay is mirrored at 0. An Envelope can move *Offset* and *Mix*. - Both run on the FX worklet, so a feedback round does not cost a render quantum as it does in the Delay. - **Presets:** *Explosion* gets a Flanger in one draw out of two, with sfxr's offset and sweep. Randomize and Mutate take both nodes along. New instrument **Phased Pad** (saw through a six-stage Phaser). The other 14 instruments are unchanged. ### Decisions I made myself - **Mix:** 0 leaves the sound as it is, 1 is half sound and half copy. The notches are deepest there and it never gets louder. sfxr adds both at full, so its sound is 6 dB louder. - **Longest Flanger delay:** 20 ms instead of sfxr's 2.9 ms, so it works as a normal flanger too. A long sweep therefore runs further than in sfxr. - **Envelope targets:** only *Frequency* / *Offset* and *Mix*, not the LFO and not *Feedback*. - **Randomize bounds** for what sfxr does not have (all of the Phaser, LFO and feedback of the Flanger): Rate 0.05 to 5 Hz, Phaser frequency 200 Hz to 4 kHz. ### Tests ``` Unit phaser (new) → 8 green; counter-check 3 red, reset green Unit soundfx / sound-library / chip-presets → 45 / 76 / 14 green, every counter-check red Unit core, viewport, graph → 179 files, 2979 green e2e 34 (melektaus-atx) → ALL PASSED, 70 checks (1 new), first run Gate (melektaus-atx) → CHECK EXIT 0, 257 files, 3991 tests ``` - Offline in Chrome: a 1 kHz sine through 2 stages at 1 kHz has RMS 0.0000, through 4 stages 0.5657 (unchanged). The Flanger echo comes exactly after 48 samples (1 ms), with Sweep at sample 533/534 as computed. - Load: about 47 Phasers with 12 stages or 63 Flangers fill the audio thread. - No CI run for this push, automatic runs are switched off for now. ### Not checked - How it sounds. I only measured, I did not listen. - How the new nodes look in the graph and the Inspector, there is no screenshot. - The new e2e check had no counter-check, those ran in the unit tests only.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#341