Kinematic Physics Envelope — User Guide

Physical modeling dynamics: simulates real-world physics behaviors like bouncing balls, pendulums, and springs to create natural, physically-inspired amplitude envelopes for audio processing.

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 implements a kinematic physics envelope generator — a sophisticated audio processing tool that simulates real-world physical behaviors and maps them to amplitude envelopes. The system models objects under various physical conditions (gravity, elasticity, initial conditions) and converts their motion trajectories into dynamic amplitude curves. With 15 carefully crafted presets ranging from realistic ball bounces to abstract physical metaphors, this approach creates natural, musically interesting dynamics that follow the laws of physics rather than arbitrary mathematical functions.

Key Features:

Why physics-based envelopes? Traditional envelope design uses mathematical functions (ADSR, polynomials, etc.) that often sound artificial or predictable. Physics-based envelopes leverage our intuitive understanding of how objects move in the real world: (1) Natural decay: Objects slow down due to gravity and friction. (2) Realistic bounces: Elastic collisions with energy loss. (3) Physical intuition: We instinctively understand how balls bounce or pendulums swing. (4) Musical variation: Different physical scenarios create different rhythmic and dynamic patterns. Advantages: (1) Organic feel: Sounds more natural and less synthetic. (2) Creative inspiration: Physical metaphors suggest musical applications. (3) Consistent behavior: Follows established physical laws. (4) Educational value: Demonstrates physics through audio.

Technical Implementation: (1) Physics simulation: Solve kinematic equations for position and velocity over time using numerical integration. (2) Collision detection: Handle bounces with energy loss through coefficient of restitution. (3) Energy mapping: Convert physical quantities (height, velocity) to amplitude values using three different strategies. (4) Envelope generation: Create IntensityTier control points from simulation data. (5) Audio processing: Apply physics-based envelope to original sound. (6) Visualization: Plot trajectories and compare original vs. processed audio. The system uses 500 simulation points for smooth envelope generation and includes comprehensive preset configurations for immediate creative use.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…Kinematic_Physics_Envelope.praat.
  3. Choose from 15 physics presets in the first dialog.
  4. For custom physics, select "Custom" and set parameters in second dialog.
  5. Click Next/Apply — physics simulation runs with progress display.
  6. View the three-panel visualization showing physics trajectory and audio.
  7. Output named "originalname_PresetName" appears with physics-based envelope applied.
Quick tip: Start with Bouncy Rubber Ball for classic amplitude decay or Ping Pong Frenzy for rapid rhythmic patterns. Use Dropping Stone for simple fade-outs or Earthquake Tremor for complex, irregular modulation. Heartbeat Pulse creates biological rhythm patterns, while Moon Gravity produces slow, floaty envelopes. The visualization shows exactly how the physics simulation maps to your audio. For musical material, try Pendulum Swing for smooth oscillations or Spring Oscillation for resonant patterns. Each preset has been tuned to create musically useful envelope shapes.
Important: DURATION MATTERS — physics simulation scales to your audio length. Short sounds may only show initial drop, long sounds may show many bounces. Custom parameters require understanding of physics — unrealistic values may cause numerical issues. Bounce coefficient = 1.0 creates perfect bounces (no energy loss), 0.0 creates no bounces. High gravity values create rapid changes, low gravity creates gradual evolution. Visualization helps understand the mapping between physics and audio. Output is normalized to prevent clipping but preserves the physical envelope shape. Experiment with different audio material to hear how physics envelopes affect various sounds.

Physics Simulation Theory

Kinematic Equations Fundamentals

Newtonian Motion Physics

Basic kinematic equations:

Position update under constant acceleration: v(t) = v₀ + a × t s(t) = s₀ + v₀ × t + ½ × a × t² Where: s(t) = position at time t (height above ground) v(t) = velocity at time t s₀ = initial position (initial_height) v₀ = initial velocity a = acceleration (gravity, negative for downward) Numerical integration (Euler method): FOR each time step Δt: v_new = v_old + gravity × Δt s_new = s_old + v_old × Δt Bounce physics (coefficient of restitution): IF s_new ≤ ground_level: v_new = -v_old × bounce_coefficient s_new = ground_level Energy loss: bounce_coefficient = 1.0 → perfect elastic (no energy loss) bounce_coefficient = 0.0 → completely inelastic (no bounce) Typical values: 0.6-0.9 for realistic bounces

Why Numerical Simulation?

Advantages over analytical solutions:

Energy Mapping Strategies

Three Physical-to-Audio Mappings

Converting physics to amplitude:

