BPM Surround Panning — User Guide

8-channel immersive audio spatialization: creates mathematical motion patterns (orbits, spirals, swarms) in 7.1 surround sound by applying time-varying amplitude envelopes across speaker channels for experimental spatial composition.

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

What this does

This script implements algorithmic surround sound spatialization — a mathematical approach to creating immersive 3D audio experiences using parametric motion patterns. Takes mono or stereo source audio, distributes it across 8 channels (7.1 surround: FL, FR, C, LFE, SL, SR, BL, BR), applies time-varying amplitude envelopes to each channel based on chosen spatial pattern. Process creates perceived movement: sound source appears to orbit, spiral, bounce, or swarm through listening space. Mathematical formulas control spatial trajectories: trigonometric functions (sine/cosine) for circular motion, modulo operations for bouncing, Lissajous curves for figure-8 patterns, composite sine waves for chaotic swarm behavior. Result: spatially-animated audio where listener perceives sound moving through 3D space according to algorithmic patterns rather than static positioning or manual automation.

Key Features:

What is algorithmic spatialization? Traditional surround: Static speaker placement (dialogue center, music front, effects rear) or manual panning automation (engineer draws movement paths). Algorithmic spatialization: Mathematical functions control amplitude distribution across channels over time. Advantages: (1) Precision: Exact mathematical trajectories (perfect circles, precise spirals). (2) Reproducibility: Same parameters = identical spatial movement (no automation variance). (3) Complexity: Create patterns impossible to draw manually (swarm with 7 independent sine waves). (4) Scalability: Adjust speed/pattern instantly via parameters. (5) Experimentation: Explore unconventional spatial behaviors (quantum probability clouds, DNA helixes). Use cases: Experimental music composition (non-natural spatial movements), sound art installations (mathematical motion aesthetics), spatial audio research (algorithmic trajectory studies), generative soundscapes (automated spatialization), immersive storytelling (abstract spatial narratives), teaching (demonstrating spatial audio concepts).

Technical Implementation: (1) Input processing: Accepts mono or stereo source, converts stereo to mono for spatialization base. (2) Channel duplication: Creates 8 independent copies of mono source (one per speaker). (3) Pattern application: For each spatial pattern, unique amplitude envelope formula applied to each channel: Time variable x = sample position in seconds, Base rate = cycles_per_file / duration (movement frequency in Hz), Channel formulas use trigonometric functions with phase offsets: FL, FR phase offset ±π/4 (front quadrants), SL, SR phase offset ±π/2 (side positions), BL, BR phase offset ±3π/4 (back quadrants), C phase offset 0 (center reference), LFE constant or low-frequency modulation (subwoofer), Floor minimum 0.05 (5% prevents complete silence), modulation depth typically 0.45 (45% variation around 50% baseline). (4) Output creation: 8 individual channel files (mono WAV-compatible), Stereo preview (FL + FR for basic listening), Binaural downmix (HRTF-approximated headphone version). (5) Mathematical mapping: Circular patterns: cos(ωt + φ) where ω = 2π × base_rate, φ = channel-specific phase, Spiral patterns: radius(t) × cos(ωt + φ) where radius varies sinusoidally, Figure-8: parametric Lissajous curves with 2:1 frequency ratios, Bounce: absolute value of modulo operations (sawtooth reflection), Swarm: sum of multiple inharmonic sine waves (chaotic but deterministic).

Quick start

  1. In Praat, select exactly one Sound object (mono or stereo).
  2. Run script…BPM_SURROUND__Panning.praat.
  3. Choose Cycles_Per_File: Number of complete spatial cycles (1 = very slow, 64 = very fast).
  4. Choose Spatial_Pattern: Select from 15 algorithmic motion patterns.
  5. Click OK — script processes audio and creates 8 channel files.
  6. Review Info window for processing details and channel layout.
  7. Listen to stereo_preview (FL + FR channels) or binaural_headphone_mix for spatial effect.
  8. Export individual channels for DAW assembly into true 7.1 surround file.
