Stereo Swirl Vibrato — User Guide

Three-dimensional pitch modulation: creates immersive swirling vibrato effects by applying phase-shifted pitch modulation to left and right channels, producing the sensation of sound rotating around the listener's head in three-dimensional space.

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

What this does

This script creates immersive three-dimensional vibrato by applying phase-shifted pitch modulation to stereo channels. Unlike traditional vibrato that affects both channels identically, this effect creates the sensation of sound swirling around the listener by delaying the vibrato cycles between left and right channels. The result is a captivating spatial modulation that makes audio appear to rotate in three-dimensional space, creating everything from subtle stereo enhancement to intense psychedelic spirals.

Key Features:

Why stereo phase shifting creates swirl? When the same vibrato pattern is applied to both channels simultaneously, the brain perceives it as a single sound source wobbling in place. But when the vibrato cycles are offset between channels, our auditory system interprets this as motion—the sound appears to move from one side to the other. This psychoacoustic phenomenon, combined with pitch modulation, creates the compelling illusion of three-dimensional rotation that defines the "swirl" effect.

Technical Implementation: (1) Stereo verification: Ensures input is exactly 2-channel stereo. (2) Phase calculation: Applies different phase offsets to left (row 1) and right (row 2) channels. (3) Delay modulation: Uses variable delay lines to create pitch shifts. (4) Mathematical core: delay = base + base×depth×sin(2π×rate×t + (row-1)×phase_step). (5) Bounds protection: Ensures delay indices stay within valid sample range. (6) Quality preservation: Maintains original stereo image while adding motion.

Quick start

  1. In Praat, select exactly one stereo Sound object (2 channels required).
  2. Run script…stereo_swirl_vibrato.praat.
  3. Choose a Preset or select "Custom" to adjust parameters manually.
  4. Adjust Delay Parameters:
    • base_delay_ms: Center delay time (4-10 ms)
    • modulation_depth: Pitch modulation intensity (0.08-0.25)
    • modulation_rate_hz: Vibrato speed (1.5-8.0 Hz)
  5. Set Stereo Phase for spatial character:
    • phase_step_radians: Channel offset (0.785-4.712 rad, 45°-270°)
  6. Click OK — effect applied, result named "originalname_vibrato_stereo_swirl".
  7. Check Info window for detailed processing report.
Quick tip: Start with Gentle Stereo Chorus for subtle enhancement or Wide Stereo Swirl for dramatic effects. Use Rotating Leslie for slow, organ-like rotation. Higher phase_step_radians creates more dramatic channel separation. The effect works wonderfully on stereo pads, vocals, and instrument sections. For headphones listening, use 90°-180° phase offsets; for speakers, 180°-270° may work better.
Important: This script requires stereo input (exactly 2 channels). Mono files will be rejected. Very high modulation_depth (>0.25) may cause audible artifacts. Extreme modulation_rate_hz (>8 Hz) can create unnatural fluttering. The effect uses delay-line pitch shifting which works best on sustained, harmonic material. Complex polyphonic content may produce less clear results than monophonic sources.

Stereo Phase Theory

The Swirl Illusion Mechanism

How Phase Offsets Create Motion

The core principle uses phase-shifted modulation between channels:

LEFT CHANNEL MODULATION: delay_L(t) = base + base × depth × sin(2π × rate × t + 0) RIGHT CHANNEL MODULATION: delay_R(t) = base + base × depth × sin(2π × rate × t + phase_step) PERCEPTUAL RESULT: When phase_step = 0: Both channels modulate together → centered vibrato When phase_step = π/2 (90°): Right channel lags left by 1/4 cycle → clockwise swirl When phase_step = π (180°): Channels in opposite phase → maximum width When phase_step = 3π/2 (270°): Right channel leads left → counterclockwise swirl The brain interprets these phase differences as spatial motion, creating the swirling illusion

🔄 Understanding Phase Relationships

Phase step values and their perceptual effects:

  • 0 radians (0°): Mono vibrato - both channels identical
  • π/4 radians (45°): Subtle motion - gentle stereo enhancement
  • π/2 radians (90°): Clear rotation - natural swirling motion
  • π radians (180°): Maximum width - dramatic back-and-forth
  • 3π/2 radians (270°): Intense spiral - exaggerated rotation

Different phase values create different types and intensities of spatial motion.

Delay-Line Pitch Shifting

How Variable Delays Create Vibrato

The script uses delay-line modulation for pitch effects:

PITCH SHIFTING PRINCIPLE: Shortening delay → higher pitch (waveforms compressed) Lengthening delay → lower pitch (waveforms stretched) MATHEMATICAL IMPLEMENTATION: output = input[t - delay(t)] Where delay(t) varies sinusoidally: delay(t) = base + base × depth × sin(2π × rate × t + phase) PITCH VARIATION CALCULATION: Maximum pitch shift ≈ ±(depth × 100) cents Example: depth = 0.12 → ±12 cents variation (~0.12 semitones) This method provides clean pitch modulation without the artifacts of resampling or phase vocoding

