AdvancedDelayA stereo delay with every control of the delay engine. Use it for tape-style echoes, dub delays, or anything between a stereo delay and a ping-pong delay.
Extends Effector (through the internal DelayEngine base class).
All four delays (MonoDelay, StereoDelay, PingPongDelay and AdvancedDelay) run the same WebAssembly delay engine in a different mode. Delay time changes glide smoothly over about 50 ms, so changing the time while audio plays gives a short pitch bend instead of a click. The delay keeps processing when its input goes silent, so echoes ring out naturally.
+----------------------------- dry ----------------------------+
input L/R --+-> delay line L/R --+--------------------------- wet ---------+-> mix -> output
^ |
| v
+-- drive <- high cut <- low cut <- cross feedback mix <-+
0 keeps the sides separate (stereo delay), 1 swaps them on every repeat (ping-pong).import { AdvancedDelay } from "@fluex/fluexgl-dsp";
// A dark, warm tape echo.
const tape = new AdvancedDelay({
delayLeftMs: 350,
delayRightMs: 350,
feedback: 0.6,
crossFeedback: 0,
lowCut: 150,
highCut: 3500,
modulationRate: 0.8,
modulationDepth: 2,
drive: 0.5,
mix: 0.3
});
channel.addEffect(tape);
// Automate the time for a pitch-bending "tape stop"-like effect.
tape.setDelayLeftMs(700);
tape.setDelayRightMs(700);
new AdvancedDelay(options?: Partial<AdvancedDelayOptions>): AdvancedDelay;
options?: Partial<AdvancedDelayOptions>
Every field is optional, falls back to the defaults below, and is clamped to its valid range.| Property | Range | Default |
|---|---|---|
| delayLeftMs: number | 1 to 4000 ms | 375 |
| delayRightMs: number | 1 to 4000 ms | 500 |
| feedback: number | 0 to 0.98 | 0.45 |
| crossFeedback: number | 0 (stereo) to 1 (ping-pong) | 0.2 |
| mix: number | 0 to 1 | 0.35 |
| lowCut: number | 0 (off) to 2000 Hz | 120 |
| highCut: number | 0 (off) or a frequency in Hz; at or above Nyquist is off | 6000 |
| modulationRate: number | 0 to 10 Hz | 0.5 |
| modulationDepth: number | 0 (off) to 20 ms | 0 |
| drive: number | 0 (off) to 1 | 0.2 |
| strictMode: StrictMode | | StrictMode.Disabled |
label and name default to "AdvancedDelay".
initializeOnAttachment(context: AudioContext): Promise<void>Creates the AdvancedDelayProcessor AudioWorklet node with the current values.
returnOptionsAsObject(): AdvancedDelayOptionsReturns a snapshot of the current values.
setDelayLeftMs(delayMs: number): boolean
setDelayRightMs(delayMs: number): boolean
setFeedback(feedback: number): boolean
setCrossFeedback(crossFeedback: number): boolean
setMix(mix: number): boolean
setLowCut(lowCut: number): boolean
setHighCut(highCut: number): boolean
setModulationRate(modulationRate: number): boolean
setModulationDepth(modulationDepth: number): boolean
setDrive(drive: number): boolean
Every setter clamps the value to the range in the table above, stores it, and sends it to the processor.
boolean - true when the value was sent to the processor, false when the effect is not attached yet. The value is stored either way and used on attachment.Inherited from Effector. The AdvancedDelayProcessor processor sends processor-wasm-instantiated when its WebAssembly module is ready, and an incoming-processor-message for every parameter change.
Runs on an AudioWorklet backed by WebAssembly. Attach it only after await pipeline.initializeDpsPipeline(), on the AudioDevice returned by resolveDefaultAudioOutputDevice(). Requires a worklet and WASM build from FluexGL-DSP-WebAssembly 0.4.9 or newer, which registers AdvancedDelayProcessor.