Quick tip: Start with Circle (clockwise orbit) pattern at 4 cycles to hear basic spatial movement. Use stereo_preview for quick audition (limited spatial impression). Switch to binaural_headphone_mix for better spatial perception on headphones (includes HRTF approximation). Try Figure-8 or Spiral for more complex motion. Increase to 16 or 32 cycles for faster, more energetic movement. Decrease to 1-2 cycles for slow, cinematic spatial sweeps. Check individual channel files (channel_1_FL through channel_8_BR) to verify spatial distribution. Export all 8 channels as WAV files for external mixing in DAW (Reaper, Logic, Pro Tools with 7.1 support).
Important: CREATES 8+ OBJECTS — Script generates 10 Sound objects (8 channels + stereo preview + binaural mix). Praat limitation: No native 7.1 multichannel support — channels created as separate mono files (must be combined externally). Stereo source: Automatically converted to mono before spatialization (stereo image collapsed to single source point). Speed consideration: Movement rate = cycles / duration — short files with many cycles = very fast motion (may sound unnatural). Long files with few cycles = slow, subtle motion. Minimum amplitude: Channels maintain 5% minimum (floor at 0.05) to prevent complete silence in any speaker. LFE channel: Low-frequency effects (subwoofer) typically has constant or minimal modulation (not meant for rapid panning). Binaural approximation: Simplified HRTF simulation (not true binaural — lacks detailed head-related transfer function convolution). Export workflow: For professional use, export all 8 channels as individual WAV files, import into DAW, arrange in 7.1 channel order, render as multichannel audio file.

Spatialization Theory

Amplitude-Based Panning Fundamentals

Vector Base Amplitude Panning (VBAP) Principles

Spatial audio through amplitude distribution:

Sound source position creates perceived location via speaker amplitude ratios Listener perceives virtual source position between active speakers Basic stereo panning (2 speakers): Left amplitude: L(t) = (1 - pan) × signal Right amplitude: R(t) = pan × signal Where pan ∈ [0, 1]: 0 = full left, 0.5 = center, 1 = full right Surround panning (8 speakers in 7.1): Each speaker receives time-varying gain: channel_i(t) = g_i(t) × signal Where g_i(t) = spatial envelope function for speaker i Position vector determines which speakers active at time t Example circular motion (clockwise): FL: 0.5 + 0.45 × cos(ωt - 5π/4) [front-left quadrant] FR: 0.5 + 0.45 × cos(ωt - π/4) [front-right quadrant] SR: 0.5 + 0.45 × cos(ωt - π/2) [side-right] BR: 0.5 + 0.45 × cos(ωt - 3π/4) [back-right quadrant] Phase offsets (0, π/4, π/2, 3π/4, π, 5π/4, 3π/2, 7π/4) create 8-point circle

7.1 Surround Speaker Layout

ITU-R BS.775 standard speaker positions:

Channel Configuration (Praat channel order): 1. FL (Front Left) — 30° left of center, front 2. FR (Front Right) — 30° right of center, front 3. C (Center) — 0° (directly ahead) 4. LFE (Low Frequency) — Subwoofer (non-directional, <120 Hz) 5. SL (Surround Left) — 90-110° left (side-rear) 6. SR (Surround Right) — 90-110° right (side-rear) 7. BL (Back Left) — 135-150° left (rear quadrant) 8. BR (Back Right) — 135-150° right (rear quadrant) Spatial representation: C (0°) / \ FL / \ FR 30° 30° | | SL 110° 110° SR | | BL BR 150° 150° \ | / LFE Listener positioned at origin (0,0), facing forward (0°)

Mathematical Pattern Generation

Parametric Motion Equations

Spatial trajectories via mathematical functions:

