Quantum Uncertainty Reverb — User Guide
Quantum-inspired reverb algorithm: simulates quantum state superposition and collapse in delay networks using Gaussian probability distributions for time and amplitude uncertainty, creating organic, non-deterministic reverb textures.
What this does
This script implements quantum uncertainty reverb — an algorithmic reverb inspired by quantum mechanics principles of superposition and wave function collapse. Core concept: Each reverb "reflection" represents a quantum state with inherent time-amplitude uncertainty (Heisenberg-inspired). States exist in superposition (multiple delay paths) or collapse to single reflections based on probability thresholds. Algorithm generates N quantum states (default 35), each with: (1) Time uncertainty: Delay time drawn from Gaussian distribution (μ = time_mean, σ = uncertainty_stddev). (2) Amplitude precision: Inversely proportional to time uncertainty (greater time uncertainty = more precise amplitude, mimicking uncertainty principle). (3) Collapse probability: Random value determines if state exists as single reflection (collapsed) or superposition (multiple substates). Result: Organic, non-repeating reverb texture with statistical density control rather than fixed delay taps. Stereo processing uses independent random parameters per channel for spatial width. Optional silent tail extends processing beyond original duration.
Key Features:
- Quantum State System — N states with probabilistic collapse vs superposition
- 5 Built-in Presets — Subtle through Extreme quantum density
- Uncertainty Principle — Time-amplitude coupling via Gaussian distributions
- Superposition States — Multiple substates per quantum state when not collapsed
- Stereo Independence — Different random parameters per channel for width
- Adaptive Decay — State-dependent amplitude decay (early states louder)
What is quantum-inspired reverb? Traditional reverb: Fixed delay taps (algorithmic), impulse responses (convolution), feedback networks (Schroeder), spring/plate emulation. Quantum reverb: Probabilistic delay generation inspired by quantum mechanics — specifically Heisenberg uncertainty principle (ΔE·Δt ≥ ℏ/2) translated to audio domain as time-amplitude coupling. Key differences: (1) Non-deterministic: Each processing run generates different reflection patterns (randomGauss calls). (2) Statistical density: Control via probability distributions rather than fixed taps. (3) Superposition: States can exist as multiple simultaneous reflections. (4) Collapse threshold: Probability determines single vs multi-path states. (5) Coupled parameters: Greater time uncertainty enforces greater amplitude precision. Use cases: Experimental sound design (non-repeating textures), generative music (algorithmic variation), teaching quantum concepts through audio, creating "living" reverbs that evolve probabilistically. Not physically accurate quantum simulation — conceptual metaphor applied to delay networks.
Technical Implementation: (1) Tail extension: Concatenate silent duration to allow reverb decay beyond original length. (2) Quantum state loop: For each of N states (e.g., 35): (a) Generate time_uncertainty from Gaussian(μ=time_mean, σ=uncertainty_stddev). (b) Calculate amplitude_precision = 1/(1 + |time_uncertainty|) — inversely coupled. (c) Compute state_decay = linear ramp (early states louder, later states quieter). (d) Generate probability from Uniform(0,1). (e) If probability > collapse_threshold: Apply single delay reflection (collapsed state): delay = |time_uncertainty| + min_delay_offset, amplitude = base_amplitude × amplitude_precision × state_decay × 0.8, Formula: sample(t) += amp × sample(t - delay). (f) Else: Apply substates (superposition): For each of substates (e.g., 4): sub_delay = |time_uncertainty| + Gaussian(0, substate_jitter) + min_delay_offset, sub_amp = base_amplitude × amplitude_precision × state_decay × 0.5 / sub, Formula: sample(t) += sub_amp × sample(t - sub_delay). (3) Stereo processing: Left/right channels use independent random seeds (different time_uncertainty draws per state). (4) Fadeout: Cosine fade applied to tail duration to prevent abrupt cutoff. Key insight: Reverb density controlled by quantum_states count, character by uncertainty_stddev, collapse behavior by collapse_threshold. Each state contributes 1 or substates reflections depending on collapse.
Quick start
- In Praat, select exactly one Sound object (mono or stereo).
- Run script… →
quantum_uncertainty_reverb.praat.
- Choose Preset: Subtle Quantum, Medium Quantum, Heavy Quantum, Extreme Quantum, or Custom.
- For Custom: Adjust quantum_states (number of reflections, default 35).
- Set uncertainty_stddev (time spread, 0.25-0.5, default 0.35).
- Set collapse_threshold (0-1, higher = more single reflections vs superposition).
- Adjust tail_duration_seconds (reverb decay time, default 1.0s).
- Click OK — reverb applied, result named "originalname_quantum_uncertainty".
Quick tip: Start with Medium Quantum preset (balanced reverb texture). Increase quantum_states (35→60) for denser reverb. Increase uncertainty_stddev (0.35→0.5) for wider time spread (longer decay). Lower collapse_threshold (0.65→0.6) for more superposition (thicker texture). Increase tail_duration_seconds (1.0→2.0) for longer decay time. Stereo input creates automatic stereo width (independent random per channel). Mono input converted to stereo. Processing time ~1-5 seconds depending on quantum_states count and audio duration. Enable play_after_processing to auto-play result.
Important: NON-REPEATABLE — each run generates different reflection pattern (randomGauss, randomUniform calls). Save settings if you want to recreate similar (not identical) texture. AMPLITUDE ADDITION — reverb adds to original signal (additive mixing). High quantum_states + low decay can cause clipping. Script includes fadeout to prevent tail cutoff, but no peak normalization. If output clips, reduce base_amplitude or increase state_decay_min. Very high quantum_states (>100) increases processing time significantly. Very low collapse_threshold (<0.5) creates dense superposition (potentially muddy). Substates count affects superposition density (4 = balanced, 6+ = very dense). tail_duration_seconds should be long enough for natural decay (1-2s typical). Stereo width comes from channel independence — not spatial panning.
Quantum Theory Metaphor
Quantum Mechanics Concepts in Audio
Heisenberg Uncertainty Principle
Physics concept:
In quantum mechanics:
ΔE · Δt ≥ ℏ/2
Where:
ΔE = uncertainty in energy
Δt = uncertainty in time
ℏ = reduced Planck constant
Interpretation: Cannot precisely know both energy and time simultaneously
Greater precision in one → greater uncertainty in other
Audio translation (conceptual metaphor, not physical law):
Δt = time uncertainty (delay time spread)
ΔA = amplitude uncertainty (amplitude precision)
Algorithm implements inverse coupling:
amplitude_precision = 1 / (1 + |time_uncertainty|)
Meaning:
Large time_uncertainty (wide delay spread) → low amplitude_uncertainty (precise amplitude)
Small time_uncertainty (tight delay) → high amplitude_uncertainty (less precise amplitude)
Not physically accurate — artistic interpretation for reverb design
Superposition vs Collapse
Quantum concept applied to delays:
SUPERPOSITION STATE (probability ≤ collapse_threshold):
Quantum state exists in multiple configurations simultaneously
Audio: Single state generates substates reflections
Each substate = slight time variation around base delay
Example (substates=4):
State time_uncertainty = 0.25s
Substate 1: delay = 0.25 + 0.013 = 0.263s
Substate 2: delay = 0.25 - 0.008 = 0.242s
Substate 3: delay = 0.25 + 0.019 = 0.269s
Substate 4: delay = 0.25 + 0.002 = 0.252s
Result: Clustered reflections (thicker texture)
COLLAPSED STATE (probability > collapse_threshold):
Wave function collapses to single measured state
Audio: Single state generates one reflection
Example:
State time_uncertainty = 0.18s
Single delay = 0.18 + 0.02 = 0.20s
Result: Discrete reflection (clearer, less dense)
collapse_threshold controls state distribution:
0.5 → 50% collapsed, 50% superposition (balanced)
0.7 → 70% collapsed, 30% superposition (clearer reverb)
0.6 → 40% collapsed, 60% superposition (denser reverb)
Statistical Distributions
Gaussian (Normal) Distribution for Time
Delay time generation:
Gaussian distribution: N(μ, σ²)
μ (mu) = mean (center of distribution)
σ (sigma) = standard deviation (spread)
In script:
time_uncertainty ~ N(time_mean, uncertainty_stddev²)
Example parameters (Medium Quantum preset):
time_mean = 0.18
uncertainty_stddev = 0.35
Distribution shape:
68% of delays within [0.18-0.35, 0.18+0.35] = [-0.17, 0.53]
95% of delays within [0.18-0.70, 0.18+0.70] = [-0.52, 0.88]
Script uses absolute value: delay = |time_uncertainty| + min_delay_offset
Converts negative draws to positive (symmetric distribution around 0)
Adds min_delay_offset (0.02s) to prevent zero-delay issues
Result: Most delays cluster near time_mean, with probability tail
Organic density falloff (not uniform spacing)
Uniform Distribution for Collapse
State collapse probability:
Uniform distribution: U(0, 1)
Equal probability for any value between 0 and 1
In script:
probability ~ U(0, 1)
if probability > collapse_threshold:
collapsed state (single reflection)
else:
superposition (substates reflections)
Example (collapse_threshold = 0.65):
probability = 0.72 → collapsed (72 > 65)
probability = 0.41 → superposition (41 ≤ 65)
probability = 0.88 → collapsed (88 > 65)
Expected distribution:
collapse_threshold = 0.65 → 35% collapsed, 65% superposition
collapse_threshold = 0.50 → 50% collapsed, 50% superposition
Each state independently determined (no correlation)
Amplitude Scaling Laws
State Decay (Early Reflection Principle)
Amplitude decreases with state index:
Linear decay formula:
state_decay = state_decay_min + state_decay_range × (quantum_states - state) / quantum_states
Example (Medium Quantum: state_decay_min=0.7, state_decay_range=0.3, quantum_states=35):
State 1: state_decay = 0.7 + 0.3 × (35-1)/35 = 0.7 + 0.3 × 0.971 = 0.991 (loudest)
State 10: state_decay = 0.7 + 0.3 × (35-10)/35 = 0.7 + 0.3 × 0.714 = 0.914
State 20: state_decay = 0.7 + 0.3 × (35-20)/35 = 0.7 + 0.3 × 0.429 = 0.829
State 35: state_decay = 0.7 + 0.3 × (35-35)/35 = 0.7 + 0.3 × 0.000 = 0.700 (quietest)
Mimics natural reverb behavior:
Early reflections louder (first states)
Late reflections quieter (last states)
Linear falloff (not exponential — algorithmic simplification)
Combined with amplitude_precision:
final_amp = base_amplitude × amplitude_precision × state_decay × factor
where factor = 0.8 (collapsed) or 0.5/sub (superposition substates)
Substate Amplitude Division
Superposition energy distribution:
Collapsed state (single reflection):
amp = base_amplitude × amplitude_precision × state_decay × 0.8
Superposition (multiple substates):
sub_amp = base_amplitude × amplitude_precision × state_decay × 0.5 / sub
Where sub = substate index (1, 2, 3, ...)
Example (substates=4):
Substate 1: sub_amp = (base × precision × decay × 0.5) / 1 = 0.500 × base_energy
Substate 2: sub_amp = (base × precision × decay × 0.5) / 2 = 0.250 × base_energy
Substate 3: sub_amp = (base × precision × decay × 0.5) / 3 = 0.167 × base_energy
Substate 4: sub_amp = (base × precision × decay × 0.5) / 4 = 0.125 × base_energy
Total energy ≈ 1.042 × base_energy (slightly more than single reflection)
Rationale:
Energy spread across multiple paths
Later substates quieter (acoustic simulation)
Total energy comparable to collapsed state (balance)
Higher substates count = thicker texture but each reflection quieter
State Modes & Behavior
Collapsed State Mode
Triggered when: randomUniform(0,1) > collapse_threshold
Characteristics:
- Single discrete reflection per quantum state
- Clearer, more defined delay taps
- Amplitude: base_amplitude × amplitude_precision × state_decay × 0.8
- Delay: |time_uncertainty| + min_delay_offset
Example output (5 collapsed states, uncertainty_stddev=0.3):
State 1: delay=0.23s, amp=0.198
State 2: delay=0.41s, amp=0.187
State 3: delay=0.15s, amp=0.176
State 4: delay=0.52s, amp=0.165
State 5: delay=0.08s, amp=0.154
Audio character:
- Sparse, rhythmic reflections
- Similar to traditional algorithmic reverb
- Good for clarity, articulation
- Less "smeared" sound
Preset recommendations:
- High collapse_threshold (0.7+) for mostly collapsed states
- Lower quantum_states count (20-35) for defined taps
- Subtle Quantum preset optimized for this
Superposition Mode
Triggered when: randomUniform(0,1) ≤ collapse_threshold
Characteristics:
- Multiple substates per quantum state
- Clustered reflections around base delay
- Each substate: delay = |time_uncertainty| + Gaussian(0, substate_jitter) + min_delay_offset
- Amplitude per substate: base_amplitude × amplitude_precision × state_decay × 0.5 / sub
Example output (1 superposition state with 4 substates, base delay=0.25s):
Substate 1: delay=0.263s (0.25+0.013), amp=0.100
Substate 2: delay=0.242s (0.25-0.008), amp=0.050
Substate 3: delay=0.269s (0.25+0.019), amp=0.033
Substate 4: delay=0.252s (0.25+0.002), amp=0.025
Audio character:
- Dense, thick texture
- Multiple reflections "smeared" in time
- Rich, complex reverb tail
- Less rhythmic definition
Preset recommendations:
- Low collapse_threshold (0.5-0.6) for more superposition
- Higher substates count (5-6) for thickness
- Heavy/Extreme Quantum presets optimized for this
Mixed Mode (Typical)
Typical configuration: collapse_threshold ≈ 0.6-0.7
40-30% superposition states (clustered reflections)
60-70% collapsed states (discrete reflections)
Audio character:
- Balance between clarity and density
- Some defined early reflections (collapsed)
- Thickened late tail (superposition)
- Organic variation (non-uniform)
Example distribution (35 states, collapse_threshold=0.65):
Expected: ~23 collapsed (discrete) + ~12 superposition (48 substates if substates=4)
Total reflections: ~23 + 48 = 71 delay taps
Distribution: Probabilistic (varies each run)
Preset recommendations:
- Medium Quantum preset (balanced default)
- Adjust collapse_threshold ±0.05 for character tuning
- Most versatile for general reverb applications
Parameters & Presets
Core Parameters
| Parameter |
Type |
Default |
Description |
| Preset |
Menu |
Custom |
Select from: Custom, Subtle Quantum, Medium Quantum, Heavy Quantum, Extreme Quantum. Overrides parameters if not Custom. |
| tail_duration_seconds |
Positive |
1.0 |
Duration of silent tail appended to sound (reverb decay time). Range: 0.5-3.0s typical. Longer = more reverb tail. Must be sufficient for natural decay. |
| quantum_states |
Natural |
35 |
Number of quantum states (reflection events). Range: 10-100. Higher = denser reverb. Each state generates 1 (collapsed) or substates (superposition) reflections. |
| uncertainty_stddev |
Positive |
0.35 |
Standard deviation for Gaussian time distribution. Range: 0.1-0.7. Higher = wider delay spread. Controls reverb character (tight vs diffuse). |
| collapse_threshold |
Positive |
0.65 |
Probability threshold for state collapse. Range: 0-1. Higher = more collapsed states (clearer). Lower = more superposition (denser). |
| base_amplitude |
Positive |
0.25 |
Base reflection amplitude multiplier. Range: 0.1-0.5. Higher = louder reverb. Scaled by amplitude_precision and state_decay. |
| time_mean |
Positive |
0.18 |
Mean of Gaussian delay distribution (μ). Range: 0.05-0.5s. Center of delay time clustering. Affects reverb timing character. |
| min_delay_offset |
Positive |
0.02 |
Minimum delay added to all reflections. Range: 0.01-0.05s. Prevents zero-delay artifacts. Creates "predelay" effect. |
| state_decay_min |
Positive |
0.7 |
Minimum state decay value (last state amplitude). Range: 0.5-0.9. Higher = less attenuation. Controls reverb tail loudness. |
| state_decay_range |
Positive |
0.3 |
Decay range (first state - last state). Range: 0.1-0.5. Higher = steeper amplitude falloff. First state = state_decay_min + state_decay_range. |
| substates |
Natural |
4 |
Number of substates per superposition state. Range: 2-8. Higher = thicker superposition texture. Each substate is a separate reflection. |
| substate_jitter |
Positive |
0.015 |
Standard deviation for substate time jitter (Gaussian). Range: 0.005-0.03s. Higher = wider substate spread. Controls superposition "smearing". |
| fadeout_duration |
Positive |
1.0 |
Duration of cosine fadeout applied to tail. Range: 0.5-2.0s. Prevents abrupt reverb cutoff. Should be ≤ tail_duration_seconds. |
| play_after_processing |
Boolean |
1 (true) |
Auto-play result after processing. 1 = play, 0 = silent. Convenience option for immediate audition. |
Built-in Presets
Subtle Quantum
Character: Light, articulate reverb with clear reflections
Parameters:
- tail_duration_seconds = 0.8
- quantum_states = 20 (sparse)
- uncertainty_stddev = 0.25 (tight delay clustering)
- collapse_threshold = 0.7 (mostly collapsed states)
- base_amplitude = 0.18 (quieter reverb)
- substates = 3 (lighter superposition)
Use cases: Vocals, dialogue, acoustic instruments, transparent mixing
Medium Quantum
Character: Balanced reverb with moderate density and decay
Parameters:
- tail_duration_seconds = 1.0
- quantum_states = 35 (balanced)
- uncertainty_stddev = 0.35 (moderate spread)
- collapse_threshold = 0.65 (mixed states)
- base_amplitude = 0.25 (moderate level)
- substates = 4 (balanced superposition)
Use cases: General mixing, pads, ambient textures, default starting point
Heavy Quantum
Character: Dense, thick reverb with rich superposition
Parameters:
- tail_duration_seconds = 1.3
- quantum_states = 45 (dense)
- uncertainty_stddev = 0.42 (wide spread)
- collapse_threshold = 0.62 (more superposition)
- base_amplitude = 0.28 (louder reverb)
- substates = 5 (thick superposition)
Use cases: Ambient music, sound design, thick pads, ethereal textures
Extreme Quantum
Character: Very dense, evolving reverb with maximum complexity
Parameters:
- tail_duration_seconds = 1.8
- quantum_states = 60 (very dense)
- uncertainty_stddev = 0.5 (very wide spread)
- collapse_threshold = 0.6 (heavy superposition)
- base_amplitude = 0.3 (loud reverb)
- substates = 6 (very thick superposition)
Use cases: Experimental composition, drone music, sound art, textural extremes
Parameter Interaction Guide
Reverb Density Control:
- Sparse reverb: Low quantum_states (15-25) + high collapse_threshold (0.7-0.8)
- Dense reverb: High quantum_states (50-70) + low collapse_threshold (0.5-0.6) + high substates (5-6)
Reverb Character Control:
- Tight, early reflections: Low uncertainty_stddev (0.2-0.3) + low time_mean (0.1-0.15)
- Diffuse, late reflections: High uncertainty_stddev (0.4-0.6) + high time_mean (0.25-0.4)
Reverb Level Control:
- Subtle reverb: Low base_amplitude (0.15-0.2) + high state_decay_min (0.75-0.85)
- Loud reverb: High base_amplitude (0.3-0.4) + low state_decay_min (0.6-0.7)
Decay Control:
- Short decay: Short tail_duration_seconds (0.5-0.8) + high state_decay_range (0.4-0.5)
- Long decay: Long tail_duration_seconds (1.5-3.0) + low state_decay_range (0.2-0.3)
Advanced Parameter Tuning
Stereo Width Control
Independent channel parameters:
Left channel uses form parameters. Right channel hardcoded with slight variations (see script lines 129-145):
- time_uncertainty: Gaussian(0.16, 0.38) instead of (time_mean, uncertainty_stddev)
- state_decay: 0.65 + 0.35× ratio (different min/range)
- collapse_threshold: 0.62 (hardcoded)
- base_amplitude: 0.23 (hardcoded)
Result: Different reflection patterns per channel = stereo width. To modify: Edit right channel parameters in script (lines 129-145).
Clipping Prevention: If output clips, reduce: (1) base_amplitude (primary control), (2) quantum_states (fewer reflections), (3) Increase state_decay_range (faster amplitude falloff). Or: Apply peak normalization after processing (Scale peak to 0.99). High substates + low collapse_threshold + high quantum_states = clipping risk.
Processing Time Warning: Processing time ≈ O(quantum_states × substates × audio_duration). Extreme settings: quantum_states=100, substates=8, 60s audio → 10-30 seconds processing. Medium settings: quantum_states=35, substates=4, 10s audio → <2 seconds. For very long audio (>5 minutes) with extreme settings, expect significant processing time.
Applications & Use Cases
Musical Applications
Ambient & Drone Music
Recommended settings: Heavy or Extreme Quantum presets
- Long tail_duration_seconds (2-3s) for sustained reverb clouds
- High quantum_states (50-80) for dense texture
- Low collapse_threshold (0.5-0.6) for superposition dominance
- High substates (6-8) for maximum thickness
Character: Evolving, non-repeating reverb textures. Creates "living" ambience that changes subtly each iteration. Useful for generative composition where variation is desired.
Vocal Processing
Recommended settings: Subtle Quantum preset
- Short tail_duration_seconds (0.6-1.0s) for clarity
- Low quantum_states (15-25) for sparse, natural reflections
- High collapse_threshold (0.7-0.8) for discrete echoes
- Low base_amplitude (0.15-0.2) for transparent mixing
Character: Clear, articulate reverb without muddiness. Organic variation prevents "digital" sound of fixed algorithmic reverb. Maintains intelligibility.
Percussive Material
Recommended settings: Custom — moderate quantum_states, high collapse_threshold
- quantum_states = 30-40 for rhythmic complexity
- collapse_threshold = 0.7-0.75 for defined taps
- uncertainty_stddev = 0.3-0.4 for moderate spread
- Low substates (2-3) to avoid rhythmic smearing
Character: Rhythmic echoes with probabilistic variation. Creates "ghost notes" effect. Each hit triggers different reflection pattern (non-repeating).
Sound Design & FX
Recommended settings: Extreme settings or custom experiments
- Very high quantum_states (80-120) for metallic textures
- Extreme uncertainty_stddev (0.6-0.8) for chaotic diffusion
- Very low collapse_threshold (0.3-0.4) for superposition dominance
- High substates (7-10) for maximum density
Character: Unusual, non-naturalistic reverb. Metallic shimmer, grainy textures, "quantum uncertainty" sound signature. Experimental timbral design.
Scientific & Educational Applications
Teaching Quantum Concepts
Pedagogical value:
- Demonstrates probability distributions (Gaussian, uniform) in audible form
- Illustrates superposition (multiple simultaneous states) vs collapse (single measured state)
- Shows uncertainty principle concept (coupled variables) through time-amplitude relationship
- Provides statistical thinking — control via distributions rather than fixed values
Exercise: Adjust collapse_threshold from 0.0 to 1.0 in steps of 0.1. Listen to transition from full superposition (dense, thick) to full collapse (sparse, discrete). Discuss how probability threshold affects macroscopic outcome.
Algorithmic Composition
Generative music applications:
- Non-deterministic reverb — each render generates variation
- Formulaic control — parameters can be computed algorithmically
- Useful for creating "evolving" pieces where each playback differs slightly
- Combine with other stochastic processes (granular synthesis, random pitch shifts)
Workflow: (1) Generate base sound (synthesis, recording). (2) Apply quantum reverb with chosen preset. (3) Re-apply multiple times to create variation set. (4) Use variations in generative score or select "best" iteration. Non-repeatability becomes compositional feature.
Comparison to Other Reverb Types
| Reverb Type |
Characteristics |
vs Quantum Uncertainty |
| Convolution |
Impulse response from real space. Realistic, static. |
Quantum: Synthetic, non-repeating, algorithmic control. Less realistic, more variation. |
| Algorithmic (Schroeder) |
Fixed feedback networks, comb filters, all-pass. Deterministic, efficient. |
Quantum: Probabilistic delays, no feedback, superposition. Non-deterministic, textural. |
| Plate/Spring |
Physical models of mechanical reverb. Characteristic coloration. |
Quantum: No physical model, purely conceptual (quantum metaphor). Different sonic signature. |
| Granular |
Grain-based diffusion, windowed delays. Dense, textural. |
Quantum: State-based (not grain-based), probabilistic collapse. Structured randomness vs granular chaos. |
Troubleshooting Common Issues
Problem: Output sounds muddy/unclear
Cause: Too many superposition states, excessive substates
Solution: Increase collapse_threshold (0.7+), decrease substates (3 or less), reduce quantum_states
Problem: Reverb too quiet/inaudible
Cause: Low base_amplitude, high state_decay_min
Solution: Increase base_amplitude (0.3+), lower state_decay_min (0.6-0.65), increase quantum_states
Problem: Clipping/distortion
Cause: Excessive reflection amplitude, too many states
Solution: Decrease base_amplitude (0.15-0.2), increase state_decay_range (faster falloff), reduce quantum_states
Problem: Reverb too sparse/rhythmic
Cause: Too few states, high collapse_threshold
Solution: Increase quantum_states (40+), lower collapse_threshold (0.5-0.6), increase substates (5+)
Problem: Abrupt reverb cutoff
Cause: Insufficient tail_duration_seconds or fadeout_duration
Solution: Increase tail_duration_seconds (1.5-2.5s), increase fadeout_duration (1.0-1.5s)
Problem: Reverb sounds "digital" or mechanical
Cause: Parameters too uniform, high collapse_threshold
Solution: Increase uncertainty_stddev (0.4-0.5), lower collapse_threshold (0.55-0.65), vary parameters slightly from presets
Mathematical Deep Dive
Algorithm Implementation Details
State Loop Structure
Pseudocode for quantum state processing:
for state from 1 to quantum_states:
# Generate time uncertainty
time_uncertainty = randomGauss(time_mean, uncertainty_stddev)
# Calculate amplitude precision (inverse coupling)
amplitude_precision = 1 / (1 + |time_uncertainty|)
# Calculate state-dependent decay
decay_ratio = (quantum_states - state) / quantum_states
state_decay = state_decay_min + state_decay_range × decay_ratio
# Determine collapse vs superposition
probability = randomUniform(0, 1)
if probability > collapse_threshold:
# COLLAPSED STATE (single reflection)
delay = |time_uncertainty| + min_delay_offset
amp = base_amplitude × amplitude_precision × state_decay × 0.8
# Apply delay: sample(t) += amp × sample(t - delay)
Formula: "self + amp * self(x - delay)"
else:
# SUPERPOSITION STATE (multiple substates)
for sub from 1 to substates:
# Add jitter to base delay
sub_delay = |time_uncertainty| + randomGauss(0, substate_jitter) + min_delay_offset
# Amplitude divided by substate index
sub_amp = base_amplitude × amplitude_precision × state_decay × 0.5 / sub
# Apply delay: sample(t) += sub_amp × sample(t - sub_delay)
Formula: "self + sub_amp * self(x - sub_delay)"
Stereo Processing Algorithm
Channel independence:
STEREO PROCESSING:
1. Extract left channel → process with form parameters
2. Extract right channel → process with hardcoded parameters
(different time_uncertainty distribution, collapse_threshold, amplitude)
3. Combine to stereo
MONO PROCESSING:
1. Process single channel with form parameters
2. Convert to stereo (duplicate mono → stereo)
Result: Stereo input → decorrelated left/right reflections (width)
Mono input → mono processing → stereo output (dual mono)
Stereo width comes from different random seed per channel
Each channel generates different time_uncertainty draws → different delay patterns
Fadeout Implementation
Cosine fade formula:
Fadeout applied to tail region:
fade_start = total_duration - fadeout_duration
For each sample at time x:
if x > fade_start:
fade_factor = 0.5 + 0.5 × cos(π × (x - fade_start) / fadeout_duration)
sample = sample × fade_factor
else:
sample = sample (unchanged)
Cosine fade characteristics:
- Smooth, gradual attenuation (no clicks)
- Starts at fade_start (sample = sample × 1.0)
- Ends at total_duration (sample = sample × 0.0)
- Shape: cos(0) = 1 → cos(π) = -1, scaled to [1.0 → 0.0]
Example (fadeout_duration = 1.0s):
At fade_start + 0.00s: fade_factor = 0.5 + 0.5×cos(0) = 1.0 (no fade)
At fade_start + 0.25s: fade_factor = 0.5 + 0.5×cos(π/4) ≈ 0.854
At fade_start + 0.50s: fade_factor = 0.5 + 0.5×cos(π/2) = 0.5 (half)
At fade_start + 0.75s: fade_factor = 0.5 + 0.5×cos(3π/4) ≈ 0.146
At fade_start + 1.00s: fade_factor = 0.5 + 0.5×cos(π) = 0.0 (silent)
Probability Theory Details
Expected Value Calculations
Expected number of reflections:
Given:
quantum_states = N
collapse_threshold = T
substates = S
Probability of collapse: P_collapse = 1 - T
Probability of superposition: P_superposition = T
Expected collapsed states: N × (1 - T)
Expected superposition states: N × T
Total expected reflections:
E[reflections] = N × (1 - T) × 1 + N × T × S
= N × [(1 - T) + T × S]
= N × [1 - T + T×S]
= N × [1 + T×(S - 1)]
Examples:
N=35, T=0.65, S=4: E[reflections] = 35 × [1 + 0.65×3] = 35 × 2.95 = 103
N=20, T=0.70, S=3: E[reflections] = 20 × [1 + 0.70×2] = 20 × 2.40 = 48
N=60, T=0.60, S=6: E[reflections] = 60 × [1 + 0.60×5] = 60 × 4.00 = 240
High substates + low threshold → very dense reverb
Delay Time Distribution
Statistical properties of delays:
time_uncertainty ~ N(time_mean, uncertainty_stddev²)
After taking absolute value and adding offset:
delay = |time_uncertainty| + min_delay_offset
Distribution becomes:
- Folded Gaussian around time_mean (if time_mean ≈ 0)
- Shifted Gaussian (if time_mean >> uncertainty_stddev)
Example (time_mean=0.18, uncertainty_stddev=0.35):
Mean delay ≈ |0.18| + 0.02 = 0.20s
Most delays in range [0.02, 0.70] (95% within ±2σ after folding)
For collapsed states: single delay per state
For superposition: substates delays around base, jittered by N(0, substate_jitter²)
Overall delay distribution: Clustered around time_mean, with probabilistic tails
Not uniform (unlike fixed algorithmic reverb taps)
Computational Complexity
Processing Time Analysis
Time complexity:
Variables:
N = quantum_states
S = substates
D = audio_duration (seconds)
R = sample_rate (samples/second)
T = collapse_threshold
Total samples: D × R
Per quantum state:
- If collapsed (probability 1-T): 1 delay operation
- If superposition (probability T): S delay operations
Expected operations per state: (1-T) × 1 + T × S = 1 + T×(S-1)
Total operations: N × [1 + T×(S-1)] × D × R
Example (N=35, S=4, T=0.65, D=10s, R=44100 Hz):
Operations = 35 × 2.95 × 10 × 44100
≈ 45.5 million delay operations
Praat Formula implementation (iterative sample processing):
Time complexity: O(N × S × D × R)
Approximate processing time: 0.5-2 seconds for typical settings
Linear scaling with quantum_states and audio_duration