Delay Parameter Ranges

Typical delay parameter values:

base_delay_ms ranges:
3-5 ms: Very subtle pitch effects
5-7 ms: Natural vibrato range
7-10 ms: Strong, dramatic vibrato
10+ ms: Special effects, potential artifacts

modulation_depth effects:
0.05-0.10: Subtle, barely perceptible
0.10-0.15: Moderate, clear vibrato
0.15-0.20: Strong, obvious modulation
0.20-0.25: Very strong, dramatic effect

modulation_rate_hz musicality:
1.0-3.0 Hz: Very slow, special effect
3.0-5.0 Hz: Slow to medium, lyrical
5.0-7.0 Hz: Medium to fast, typical vibrato
7.0-9.0 Hz: Fast, intense, special effect

Psychoacoustic Foundations

Why We Perceive Swirling Motion

The auditory system uses several cues for spatial perception:

BINAURAL CUES FOR SPATIAL HEARING: INTERAURAL TIME DIFFERENCES (ITD): - Sound reaches closer ear slightly earlier - Brain uses ~0.6 ms difference for localization - This script creates artificial ITD through phase offsets INTERAURAL LEVEL DIFFERENCES (ILD): - Sound is louder at closer ear - High frequencies affected more than low - Created naturally by head shadowing PITCH MOTION CUES: - Doppler effect: pitch rises as source approaches - Combined with spatial cues → perceived rotation - This script enhances with pitch modulation The combination of these cues creates the compelling swirl illusion that feels three-dimensional

Spatial Physics

🌐 Three-Dimensional Sound Field

The script creates virtual speaker rotation through mathematical modeling:

VIRTUAL ROTATION MODEL: Imagine two speakers rotating around listener Left speaker angle: θ_L(t) = 2π × rate × t Right speaker angle: θ_R(t) = 2π × rate × t + phase_step DOPPLER SIMULATION: As virtual speaker moves toward listener: delay decreases → pitch rises As virtual speaker moves away: delay increases → pitch falls SPATIAL AMPLITUDE (implied): Speaker facing listener → louder Speaker facing away → quieter This creates natural amplitude modulation The combined effect: sound appears to orbit listener in a circle with accompanying pitch changes

Headphone vs Speaker listening:

  • Headphones: Perfect channel separation, precise phase effects
  • Speakers: Natural crosstalk, more diffuse but natural spatial image
  • Optimal phase: 90°-180° for headphones, 180°-270° for speakers

Mathematical Implementation

The Core Swirl Algorithm

The script uses a sophisticated single-formula approach:

PRAAT FORMULA IMPLEMENTATION: "self[max(1, min(ncol, col + round('base' + 'base' * 'modulation_depth' * sin(2 * pi * 'modulation_rate_hz' * x + (row - 1) * 'phase_step_radians'))))]" COMPONENT BREAKDOWN: base = base_delay_ms × sampling_rate / 1000 (row - 1) = 0 for left channel, 1 for right channel max(1, min(ncol, ...)) = bounds protection round() = sample-accurate delay indexing CHANNEL-SPECIFIC BEHAVIOR: Left channel (row 1): phase = 2π×rate×t + 0 Right channel (row 2): phase = 2π×rate×t + phase_step This elegant implementation handles both channels in a single formula with automatic row-based phase shifting

Phase Step Mathematics

Common phase values and their effects:

0.785 rad (45°):
Right channel lags by 1/8 cycle → subtle motion

1.571 rad (90°):
Right channel lags by 1/4 cycle → clear rotation

3.142 rad (180°):
Channels in opposite phase → maximum width

4.712 rad (270°):
Right channel leads by 1/4 cycle → reverse rotation

6.283 rad (360°):
Full cycle = 0° → back to mono

Mathematical note: Phase values beyond 2π (360°) wrap around, so 450° = 90°, etc.

Complete Processing Pipeline

🔄 Stereo Swirl Processing Steps

STEP 1: Input Validation

Check: selected("Sound") exists Verify: Get number of channels = 2 Purpose: Ensure proper stereo input

STEP 2: Parameter Setup

Apply preset values if selected Calculate: base = base_delay_ms × sampling_rate / 1000 Display: Parameters in Info window

STEP 3: Swirl Application

Create working copy of sound Apply single-formula processing: Left channel: phase = 2π×rate×t + 0 Right channel: phase = 2π×rate×t + phase_step Use bounds protection for sample indexing

STEP 4: Final Processing

Scale peak to prevent clipping Rename output with descriptive suffix Display completion message in Info window Play result if requested

Swirl Presets

Gentle Stereo Chorus

🎵 Subtle Spatial Enhancement