1. CIRCULAR MOTION (uniform orbit): x(t) = r × cos(ωt + φ) y(t) = r × sin(ωt + φ) Where: r = radius (constant for circle) ω = angular velocity = 2π × frequency φ = initial phase (determines starting position) t = time Application to speaker i: g_i(t) = 0.5 + 0.45 × cos(ωt + φ_i) φ_i = speaker angular position (0, π/4, π/2, ...) 2. SPIRAL MOTION (radius varies): r(t) = r_0 + A × sin(ω_r × t) x(t) = r(t) × cos(ω_θ × t + φ) y(t) = r(t) × sin(ω_θ × t + φ) Where: r_0 = base radius A = radius modulation amplitude ω_r = radius modulation frequency (typically ω_θ / 8) ω_θ = rotation frequency 3. FIGURE-8 (Lissajous curve with 2:1 ratio): x(t) = A × sin(ωt) y(t) = B × sin(2ωt) Creates infinity symbol (∞) trajectory Application uses: x × cos(4πft) for horizontal spread 4. BOUNCE (reflected sawtooth): x(t) = |((ft) mod 4) - 2| - 1 y(t) = |((1.5ft) mod 6) - 3| - 1.5 Creates ricocheting motion with wall reflections Absolute value creates "bounce" at boundaries

Frequency and Cycle Calculation

Movement rate determination:

Speed Parameters

Base rate formula:
base_rate = cycles_per_file / duration (Hz) Where: cycles_per_file ∈ {1, 2, 4, 8, 16, 32, 64} duration = audio file length in seconds Examples: 30-second file, 4 cycles: base_rate = 4 / 30 = 0.133 Hz Period = 1 / 0.133 = 7.5 seconds per orbit 10-second file, 16 cycles: base_rate = 16 / 10 = 1.6 Hz Period = 0.625 seconds per orbit (fast) 60-second file, 1 cycle: base_rate = 1 / 60 = 0.0167 Hz Period = 60 seconds (one full orbit) Angular velocity (for circular motion): ω = 2π × base_rate (radians per second)

Amplitude Modulation Depth

Dynamic Range Control

Channel gain formula structure:

Standard form: g(t) = baseline + depth × modulation(t) Used in script: g(t) = 0.5 + 0.45 × cos(ωt + φ) g(t) = max(0.05, g(t)) [apply floor] Components: baseline = 0.5 (50% constant amplitude) depth = 0.45 (45% modulation range) floor = 0.05 (5% minimum to prevent silence) Resulting range: Maximum: 0.5 + 0.45 = 0.95 (95% amplitude) Minimum: 0.05 (5% amplitude, via floor) Modulation: 0.50 ± 0.45 before floor Why this range? - Prevents complete silence (floor at 5%) - Avoids clipping (max at 95% < 1.0) - Creates clear spatial movement (90% range: 5-95%) - Maintains audibility in all speakers (no dead zones)
Amplitude floor rationale: Without floor (allowing g(t) → 0), speaker would completely silence during spatial motion — creates "gaps" in audio continuity where sound disappears. With floor at 0.05, sound always present at minimum 5% — maintains spatial impression without discontinuity. Trade-off: reduces maximum contrast (90% range vs 100%), but improves perceptual quality for continuous spatial movement. Alternative floors: 0.1 (10%) for less contrast, 0.0 for maximum range (with potential silence), 0.2 (20%) for subtle spatial effects.

Spatial Patterns

Geometric Patterns (Predictable, Mathematical)

1. Circle (Clockwise Orbit)

Description: Uniform circular motion around listener at constant radius. Sound source travels through each speaker position sequentially: FL → FR → SR → BR → BL → SL → FL. Classic panning effect, predictable trajectory.

Formula: g_i(t) = 0.5 + 0.45 × cos(2πft + φ_i) where φ_i = speaker angular position

Applications: Traditional surround panning, cinematic flyby effects, rotating soundscapes, testing speaker setup, demonstrating basic spatialization.

Best speed: 2-8 cycles for clear circular perception, 16+ cycles for energetic whirl.

2. Figure-8 (Infinity Loop)

Description: Lissajous curve creating figure-8 (∞) trajectory. Sound crosses through center twice per cycle, creating front-back and left-right motion pattern. Non-circular path adds complexity.