1. HEIGHT MAPPING (Potential Energy): amplitude = current_height / initial_height Physical interpretation: Potential energy PE = m × g × h As height decreases, potential energy decreases Creates envelope that follows position curve 2. VELOCITY MAPPING (Kinetic Energy): amplitude = current_velocity / max_velocity Physical interpretation: Kinetic energy KE = ½ × m × v² As velocity changes, kinetic energy changes Creates envelope that emphasizes motion changes 3. COMBINED MAPPING (Total Energy): amplitude = (height_ratio + velocity_ratio) / 2 Physical interpretation: Total energy = PE + KE Captures both position and motion information Balanced approach for musical results Normalization: Each mapping normalized to [0,1] range Then scaled by amplitude_scale parameter Converted to dB for IntensityTier

Why Different Mapping Strategies?

Musical characteristics:

🎯 Physics Intuition

Bouncy Ball example:

Drop from height: high potential energy → loud

Impact: high kinetic energy → loud burst

Bounce upward: decreasing energy → fading

Top of bounce: potential energy peak → volume peak


Musical result: Natural decay with rhythmic emphasis on bounces

Physical Parameter Effects

How Parameters Change the Envelope

Parameter impact analysis:

INITIAL HEIGHT: Higher = longer initial decay before first bounce Affects overall envelope scale in height mapping INITIAL VELOCITY: Higher = more energetic motion, faster changes Particularly affects velocity mapping results GRAVITY: Higher = faster acceleration, quicker bounces Lower = slower, more floaty motion Dramatically changes timing and rhythm BOUNCE COEFFICIENT: Higher = more bounces, less energy loss Lower = fewer bounces, rapid energy dissipation Controls the "liveliness" of the envelope NUMBER OF BOUNCES: Maximum allowed bounces before simulation stops Prevents infinite bouncing in high-coefficient scenarios

Why Physical Parameters?

Creative advantages:

Numerical Implementation

Simulation Details

Computational approach:

Time discretization: numPoints = 500 (fixed for smooth envelopes) timeStep = duration / (numPoints - 1) Array storage (using dynamic variable names): FOR i from 1 to numPoints: time_'i' = current simulation time height_'i' = current height position velocity_'i' = current velocity magnitude Simulation loop: current_height = initial_height current_velocity = initial_velocity current_time = 0 bounces_done = 0 FOR i from 1 to numPoints: # Store current state time_'i' = current_time height_'i' = current_height velocity_'i' = abs(current_velocity) # Update physics current_velocity = current_velocity - gravity × timeStep current_height = current_height + current_velocity × timeStep # Handle bounce IF current_height ≤ 0 AND bounces_done < number_of_bounces: current_height = 0 current_velocity = -current_velocity × bounce_coefficient bounces_done = bounces_done + 1 # Clamp to ground IF current_height < 0: current_height = 0 current_time = current_time + timeStep

Why This Implementation?

Design considerations:

Physics Presets

🎯 Fifteen Physical Scenarios

Carefully tuned presets for immediate creative use:

Realistic Object Simulations

PresetPhysics CharacterMusical EffectBest For
Bouncy Rubber BallMedium bounces, good energy retentionClassic amplitude decay with rhythmic emphasisGeneral purpose, drums
Steel Ball DropMany small bounces, high elasticityRapid, subtle amplitude modulationPercussion, metallic sounds
Ping Pong FrenzyFast, lively bouncesEnergetic rhythmic patternsStaccato, plucked sounds
Basketball DribbleStrong, spaced bouncesBold, rhythmic amplitude punchesBeats, bass sounds
Super Ball ChaosExtreme bounces, minimal energy lossComplex, evolving rhythmic patternsExperimental, glitch
Tennis BallBalanced bounce characteristicsNatural, musical decay patternsMelodic content

Environmental & Abstract Simulations

PresetPhysics CharacterMusical EffectBest For
Dropping StoneNo bounce, direct impactSimple, dramatic amplitude dropImpacts, endings
Feather FallingSlow descent, minimal bouncesGentle, floating amplitude decayPads, ambient
Moon GravityLow gravity, floaty motionSlow, evolving amplitude changesAtmospheric textures
Water Skipping StoneMultiple low bounces with dragRapid, damped amplitude burstsRhythmic effects
Earthquake TremorMany small, irregular bouncesComplex, unpredictable modulationExperimental, noise

Metaphorical & Musical Simulations

PresetPhysics CharacterMusical EffectBest For
Heartbeat PulseDouble-bounce patternBiological rhythm simulationOrganic, living sounds
Spring OscillationRegular, damped oscillationResonant amplitude modulationMetallic, resonant sounds
Pendulum SwingSmooth, periodic motionRegular amplitude oscillationSwelling, lyrical content
Rolling DownhillAccelerating motionBuilding, crescendo effectTension, build-ups

