Stereo Flanger — User Guide

A causal fractional-delay flanger with a true recursive feedback loop, sinusoidal delay modulation, and phase-offset stereo trajectories.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4 (2026) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

Stereo Flanger combines the source with a short, sinusoidally modulated delay. The changing delay continuously moves the comb-filter peaks and notches through the spectrum. A recursive feedback state can reinforce or reshape those resonances, while a phase offset between two modulation trajectories creates stereo motion.

The implementation is fully causal. Delay time is never allowed below one sample, and delayed reads use linear fractional interpolation rather than rounded sample positions. This gives a continuously moving delay trajectory without integer-sample stepping.

Core processing model: the flanger first builds a recursive state from the input and delayed state history. The final output then blends the untouched source with a delayed read from that recursive state.

Signal flow

1. Delay trajectory

For each output sample, the script calculates a fractional read position from a sinusoidal delay:

delay(t) = BaseDelay + Depth × sin(2π × Rate × local_time + channel_phase) read_position = current_sample − delay_in_samples

2. Recursive feedback state

state[n] = input[n] + Feedback × state[n − delay[n]]

The delayed state is read with linear interpolation between neighboring samples. Because the formula proceeds causally through the Sound, earlier processed samples become the feedback memory for later samples.

3. Final Dry/Wet output

output[n] = Dry × input[n] + Wet × state[n − delay[n]] Dry = 1 − Wet Wet = Dry_wet_percent / 100

At 0% Wet, the script uses a separate exact-bypass path: the selected Sound is copied directly and no feedback processing or Safety Peak scaling is applied.

Delay modulation

Base Delay sets the center of the moving delay and Depth sets the excursion around it. The script automatically keeps the complete trajectory causal:

effectiveBase = max(BaseDelay, one_sample) effectiveDepth = min(Depth, effectiveBase − one_sample) minimum delay = effectiveBase − effectiveDepth maximum delay = effectiveBase + effectiveDepth

If the requested settings would drive the delay below one sample, the effective values are clamped and the Info window reports that a causal delay clamp was applied.

Local-time LFO

The LFO phase uses local Sound time, measured from the Sound's own start. Moving an otherwise identical Sound to another xmin therefore does not change the flanger trajectory.

Through-Zero preset

Through-Zero (Simulated) uses a very short base delay and a depth that approaches the one-sample causal limit. It does not implement true through-zero flanging, because a true crossing through zero would require delaying the dry reference as well so the modulated branch could pass from lagging to leading it.

Recursive feedback

Feedback is clamped internally to −0.98…+0.98 so the recursive loop remains below unity magnitude.

Positive feedback

Reinforces the recursive state with the same sign. Increasing the value makes the static comb response more sharply resonant.

Negative feedback

Feeds the delayed state back with inverted sign, changing which regions of the comb response are emphasized.

The feedback is applied inside the state recursion itself; it is not a one-reflection approximation and it is not simply an extra delayed copy mixed after processing.

Stereo & channel behavior

Mono input

When processing is active, mono input is converted to stereo. Channel 1 uses the left LFO trajectory and channel 2 uses the phase-offset right trajectory.

Existing stereo or multichannel input

The original channel count is preserved. Channels are not summed or cross-fed:

odd channels → left trajectory: phase = 0° even channels → right trajectory: phase = Stereo phase offset

Each channel has its own recursive feedback history. The only shared information is the parameter set and the odd/even phase-routing rule.

Phase offset

The entered phase is wrapped into 0…360°. A value of 0° gives matching delay trajectories; 180° gives counter-sweeping odd/even trajectories. The phase offset changes modulation timing between channel groups, not the polarity of the audio signal itself.

Presets

PresetRateDepthBasePhaseFeedbackWet
Customform valueform valueform valueform valueform valueform value
Classic 80s Flanger0.5 Hz1.5 ms2.0 ms90°+0.6050%
Slow Jet (High Feedback)0.15 Hz2.5 ms3.0 ms180°+0.8550%
Liquid Metal (Negative FB)3.0 Hz0.5 ms1.0 ms180°−0.7060%
Deep Throat (Long Delay)0.4 Hz4.0 ms8.0 ms45°+0.5050%
Through-Zero (Simulated)0.2 Hz0.9 ms1.0 ms180°+0.4070%
Subtle Stereo Widener0.1 Hz1.0 ms5.0 ms180°+0.1040%

Parameters

ParameterDefaultWhat it controlsRuntime handling
Rate Hz0.3Sinusoidal sweep rate.Negative values become 0.
Depth ms2.0Peak delay excursion around the base delay.Minimum 0; reduced automatically if necessary to retain at least one-sample delay.
Base delay ms3.0Center delay of the flanger trajectory.Minimum one sample.
Stereo phase offset deg180Phase difference between odd- and even-channel LFO trajectories.Wrapped into 0…360°.
Feedback0.7Recursive feedback coefficient.Clamped to −0.98…+0.98.
Dry/Wet percent50Blend between untouched source and delayed recursive state.Clamped to 0…100%; 0 uses exact bypass.
Safety peak0.99Maximum permitted peak after active processing.Clamped to 0…1; 0 disables safety; attenuation only.
Draw visualizationyesCreates the AudioTools figure.Does not change audio.
Play resultyesPlays the finished Sound.Does not change audio.

Safety Peak

After active processing, the script measures the peak. It scales the Sound only when that peak exceeds Safety Peak. Material already below the ceiling is left unchanged.

Safety Peak is not normalization. It only attenuates an over-threshold result and is skipped entirely on the exact dry bypass.

Output properties

PropertyBehavior
Mono + active effectBecomes stereo.
Stereo / multichannel + active effectOriginal channel count is preserved.
0% WetExact copied bypass; original channel count is preserved, including mono.
Sample ratePreserved.
Duration / sample countPreserved.
Start timePreserved.
RandomnessNone. Processing is deterministic.

Visualization

When Draw visualization is enabled, v0.4 creates the AudioTools house layout:

Input

Original waveform.

Output

Final processed waveform.

Delay trajectory

Left/odd and right/even delay curves over the first up to 3 seconds, with the effective base delay shown as a reference line.

Static transfer @ base delay

The magnitude response predicted from the actual recursive-feedback transfer function at the effective base delay, using the current Feedback and Dry/Wet values.

Static transfer function

For the fixed base-delay snapshot, the visualization corresponds to:

H(f) = Dry + Wet × z⁻ᴰ / (1 − Feedback × z⁻ᴰ)

This panel is a static reference for the base delay. During actual processing, the delay is moving according to the LFO, so the comb response sweeps continuously through time.

Summary strip

The summary reports rate, effective base/depth, phase offset, feedback, Wet percentage, output channel count, sample rate, duration, and Safety setting.