Formula: g(t) = 0.5 + 0.4 × sin(2πft) × cos(4πft) (parametric 2:1 frequency ratio)

Applications: Abstract spatial patterns, musical phrasing (wave-like motion), psychoacoustic experiments, decorative panning.

Best speed: 1-4 cycles to appreciate infinity pattern, 8+ cycles for faster crossing motion.

3. Spiral (Inward/Outward)

Description: Circular motion with time-varying radius. Sound orbits while moving closer/farther from listener. Radius modulates sinusoidally (expanding/contracting) while rotating. Adds depth dimension.

Formula: radius = 0.3 + 0.2 × sin(0.5πft), g_i(t) = 0.5 + radius × cos(4πft + φ_i)

Applications: Dramatic spatial crescendos, approach/departure effects, 3D motion simulation, vortex-like sounds.

Best speed: 4-16 cycles for spiral perception, slower = hypnotic, faster = dizzying.

4. Bounce (Wall Collision)

Description: Ricocheting motion as if sound bouncing off invisible walls. Uses modulo operations with absolute value to create sawtooth reflection. Unpredictable caroming trajectory.

Formula: x = |((4ft) mod 4) - 2| - 1, y = |((3ft) mod 6) - 3| - 1.5

Applications: Game audio (projectile sounds), percussive spatialization, chaotic motion aesthetics, soundscape animation.

Best speed: 8-32 cycles for rapid bounce sensation, 1-4 cycles for slow drift with collisions.

Organic Patterns (Natural, Complex)

5. Swarm (Collective Intelligence)

Description: Chaotic but organized movement mimicking bee swarm or flock behavior. Multiple inharmonic sine waves (7 and 3 Hz, 5 and 11 Hz) create quasi-random motion with underlying coherence. High complexity.

Formula: g(t) = 0.5 + 0.25×sin(7πft)×sin(3πft) + 0.15×sin(5πft)×sin(11πft)

Applications: Insect swarms, crowd ambiences, generative music, algorithmic composition, organic soundscapes.

Best speed: 4-16 cycles for chaotic buzz, 1-2 cycles for slow drift.

6. Tornado (Vortex Motion)

Description: 3D vortex with vertical component. Rapid rotation (6× base rate) combined with vertical oscillation. Front speakers modulated by +height, rear by -height. Creates funnel effect.

Formula: height = sin(πft), g_i(t) = 0.5 + 0.35×cos(6πft + φ_i)×(0.7 ± 0.3×height)

Applications: Storm sounds, industrial drones, sci-fi effects, immersive atmospheres, cyclonic motion.

Best speed: 4-8 cycles for dramatic vortex, 16+ cycles for violent spinning.

7. Wave (Ocean Current)

Description: Lateral wave motion traveling left-to-right or front-to-back. Sinusoidal traveling wave with phase propagation. Creates impression of passing wave crests.

Applications: Water sounds, ambient waves, phasing effects, lateral sweeps, oceanic atmospheres.

Best speed: 1-4 cycles for slow ocean waves, 8-16 cycles for choppy seas.

8. Plasma (Energy Field)

Description: High-frequency chaotic modulation simulating plasma turbulence. Multiple fast oscillations create shimmering, unstable spatial field. Electrical aesthetic.

Applications: Sci-fi energy fields, electrical disturbances, glitch aesthetics, unstable space, synthesizer sweeps.

Best speed: 16-64 cycles for plasma shimmer, 4-8 cycles for slower field fluctuations.

Conceptual Patterns (Abstract, Experimental)

9. Neural (Brain Network)

Description: Irregular firing pattern mimicking neural network activity. Sparse, stochastic-like modulation with bursts and quiet periods. Pseudo-random via complex sine combinations.

Applications: Brain-inspired generative music, cognitive soundscapes, consciousness themes, electroacoustic composition.

Best speed: 8-32 cycles for neuron-like firing, 1-4 cycles for slow network waves.

10. Quantum (Probability Cloud)

