Gravitational Lens Reverb — User Guide

Astrophysical audio processing: simulates gravitational lensing effects to create complex, curved delay patterns and relativistic time dilation in reverberation.

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 gravitational lens reverb — an advanced audio processing technique that simulates the effects of gravitational physics on sound propagation. Creates complex, curved delay patterns inspired by gravitational lensing, where massive objects bend the path of sound waves, combined with relativistic time dilation effects. Process models multiple gravitational masses that bend audio "rays" through curved spacetime.

Key Features:

What is gravitational lens reverb? Traditional reverb: linear delay lines, uniform decay. Gravitational reverb: simulates how sound would behave in curved spacetime, with delays that bend around simulated masses and time that stretches near gravitational sources. Advantages: (1) Complex curvature: Non-linear delay patterns create unique spatial effects. (2) Physical simulation: Based on actual gravitational mathematics. (3) Rich textures: Multiple mass interactions create complexity. (4) Stereo immersion: Independent gravitational fields per channel. (5) Scientific inspiration: Real astrophysical phenomena translated to audio. Use cases: Cosmic sound design, experimental music, film scoring, scientific visualization, immersive audio.

Quick start

  1. Select Sound object in Praat
  2. Run gravitational_lens_reverb.praat
  3. Choose preset for pre-configured gravitational environments
  4. Or adjust mass_points and rays_per_mass for complexity
  5. Set space_curvature for bending intensity
  6. Configure time_dilation_factor for relativistic effects
  7. Click OK — gravitational reverb applied
Quick tip: Start with Medium Lensing for balanced cosmic effects. Use Subtle Lensing for gentle spatial curvature or Extreme Lensing for dramatic spacetime distortion. Each processing creates unique gravitational environments.
Processing Intensity: High mass point counts with many rays can require significant processing time. The script automatically handles stereo/mono conversion and creates appropriate cosmic tails.

Gravitational Theory

Gravitational Lensing Algorithm

🌌 Mass-Ray Interaction System

Core gravitational simulation:

For each mass point (1 to mass_points): mass_position = randomUniform(0.03, 0.9) ; Position in time mass_strength = randomGauss(mass_strength_mean, mass_strength_stddev) For each ray (1 to rays_per_mass): straight_delay = ray_delay_start + ray × ray_delay_increment # Gravitational bending calculation distance_to_mass = abs(straight_delay - mass_position) bending = mass_strength / (distance_to_mass + 0.005) curved_delay = straight_delay + bending × space_curvature # Relativistic effects time_dilation = sqrt(1 - mass_strength × time_dilation_factor) lensing_amp = lensing_amplitude / (1 + bending) # Apply delayed signal Formula: "self + lensing_amp × self(x - curved_delay × time_dilation)" Physical interpretation: Each mass creates a gravitational well Audio rays bend toward masses (longer paths) Time slows near massive objects (time dilation) Amplitude decreases with bending (energy conservation)

Relativistic Time Dilation

⏰ Einstein's Time Stretching

Time dilation mathematics:

Time dilation formula (simplified): time_dilation = √(1 - mass_strength × time_dilation_factor) Where: mass_strength = gravitational influence of mass point time_dilation_factor = controls relativistic intensity Effects: Near strong masses: time_dilation → 0 (extreme slowing) Far from masses: time_dilation → 1 (normal time) Creates: stretched delays, pitch shifts, temporal smearing Audio implementation: delayed_signal = self(x - curved_delay × time_dilation) Stronger masses create more time stretching Multiple masses create complex temporal patterns Physical basis: Inspired by general relativity Gravitational time dilation near massive objects Translated to audio delay manipulation

Parameter Interactions

ParameterPhysical AnalogAudio Effect
mass_pointsNumber of stars/black holesMore masses = more complex reverb patterns
rays_per_massLight paths around each massMore rays = denser, richer reverberation
space_curvatureStrength of spacetime curvatureHigher = more dramatic delay bending
mass_strength_meanAverage mass of objectsHigher = stronger gravitational effects
time_dilation_factorRelativistic intensityHigher = more time stretching effects
lensing_amplitudeSignal intensityControls reverb loudness and presence

Stereo Gravitational Fields

Independent channel processing: Left channel: Uses main parameter settings Creates primary gravitational field Standard mass distribution and strength Right channel: Slightly different parameters: mass_strength_mean = 1.1 (slightly weaker) space_curvature = 0.75 (less curvature) ray_delay_start = 0.06 (later start) ray_delay_increment = 0.055 (different spacing) time_dilation_factor = 0.18 (slightly more dilation) Benefits: Natural stereo imaging Different gravitational environments per ear Creates immersive cosmic space Avoids artificial symmetry For mono sounds: Process with left channel parameters, then convert to stereo

Lensing Presets

PresetMass PointsRays/MassCurvatureTime DilationCosmic Character
Subtle Lensing650.50.10Gentle spatial curvature, minimal distortion
Medium Lensing1280.80.15Balanced cosmic environment
Heavy Lensing18121.10.20Strong gravitational fields, noticeable time effects
Extreme Lensing25161.50.25Intense spacetime distortion, relativistic effects

🌠 Cosmic Environment Applications

Subtle Lensing: Create gentle cosmic spaces for ambient music and subtle spatial enhancement. Minimal time dilation preserves original timing.

Medium Lensing: Generate balanced cosmic reverberation for most musical applications. Noticeable curvature without overwhelming distortion.

Heavy Lensing: Produce strong gravitational environments for sound design and experimental music. Clear time dilation and spatial bending effects.

Extreme Lensing: Create intense spacetime distortion for cinematic scoring and cosmic sound design. Maximum relativistic effects and complex curvature.

Cosmological Fadeout System

Natural decay simulation: fadeout_duration (0.8-1.8 seconds): Controls reverb tail length Simulates cosmological horizon Creates natural, non-abrupt endings Fadeout formula: fade_start = total_duration - fadeout_duration if x > fade_start: amplitude = 0.5 + 0.5 × cos(π × (x - fade_start) / fadeout_duration) output = input × amplitude Physical inspiration: Cosmic microwave background redshift Signal attenuation over cosmic distances Horizon effects in expanding universe Benefits: Natural-sounding decay Prevents abrupt endings Creates sense of infinite space Matches cosmic theme of effect

Applications

Cosmic Sound Design

Space and Sci-Fi Effects: Use Heavy or Extreme Lensing to create authentic cosmic environments for science fiction media. The gravitational simulation creates believable space acoustics.
Astrophysical Visualization: Process audio to demonstrate gravitational concepts. The time dilation and lensing effects provide audible analogs to relativistic phenomena.

Experimental Music

Cosmic Composition: Use gravitational reverb as a compositional tool to create spatial narratives that evolve through different cosmic environments.
Temporal Exploration: Study how time dilation affects musical perception. The relativistic effects create unique rhythmic and harmonic transformations.

Cinematic Scoring

Epic Space Scenes: Apply Extreme Lensing to create massive, cosmic spaces for film scores and game soundtracks involving space travel or cosmic events.
Alien Environments: Use the unique curvature patterns to create unfamiliar acoustic spaces that suggest alien worlds or alternate physics.

Technical Considerations

Processing Time: High mass point counts (18+) with many rays can require significant processing time, especially for long audio files. The gravitational calculations are computationally intensive.
Extreme Parameters: Very high space_curvature combined with strong time_dilation can create extreme effects that may overwhelm the original signal. Start with moderate settings.
Scientific Basis: While simplified for audio processing, the gravitational lensing and time dilation mathematics are inspired by real physics. The effect provides an intuitive understanding of these complex concepts through audio.