Preset Physics Parameters

Preset design philosophy:
  • Realistic objects: Parameters based on real physical properties
  • Musical usefulness: Tuned for audio applications, not pure physics
  • Variety: Cover wide range of rhythmic and dynamic behaviors
  • Intuitive naming: Names suggest musical applications

Each preset creates a distinct envelope character suitable for different musical contexts

Creative Preset Combinations

🎵 Rhythmic Animation

Presets: Ping Pong Frenzy + Basketball Dribble

Application: Process different audio layers with different physics

Result: Complex polyrhythmic amplitude patterns

🌊 Atmospheric Evolution

Presets: Feather Falling + Moon Gravity

Application: Process pads and ambient textures

Result: Slow, organic amplitude breathing

⚡ Dynamic Impact

Presets: Dropping Stone + Earthquake Tremor

Application: Process impacts and percussive elements

Result: Dramatic attacks with complex decays

Parameters Guide

⚙️ Complete Parameter Reference

Detailed explanation of all physics and mapping parameters:

Physics Simulation Parameters

ParameterRangeDefaultPhysical Meaning
Initial height0.1-10.01.0Starting height above ground (meters)
Initial velocity-20.0 to 20.05.0Starting velocity (m/s, positive=up)
Gravity0.1-50.09.8Acceleration due to gravity (m/s²)
Bounce coefficient0.0-1.00.7Energy retention per bounce (0-1)
Number of bounces0-505Maximum bounce count before stopping

Envelope Mapping Parameters

ParameterOptionsDefaultDescription
MappingHeight, Velocity, CombinedCombinedPhysics-to-amplitude conversion method
Amplitude scale0.1-3.01.0Overall envelope amplitude multiplier

Parameter Interactions

Key physical relationships:
  • Gravity vs timing: Higher gravity = faster bounces
  • Bounce coefficient vs duration: Higher coefficient = more bounces
  • Initial height vs initial decay: Higher start = longer first fall
  • Initial velocity vs energy: Higher velocity = more energetic motion
  • Mapping vs character: Height=smooth, Velocity=dynamic, Combined=balanced

Parameters interact to create the overall physical behavior

Recommended Custom Settings

🎸 Guitar Note Decay

Goal: Natural string vibration decay

Settings:

  • Initial height: 0.8
  • Initial velocity: 3.0
  • Gravity: 12.0
  • Bounce coefficient: 0.6
  • Bounces: 8
  • Mapping: Combined

🥁 Drum Machine

Goal: Punchy, rhythmic amplitude

Settings:

  • Initial height: 1.2
  • Initial velocity: 8.0
  • Gravity: 25.0
  • Bounce coefficient: 0.4
  • Bounces: 3
  • Mapping: Velocity

🎹 Evolving Pad

Goal: Slow, evolving amplitude changes

Settings:

  • Initial height: 2.0
  • Initial velocity: 1.0
  • Gravity: 3.0
  • Bounce coefficient: 0.8
  • Bounces: 12
  • Mapping: Height

Applications

Music Production

Use case: Create natural-sounding amplitude envelopes

Technique: Apply physics presets to synthetic sounds

Example: Make electronic drums sound more organic and physical

Sound Design

Use case: Generate complex rhythmic patterns

Technique: Use bounce-based presets on sustained sounds

Example: Create gated pad effects with physical rhythm

Audio Restoration

Use case: Add natural dynamics to flat recordings

Technique: Apply subtle physics envelopes

Example: Breathe life into over-compressed audio

Educational Use

Use case: Demonstrate physics principles through audio

Technique: Compare different physical scenarios

Example: Hear the difference between moon and earth gravity

💡 Creative Techniques

Advanced applications:

  • Layered physics: Apply different presets to frequency bands
  • Time-stretching: Adjust audio duration to match physics timing
  • Parameter automation: Change physics parameters over time
  • Hybrid approaches: Combine with other envelope methods

Troubleshooting Common Issues

Problem: No bounces occur
Cause: Bounce coefficient = 0 or insufficient initial energy
Solution: Increase bounce coefficient or initial height/velocity
Problem: Too many rapid bounces
Cause: High bounce coefficient with high energy
Solution: Reduce bounce coefficient or number of bounces
Problem: Envelope too subtle
Cause: Low amplitude scale or inappropriate mapping
Solution: Increase amplitude scale or try different mapping
Problem: Numerical instability
Cause: Extreme parameter values
Solution: Use more moderate physics parameters