Description: Uncertain, non-deterministic-appearing motion. High-frequency jitter overlaid on base motion. Evokes quantum indeterminacy through rapid position fluctuations.

Applications: Quantum physics sonification, uncertainty themes, jittery spatial effects, philosophical audio art.

Best speed: 16-64 cycles for quantum uncertainty, 4-8 cycles for slower probability clouds.

11. DNA (Helix in 3D Space)

Description: Double helix trajectory. Two intertwined spirals with 180° phase offset. Creates twisted ladder pattern through space. Biomorphic motion.

Applications: Biological themes, genetic music, intertwined melodies, helical motion, science visualization.

Best speed: 2-8 cycles to perceive helix structure, 16+ cycles for rapid twisting.

12. Galaxy (Stellar Motion)

Description: Spiral arms with differential rotation. Inner regions faster rotation than outer. Simulates galactic disk motion. Astrophysical aesthetic.

Applications: Space themes, cosmic ambiences, astronomical music, long-duration drones, sci-fi soundscapes.

Best speed: 1-4 cycles for majestic slow rotation, 8-16 cycles for faster stellar orbits.

13. Lightning (Electrical Discharge)

Description: Sudden, unpredictable spatial jumps with long silences. Staccato bursts that "jump" between speakers. High contrast, sparse activity. Electric aesthetic.

Applications: Thunder/lightning, electrical glitches, percussive spatial accents, surprise elements, sparse textures.

Best speed: 4-16 cycles for storm-like strikes, 1-2 cycles for rare, dramatic zaps.

14. Heartbeat (Pulse Expansion)

Description: Rhythmic expansion/contraction from center. Pumping motion radiating outward then collapsing inward. Lub-dub rhythm with spatial dynamics. Biological pulsation.

Applications: Heartbeat sounds, rhythmic drones, pulse-based music, physiological themes, tension/release dynamics.

Best speed: 1-2 cycles for slow heartbeat (60 BPM equivalent), 4-8 cycles for elevated heart rate.

15. Breathing (Lung Expansion)

Description: Slow inhale/exhale spatial cycle. Gradual expansion during inhale (sound spreads to all speakers), contraction during exhale (sound focuses to center). Meditative quality.

Applications: Breath sounds, ambient meditation, yoga/wellness audio, physiological synchronization, calm atmospheres.

Best speed: 1-2 cycles for natural breathing rate (4-8 breaths/minute), 4 cycles for hyperventilation effect.

Parameters & Configuration

Script Parameters

Parameter Type Values Description
Cycles_Per_File Choice 1, 2, 4, 8, 16, 32, 64 Number of complete spatial cycles over file duration. Determines movement speed: base_rate = cycles / duration (Hz). Lower = slower, more dramatic; higher = faster, more energetic.
Spatial_Pattern Choice 15 options Algorithmic motion pattern: Circle, Figure-8, Spiral, Bounce, Swarm, Tornado, Wave, Plasma, Neural, Quantum, DNA, Galaxy, Lightning, Heartbeat, Breathing. Each uses unique mathematical formula.

Output Files

Output Object Channels Description Use Case
channel_1_FL Mono Front Left speaker channel Export for DAW 7.1 assembly
channel_2_FR Mono Front Right speaker channel Export for DAW 7.1 assembly
channel_3_C Mono Center speaker channel Export for DAW 7.1 assembly
channel_4_LFE Mono Low Frequency Effects (subwoofer) Export for DAW 7.1 assembly
channel_5_SL Mono Surround Left speaker channel Export for DAW 7.1 assembly
channel_6_SR Mono Surround Right speaker channel Export for DAW 7.1 assembly
channel_7_BL Mono Back Left speaker channel Export for DAW 7.1 assembly
channel_8_BR Mono Back Right speaker channel Export for DAW 7.1 assembly
stereo_preview Stereo FL + FR only (limited spatial impression) Quick audition in Praat (auto-plays)
binaural_headphone_mix Stereo HRTF-approximated downmix for headphones Better spatial perception on headphones