Settings: Base: 5.0 ms, Depth: 0.10, Rate: 5.0 Hz, Phase: 90°

Character: Gentle, natural swirling with subtle pitch modulation

Best for: General stereo enhancement, vocal thickening

Wide Stereo Swirl

🌊 Dramatic Spatial Motion

Settings: Base: 6.0 ms, Depth: 0.15, Rate: 4.5 Hz, Phase: 180°

Character: Wide, dramatic back-and-forth motion between speakers

Best for: Special effects, dramatic moments

Rotating Leslie

🎹 Slow Organ-like Rotation

Settings: Base: 8.0 ms, Depth: 0.18, Rate: 1.5 Hz, Phase: 90°

Character: Slow, deliberate rotation reminiscent of Leslie speaker

Best for: Organ sounds, slow pads

Psychedelic Spiral

🌀 Intense Swirling Motion

Settings: Base: 7.0 ms, Depth: 0.20, Rate: 6.0 Hz, Phase: 270°

Character: Fast, intense spiraling with strong pitch modulation

Best for: Psychedelic effects, intense moments

Subtle Width

🔊 Gentle Stereo Enhancement

Settings: Base: 4.0 ms, Depth: 0.08, Rate: 4.0 Hz, Phase: 45°

Character: Very subtle motion that mainly enhances stereo width

Best for: Background elements, subtle enhancement

Extreme Dizzy

🎢 Maximum Intensity Rotation

Settings: Base: 10.0 ms, Depth: 0.25, Rate: 8.0 Hz, Phase: 180°

Character: Fast, deep modulation with extreme spatial motion

Best for: Special effects, intense transitions

PresetBase (ms)DepthRate (Hz)PhaseMotionIntensity
Gentle Chorus5.00.105.090°Clear rotationSubtle
Wide Swirl6.00.154.5180°Back-and-forthDramatic
Rotating Leslie8.00.181.590°Slow rotationModerate
Psychedelic7.00.206.0270°Fast spiralIntense
Subtle Width4.00.084.045°Gentle motionVery subtle
Extreme Dizzy10.00.258.0180°Intense motionExtreme

Parameters

Delay Parameters

ParameterTypeRangeDefaultDescription
base_delay_mspositive3.0-12.06.0Center delay time in milliseconds
modulation_depthpositive0.05-0.250.12Pitch modulation intensity
modulation_rate_hzpositive1.0-9.04.5Vibrato speed in Hz

Stereo Phase Parameters

ParameterTypeRangeDefaultDescription
phase_step_radiansreal0.0-6.2831.571Phase offset between channels

Output Options

ParameterTypeRangeDefaultDescription
scale_peakpositive0.1-1.00.99Output normalization level
play_after_processingbooleanyes/noyesAuto-play processed sound

Parameter Combinations

Effective parameter combinations:

Natural vocal enhancement:
Base: 5-6 ms, Depth: 0.08-0.12, Rate: 4-6 Hz, Phase: 90°-135°

Dramatic special effects:
Base: 7-10 ms, Depth: 0.15-0.22, Rate: 2-4 Hz or 6-8 Hz, Phase: 180°-270°

Subtle stereo widening:
Base: 4-5 ms, Depth: 0.05-0.08, Rate: 3-5 Hz, Phase: 45°-90°

Leslie speaker simulation:
Base: 7-9 ms, Depth: 0.15-0.20, Rate: 1.5-3 Hz, Phase: 90°

Psychedelic effects:
Base: 6-8 ms, Depth: 0.18-0.25, Rate: 5-7 Hz, Phase: 180°-270°

Experiment with these starting points for different applications

Applications

Stereo Enhancement and Widening

Use case: Adding spatial interest to stereo mixes and tracks

Technique: Use subtle settings for enhancement

Application strategies:

Result: Enhanced stereo image with natural motion

Special Effects and Sound Design

Use case: Creating dramatic spatial effects

Technique: Use extreme settings for maximum impact

Creative applications:

Result: Dramatic spatial audio effects

Vintage Effect Emulation

Use case: Recreating classic rotary and chorus effects

Technique: Use authentic parameter combinations

Vintage emulation approaches:

Result: Authentic vintage spatial effects

Practical Workflow Examples

🎧 Headphone Mix Enhancement

Goal: Create immersive headphone experience

Process:

  • Use Gentle Stereo Chorus preset
  • Adjust phase to 90°-135° for optimal headphones
  • Apply to stereo pads and background elements
  • Use subtle depth (0.08-0.12) for natural sound

Result: Immersive headphone mix with natural motion

🎹 Vintage Organ Simulation

Goal: Authentic Leslie speaker effect

Process:

  • Start with Rotating Leslie preset
  • Adjust rate to 1.5-2.5 Hz for slow rotation
  • Use depth 0.15-0.20 for clear pitch modulation
  • Apply to organ or electric piano sounds

Result