Physics-Based Stereo Dynamics — User Guide
Spatial physical modeling: combines kinematic physics simulation with stereo panning and distance-based loudness to create immersive 3D audio effects that follow real-world physical laws.
What this does
This script implements physics-based stereo dynamics — an advanced audio processing system that simulates objects moving through physical space with realistic stereo positioning and distance-based loudness. Building on the kinematic physics foundation, this stereo edition adds three-dimensional spatialization: objects move left-to-right (panning), approach and recede (distance attenuation), while following realistic bounce physics. The result is immersive audio that creates the illusion of physical objects moving through the listener's environment, with amplitude, panning, and distance all governed by unified physical laws.
Key Features:
- 15 Spatial Presets — Carefully tuned stereo motion scenarios
- 3D Physics Simulation — Combined vertical and lateral motion
- Distance-Based Loudness — Realistic volume attenuation with distance
- Square-Root Pan Law — Psychoacoustically correct stereo balancing
- Comprehensive Visualization — Top-down trajectory plotting with bounce markers
- Stereo Preservation — Maintains original stereo image while adding motion
Technical Implementation: (1) Dual physics simulation: Solve vertical bounce physics while computing lateral panning motion. (2) Energy mapping: Convert height and velocity to amplitude using three strategies. (3) Distance attenuation: Apply inverse-distance loudness scaling based on lateral position. (4) Stereo panning: Use square-root pan law for natural channel balancing. (5) Independent channel processing: Create separate left/right envelopes for precise stereo control. (6) Visual feedback: Plot top-down trajectories with bounce markers showing height. The system handles mono-to-stereo conversion automatically and includes robust error checking for numerical stability.
Quick start
- In Praat, select exactly one Sound object (mono or stereo).
- Run script… →
Physics_Based_Stereo_Dynamics.praat. - Choose from 15 spatial presets in the unified dialog.
- For custom physics, select "Custom" and adjust parameters in the same dialog.
- Click Apply — physics simulation runs with progress display.
- View the three-panel visualization showing audio and spatial trajectory.
- Output named "originalname_PresetName" appears with physics-based stereo motion.
Stereo Physics Theory
Combined Kinematic Systems
Dimensional Motion Integration
Vertical and lateral physics unification:
Why Combined Physics?
Spatial realism benefits:
- Unified behavior: All motion follows same physical laws
- Natural correlation: Height, timing, and position work together
- Predictable results: Intuitive parameter relationships
- Creative consistency: Physical scenarios make spatial sense
Distance-Based Loudness System
Inverse Distance Principles
Realistic volume attenuation:
Why Distance Attenuation?
Psychoacoustic realism:
- Spatial depth: Creates front-back dimension illusion
- Natural perspective: Distant sounds are quieter
- Immersive quality: Enhances 3D audio illusion
- Musical expression: Adds emotional distance cues
🎧 Stereo Panning Intuition
Square-root pan law:
Left channel: amplitude × √(1 - pan_position)
Right channel: amplitude × √(pan_position)
Where pan_position ranges 0 (left) to 1 (right)
Why square root?
Makes center sounds seem equally loud in both speakers
Prevents amplitude buildup in the center
Psychoacoustically correct for stereo imaging
Stereo Panning Mathematics
Square-Root Pan Law
Channel amplitude calculation:
Why Separate Channel Processing?
Technical advantages:
- Precision control: Exact amplitude for each channel
- Flexibility: Can create asymmetric effects if desired
- Quality: Avoids interpolation artifacts
- Compatibility: Works with any stereo content
Motion Trajectory Design
Preset-Specific Motion Patterns
Specialized lateral movement:
Why Varied Motion Patterns?
Creative diversity:
- Scenario matching: Motion fits physical metaphor
- Musical variety: Different rhythmic spatial effects
- Realism enhancement: Believable object behavior
- Artistic expression: Wide range of spatial feelings
Spatial Presets
🎯 Fifteen Spatial Scenarios
Carefully tuned presets combining physics with stereo motion:
Dynamic Motion Presets
| Preset | Spatial Character | Motion Pattern | Best For |
|---|---|---|---|
| Bouncy Rubber Ball | Natural left-to-right bounce | Linear L→R with good bounces | General purpose, natural effects |
| Ping Pong Frenzy | Extreme left-right bouncing | Full stereo width, rapid motion | Energetic, attention-grabbing |
| Super Ball Chaos | Unpredictable spatial movement | Asymmetric L→R with many bounces | Experimental, glitch effects |
| Tennis Ball | Court-like cross motion | Full stereo sweep with realistic bounces | Sports sounds, rhythmic material |
| Water Skipping Stone | Receding into distance | Center→Far right with fading | Transition effects, endings |
Oscillatory & Specialized Motion
| Preset | Spatial Character | Motion Pattern | Best For |
|---|---|---|---|
| Spring Oscillation | Regular left-right sweeping | Sinusoidal panning (2 cycles) | Metallic, resonant sounds |
| Pendulum Swing | Wide, smooth arcs | Sinusoidal with strong distance effect | Atmospheric, dramatic sweeps |
| Earthquake Tremor | Subtle stereo shaking | Small center oscillations | Rumble, low-frequency effects |
| Rolling Downhill | Accelerating left-right motion | Linear L→R with building energy | Tension, build-up sections |
Position-Focused Presets
| Preset | Spatial Character | Motion Pattern | Best For |
|---|---|---|---|
| Steel Ball Drop | Centered with subtle motion | Minimal panning, focus on bounces | Percussion, impact sounds |
| Basketball Dribble | Right-side focused | Small R-side range | Side-panned rhythms |
| Dropping Stone | Pure center impact | No lateral motion | Dramatic center impacts |
| Feather Falling | Gentle center→side float | Subtle L→R with light bounces | Delicate, atmospheric |
| Moon Gravity | Slow, floaty spatial motion | Gentle L→R with low gravity | Space, dreamlike effects |
| Heartbeat Pulse | Centered biological rhythm | No panning, focus on pulse pattern | Organic, living sounds |
Preset Spatial Parameters
- Realistic scenarios: Panning matches physical metaphor
- Musical usefulness: Creates useful stereo effects
- Listener comfort: Avoids extreme or disorienting motion
- Creative range: Covers wide spectrum of spatial feelings
Each preset creates a distinct spatial character suitable for different audio contexts
Creative Spatial Combinations
🎵 Surround Simulation
Presets: Ping Pong Frenzy + Distance Attenuation
Application: Create pseudo-surround effects in stereo
Result: Sounds appear to move around the listener
🌊 Environmental Immersion
Presets: Water Skipping Stone + Feather Falling
Application: Process environmental and ambient sounds
Result: Natural-sounding spatial movement
⚡ Rhythmic Spatialization
Presets: Basketball Dribble + Spring Oscillation
Application: Add spatial interest to rhythmic elements
Result: Groove-enhanced stereo rhythms
Parameters Guide
⚙️ Complete Parameter Reference
Detailed explanation of all physics and spatial parameters:
Vertical Physics Parameters
| Parameter | Range | Default | Physical Meaning |
|---|---|---|---|
| Initial height | 0.1-10.0 | 1.2 | Starting height above ground (meters) |
| Initial velocity | -20.0 to 20.0 | 6.0 | Starting vertical velocity (m/s) |
| Gravity | 0.1-50.0 | 9.8 | Vertical acceleration (m/s²) |
| Bounce coefficient | 0.0-1.0 | 0.75 | Energy retention per bounce |
| Number of bounces | 0-50 | 8 | Maximum bounce count |
Lateral Spatial Parameters
| Parameter | Range | Default | Spatial Meaning |
|---|---|---|---|
| Pan Start | -1.0 to 1.0 | -0.9 | Starting stereo position (-1=left, +1=right) |
| Pan End | -1.0 to 1.0 | 0.9 | Ending stereo position |
| Distance attenuation | 0.0-1.0 | 0.3 | Loudness reduction with distance |
Envelope Mapping Parameters
| Parameter | Options | Default | Description |
|---|---|---|---|
| Mapping | Height, Velocity, Combined | Combined | Physics-to-amplitude conversion |
| Amplitude scale | 0.1-3.0 | 1.0 | Overall amplitude multiplier |
Parameter Interactions
- Pan range vs motion: Wider range = more dramatic movement
- Distance attenuation vs width: Higher = stronger center focus
- Vertical vs lateral timing: Bounces sync with position changes
- Gravity vs spatial rhythm: Higher gravity = faster spatial events
Parameters interact to create the overall spatial physics behavior
Recommended Custom Settings
🎸 Guitar Amp Simulation
Goal: Natural amp-in-room spatial effect
Settings:
- Pan Start: -0.3, Pan End: 0.3
- Distance attenuation: 0.2
- Initial height: 0.5, Bounces: 3
- Gravity: 8.0, Mapping: Combined
🥁 Drum Kit Panning
Goal: Realistic drum kit spatialization
Settings:
- Pan Start: -0.8, Pan End: 0.6
- Distance attenuation: 0.4
- Initial height: 1.0, Bounces: 6
- Gravity: 15.0, Mapping: Velocity
🎹 Synth Arp Movement
Goal: Smooth synthesizer arpeggio motion
Settings:
- Pan Start: -1.0, Pan End: 1.0
- Distance attenuation: 0.1
- Initial height: 0.8, Bounces: 12
- Gravity: 6.0, Mapping: Height
Applications
Music Production
Use case: Create dynamic stereo interest in mixes
Technique: Apply spatial presets to individual tracks
Example: Make synth pads move through the stereo field naturally
Sound Design
Use case: Generate immersive 3D sound effects
Technique: Use distance attenuation for depth illusion
Example: Create sounds that appear to approach and recede
Game Audio
Use case: Simulate object motion in virtual environments
Technique: Match physics parameters to game object properties
Example: Realistic ball bounce sounds with spatial tracking
Audio Post-Production
Use case: Add spatial movement to film and video sound
Technique: Use presets that match on-screen action
Example: Objects falling or moving across the screen
💡 Creative Techniques
Advanced spatial applications:
- Layered spatialization: Different presets on different frequency bands
- Automated motion: Change panning parameters over time
- Hybrid approaches: Combine with reverb for room simulation
- Rhythmic spatialization: Sync bounce timing to musical tempo
Troubleshooting Common Issues
Cause: Strong distance attenuation or extreme panning
Solution: Reduce distance attenuation or increase amplitude scale
Cause: Extreme pan values or rapid motion
Solution: Use more moderate panning ranges and motion
Cause: Identical start/end pan or zero distance effect
Solution: Increase panning range or distance attenuation
Cause: Extreme physics values causing numerical issues
Solution: Use more moderate physics parameters