Cycle Speed Guidelines

Choosing Appropriate Speed

Speed affects spatial perception and musical character:

  • 1 cycle (very slow): Entire file = one spatial movement. Best for: Long drones (60+ seconds), cinematic sweeps, meditation music, subtle spatial animation. Perception: Glacial, almost static, requires attention to notice.
  • 2 cycles: Moderate speed for mid-length files (20-40 seconds). Best for: Ambient music, soundscapes, slow orbits, contemplative pieces. Perception: Deliberate, noticeable without being obvious.
  • 4 cycles: Default/balanced speed. Best for: General use, testing patterns, experimental music, moderate file lengths (10-30 seconds). Perception: Clear spatial movement, engaging without overwhelming.
  • 8 cycles (medium): Faster motion becomes prominent feature. Best for: Rhythmic music, energetic passages, short files (5-15 seconds). Perception: Active, animated, draws attention to spatialization.
  • 16 cycles: Rapid motion, verging on effect. Best for: Builds/transitions, high-energy sections, special effects, glitch aesthetics. Perception: Aggressive, spinning, potentially disorienting.
  • 32 cycles (fast): Very fast, almost tremolo-like spatial modulation. Best for: Sound design, synthesizer patches, micro-variations, granular effects. Perception: Blur of motion, shimmer, less discrete position changes.
  • 64 cycles (very fast): Extreme speed approaching audio-rate modulation. Best for: Textural effects, spatial phasing, AM-like sidebands, experimental extremes. Perception: Timbral coloration more than spatial movement.

Formula for tempo-sync: If matching to musical tempo (BPM), calculate: cycles = (duration × BPM) / 60 for one rotation per beat, or divide by measures for slower sync.

DAW Integration Workflow

Creating True 7.1 Surround File:
  1. Export individual channels: In Praat Objects window, select each channel (channel_1_FL through channel_8_BR), Save → Save as WAV file. Name consistently: "projectname_FL.wav", "projectname_FR.wav", etc.
  2. Import to DAW: Open project in DAW with multichannel support (Reaper, Logic Pro, Pro Tools, Nuendo). Create 8 mono tracks or 1 multichannel track (7.1 configuration).
  3. Assign channel routing: Route each imported file to correct 7.1 channel: Track 1 → FL (front left), Track 2 → FR (front right), Track 3 → C (center), Track 4 → LFE (subwoofer), Track 5 → SL (surround left), Track 6 → SR (surround right), Track 7 → BL (back left), Track 8 → BR (back right).
  4. Verify alignment: All channels should align at 0:00 (confirm no sync issues). Check waveforms for expected spatial patterns.
  5. Monitor/adjust: Use surround panner visualization to verify spatial movement. Adjust individual channel levels if needed (typically not required).
  6. Export multichannel: Render as multichannel WAV or interleaved file format (8-channel interleaved WAV). Or: Export stem files for flexibility in final mixing.

Alternative workflow: For binaural-only output, use binaural_headphone_mix directly (no DAW required). This provides stereo file with spatial impression for headphone listening.

Applications

Compositional Uses

Experimental Music

Use case: Algorithmic spatial composition where mathematical patterns drive musical structure. Spatial trajectory as compositional parameter equal to pitch/rhythm/timbre.

Techniques:

  • Sync spatial cycles to musical form (1 cycle = 1 phrase/section)
  • Use different patterns for contrasting sections (Circle for A section, Swarm for B section)
  • Layer multiple sources with different spatial patterns (heterophonic spatialization)
  • Match pattern character to musical content (Breathing for quiet passages, Tornado for climaxes)

Example workflow: Take 60-second ambient drone. Apply Spiral pattern (4 cycles) to base drone, Figure-8 (8 cycles) to high harmonics, Heartbeat (2 cycles) to low pulse. Result: multi-layered spatial counterpoint.

Sound Art Installations

Use case: Gallery/museum installations with multichannel speaker arrays. Algorithmic spatialization creates autonomous, evolving soundscapes.

Installation setup: Position 8 speakers per 7.1 layout (or adapt to available speakers). Run continuous loop of spatialized audio. Visitors experience immersive spatial movement as they enter space.

Pattern selection:

  • Slow patterns (1-2 cycles over 10+ minutes) for meditative installations
  • Organic patterns (Swarm, Breathing) for biomorphic themes
  • Geometric patterns (Circle, Spiral) for minimalist/mathematical aesthetics
  • Complex patterns (Quantum, Neural) for science/technology exhibitions

Electroacoustic Composition

Use case: Acousmatic music where spatial movement integral to compositional discourse. Praat-generated spatialization provides precise, reproducible spatial gestures.

Integration with other processing: Combine BPM Surround Panning with other Praat AudioTools scripts: (1) Apply pitch shifting or time-stretching first, (2) Add spatialization as final stage, (3) Export 8 channels for mixing with traditionally-panned elements in DAW.

Spatial dramaturgy: Use spatial pattern changes as formal articulation. Example: Static center positioning → gentle Circle → aggressive Bounce → return to center = tension arc.

Research Applications

Psychoacoustic Studies: Use algorithmic patterns for controlled spatial audio experiments. Benefits: (1) Reproducibility — identical spatial trajectories across trials/subjects, (2) Parametric control — systematically vary speed/pattern, (3) Mathematical precision — exact spatial coordinates known at every time point, (4) Baseline for comparison — geometric patterns as reference for more complex spatial behaviors.

Example experiments:

  • Spatial localization accuracy: Does speed (cycles_per_file) affect ability to track moving source?
  • Pattern complexity perception: Can listeners distinguish Circle vs Spiral vs Figure-8?
  • Aesthetic preference: Rating 15 patterns for pleasantness/engagement
  • Attention capture: Do certain patterns (Lightning, Swarm) draw more attention than others (Circle, Breathing)?

Creative Sound Design

Game Audio Prototyping

Use case: Rapidly prototype spatial behaviors for moving sound sources in games (flying enemies, orbiting projectiles, environmental effects).

Workflow: (1) Select pattern matching desired behavior (Circle for orbiting drone, Bounce for ricocheting bullet), (2) Adjust speed to match gameplay tempo, (3) Export 8 channels or binaural mix, (4) Import to game engine for testing, (5) Refine parameters based on playtest feedback.

Pattern matching: Swarm → buzzing insects; Tornado → whirlwind attack; Lightning → teleporting enemy; Galaxy → asteroid field; Breathing → ambient wind cycles.

Film/Video Post-Production

Use case: Create spatial effects for surround mixes (especially experimental/abstract films, sci-fi, horror).

Advantages over manual panning: Mathematically perfect trajectories (no human hand wobble), instant speed changes via parameter, reproducible for alternate takes, complex patterns difficult to draw by hand (Swarm, Quantum).

Practical application: UFO flyover = Circle pattern (8 cycles over 5 seconds); ghostly presence = Quantum or Neural pattern (creates uncertainty); nightmare sequence = Tornado or Plasma (disorienting); cosmic vista = Galaxy pattern (slow, majestic 1-2 cycles).

Educational Uses

Teaching Spatial Audio: Use BPM Surround Panning as pedagogical tool for demonstrating spatial audio concepts: (1) Amplitude panning basics: Circle pattern shows how speaker gains change to create perceived position. (2) Pattern complexity: Progress from simple (Circle) to complex (Swarm) illustrating algorithmic possibilities. (3) Parameter effects: Have students compare 1 cycle vs 64 cycles to understand speed perception. (4) Mathematical-audio connection: Show how formulas (trigonometric, modulo) translate to audible spatial behaviors. (5) Channel routing: Explain 7.1 speaker layout using actual spatialized audio examples.

Classroom activities: Predict spatial trajectory from formula before listening; Sketch spatial path after listening (then verify with known pattern); Compare binaural mix vs stereo preview (discuss HRTF); Match pattern to visual animations (synesthetic integration).

Technical Considerations

Praat Limitations

No Native Multichannel Support
Praat cannot create true multichannel audio files (>2 channels). Script produces 8 separate mono files requiring external combination in DAW. This is fundamental Praat limitation, not script deficiency.
Processing Time
Spatial pattern application uses Formula command on each channel (8 formula evaluations). For long files (>5 minutes), processing may take 10-30 seconds per channel. Total script runtime: typically under 5 minutes for standard audio durations.

Binaural Mix Approximation

Simplified HRTF: Binaural downmix uses basic frequency-dependent phase shifts (800 Hz left ear, 1000 Hz right ear) to approximate head-related transfer function. NOT true binaural rendering (lacks full HRTF convolution with distance/elevation cues). Provides better headphone spatial impression than simple stereo mix, but not professional binaural quality. For true binaural, use external HRTF processor on 8-channel output.

LFE Channel Behavior

Subwoofer Modulation: LFE (channel 4) typically receives constant amplitude or minimal modulation. Rationale: Subwoofer non-directional (<120 Hz frequencies lack localization cues), rapid LFE panning perceptually ineffective, serves more as foundation than spatial element. Most patterns set LFE to 0.3-0.4 constant or very slow modulation. Exception: Some patterns (Figure-8, Bounce) include LFE modulation for experimental effect.

Amplitude Floor Considerations

Why max(0.05, ...) Floor?

Prevents complete channel silence during spatial movement. Without floor, channels would reach 0 amplitude when source far from that speaker → creates "holes" in spatial image where audio disappears. With 5% floor, sound always audible from all speakers (though very quiet when source distant) → maintains continuity and spatial envelope.

Perceptual trade-off: Reduces maximum spatial contrast (90% range vs potential 100%), but significantly improves listening experience for continuous spatial trajectories. For discrete/jump patterns (Lightning), lower floor (0.01) or no floor may be appropriate.

Adjusting floor in script: Change max(0.05, ...) to max(0.0, ...) for full range with silence, or max(0.2, ...) for more conservative 20% minimum (subtler spatial effect).

Troubleshooting

Common Issues

Problem: Spatial effect not clearly audible
Possible causes: (1) Using stereo_preview which only plays FL + FR (limited spatial impression), (2) Speed too slow (1 cycle over long file = subtle), (3) Monitoring in stereo instead of surround
Solutions: Switch to binaural_headphone_mix for headphone listening; Increase cycles (try 8-16 for more obvious motion); Export 8 channels to DAW and monitor in actual surround; Try more dramatic pattern (Bounce, Swarm vs subtle Circle)
Problem: Channels out of sync
Cause: Should not occur — all channels derived from same source with simultaneous formula application
Solution: If detected in DAW, verify you exported all channels from same script run (don't mix channels from different runs); Check DAW import settings (sample rate matching); Re-run script and re-export all channels
Problem: Clipping/distortion in output
Cause: Source audio already near 0dB, spatial modulation amplitudes (up to 0.95) may push over threshold
Solution: Normalize source audio to -6dB or -3dB before running script; Reduce amplitude in formula (change 0.45 depth to 0.35); Apply gain reduction in DAW post-spatialize
Problem: LFE channel too loud/quiet
Cause: LFE constant amplitude (typically 0.3-0.4) may not match source content
Solution: Adjust LFE gain in DAW after export; Modify LFE formula in script (line ~128, 150, 172, etc.) — change 0.3 to 0.1 (quieter) or 0.5 (louder); Low-pass filter LFE in DAW to <120 Hz for proper subwoofer content
Problem: Stereo source collapsed to mono
Cause: Script automatically converts stereo to mono (line 61-64) for spatialization
Solution: This is intended behavior — spatialization treats source as point source. If you want stereo preserved: (1) Separate L/R channels manually, (2) Run script on each channel separately, (3) Combine results creating 16-channel output (2 independent 7.1 streams), OR use external stereo-to-surround upmixer before spatialization