Entropy-Modulated Dynamic Reverb — User Guide

Spectral intelligence reverb: analyzes signal complexity in real-time to dynamically control reverb characteristics, creating adaptive spatial effects that respond to audio content.

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 entropy-modulated dynamic reverb — an intelligent reverberation system that analyzes spectral complexity in real-time to control reverb characteristics. The system measures spectral entropy (information content) of the input signal and uses this measurement to dynamically blend between two contrasting reverb impulses: a dark reverb (long decay, heavy damping) for low-entropy signals and a bright reverb (short decay, light damping) for high-entropy signals. Additionally, the overall wet/dry mix is modulated by entropy, creating an adaptive spatial effect that responds to the audio's spectral characteristics.

Key Features:

What is spectral entropy? Spectral entropy measures the "disorder" or "randomness" in a signal's frequency distribution. High entropy indicates complex, noisy, or transient-rich signals (like consonants in speech, percussion, or noise). Low entropy indicates tonal, predictable signals (like vowels, sustained notes, or pure tones). In this reverb system: (1) Low entropy → dark reverb dominates (long, damped decays suitable for tonal material). (2) High entropy → bright reverb dominates (short, lively decays suitable for transients). (3) Medium entropy → balanced blend. Advantages: (1) Content-adaptive: Automatically suits reverb to signal type. (2) Transient preservation: Avoids muddying complex signals. (3) Musical response: Creates natural-sounding spatial effects. (4) Computational efficiency: Fast analysis and matrix-based processing.

Technical Implementation: (1) Spectral analysis: Convert sound to spectrogram, compute normalized spectral entropy for each frame. (2) Entropy smoothing: Apply causal exponential smoothing to prevent rapid fluctuations. (3) Impulse generation: Create two reverb impulses with contrasting characteristics. (4) Convolution: Process input with both reverb impulses. (5) Matrix mixing: Use fast matrix operations to blend dry signal, dark reverb, and bright reverb based on entropy values. Processing uses optimized Praat operations (Spectrogram, Matrix formulas) for speed and efficiency. Output preserves original dynamics while adding intelligent spatial enhancement.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…Entropy-Modulated_Reverb.praat.
  3. Set analysis parameters (window size, hop size, smoothing).
  4. Adjust reverb characteristics for dark and bright reverbs.
  5. Set mix parameters (wet/dry range, mapping direction).
  6. Click OK — processing runs in 4 stages with progress updates.
  7. Output named "originalname_entropyReverb" appears in Objects window.
Quick tip: Start with default parameters for most material. Use smaller window sizes (10-25ms) for precise transient detection, larger windows (40-50ms) for smoother modulation. Higher smoothing_alpha (0.2-0.3) for responsive modulation, lower (0.05-0.1) for gradual changes. Dark reverb works well for vocals and sustained instruments, bright reverb for percussion and transients. Invert mapping makes complex signals drier and simple signals wetter (useful for dialogue). Processing shows real-time progress through four stages: entropy analysis, smoothing, reverb creation, and final mixing.
Important: PROCESSING INTENSIVE — convolution and spectral analysis require significant computation, especially for long files. Window size affects temporal resolution — too small may cause artifacts, too large reduces responsiveness. Reverb times significantly longer than original sound may create excessive tail length. Extreme parameter values (very high damping, very long reverb times) may cause numerical issues. Smoothing too aggressive (high alpha) may cause modulation artifacts. Matrix processing requires all signals to be same length — short sounds are padded, long sounds truncated to convolution result length. Output is normalized to prevent clipping but may still overload if original signal is hot.

Spectral Entropy Theory

Information Theory Basics

Spectral Entropy Definition

Mathematical formulation:

Given a spectrum with N frequency bins: Let p[i] = power in bin i / total power (Normalized probability distribution) Spectral entropy H = -Σ p[i] * log₂(p[i]) Sum over all bins where p[i] > 0 Normalized entropy H_norm = H / log₂(N) Ranges from 0 to 1 Interpretation: H_norm = 0: All energy in one bin (pure tone) H_norm = 1: Equal energy in all bins (white noise) 0 < H_norm < 1: Various degrees of complexity Example calculation: N = 100 bins, equal power in all bins: p[i] = 1/100 for all i H = -100 * (1/100 * log₂(1/100)) = -log₂(0.01) ≈ 6.64 H_norm = 6.64 / log₂(100) ≈ 6.64 / 6.64 = 1.0

Why Spectral Entropy for Reverb Control?

Perceptual correlates:

Reverb design rationale:

Reverb Impulse Design

Exponential Decay Model

Impulse response generation:

Dark reverb impulse: ir_dark(t) = randomGauss(0,1) * exp(-t*5/RT_dark) * exp(-t*damping_dark*10/RT_dark) Bright reverb impulse: ir_bright(t) = randomGauss(0,1) * exp(-t*8/RT_bright) * exp(-t*damping_bright*3/RT_bright) Where: t = time (0 to reverb_time) RT = reverb time parameter damping = high-frequency damping factor randomGauss(0,1) = Gaussian noise excitation Component interpretation: exp(-t*5/RT): Overall amplitude envelope exp(-t*damping*10/RT): High-frequency damping Different coefficients create different character Design philosophy: Dark: Slow initial decay, heavy high-frequency loss Bright: Fast initial decay, preserved high frequencies

Why Dual Impulse Design?

Contrasting characteristics:

Dark Reverb (low entropy): Reverb time: 2.5s (long) Damping: 0.8 (heavy high-frequency loss) Character: Smooth, washy, distant Use: Vocals, strings, pads, sustained tones Bright Reverb (high entropy): Reverb time: 1.0s (short) Damping: 0.3 (light high-frequency loss) Character: Crisp, present, articulate Use: Percussion, plucks, transients, noise Blended Response (medium entropy): Weighted combination of both Adaptive character based on signal content Natural transition between extremes

Dynamic Modulation System

Control Signal Generation

Real-time entropy tracking:

STEP 1: Spectral analysis Window size: 25ms (analysis_window_size) Hop size: 25ms (hop_size) Overlap: 0% (for efficiency) Window type: Gaussian STEP 2: Entropy calculation per frame For each analysis frame: Compute FFT → spectrum Normalize power distribution Calculate spectral entropy Normalize by maximum possible entropy STEP 3: Temporal smoothing Exponential smoothing: y[n] = α*x[n] + (1-α)*y[n-1] α = smoothing_alpha (0.15 default) Causal (only past frames affect current) STEP 4: Control signal Smoothed entropy becomes modulation signal Ranges 0-1 over time Controls both reverb blend and wet/dry mix

Why Exponential Smoothing?

Benefits for audio modulation:

🎚️ Modulation Intuition

Speech example:

Vowels (low entropy) → dark reverb dominates

Consonants (high entropy) → bright reverb dominates

Result: Clear speech with natural spatial enhancement


Music example:

Sustained notes (low entropy) → long, washy reverb

Percussion hits (high entropy) → short, crisp reverb

Result: Rhythmic clarity with atmospheric sustain

Matrix Mixing Architecture

Fast Signal Combination

Efficient implementation:

Convert all signals to Matrix objects: dry[] = original sound (padded) dark[] = dark reverb convolution bright[] = bright reverb convolution ent[] = entropy control signal wet[] = wet/dry mix envelope Compute wet mix envelope: if invert_mapping = 0: wet[] = min_wet + (1 - ent[]) * (max_wet - min_wet) else: wet[] = min_wet + ent[] * (max_wet - min_wet) Final output formula: output[] = dry[]*(1 - wet[]) + (dark[]*(1 - ent[]) + bright[]*ent[]) * wet[] Interpretation: ent[] controls dark/bright balance (0=all dark, 1=all bright) wet[] controls overall wet/dry mix Both modulated by spectral entropy

Why Matrix Processing?

Performance advantages:

Processing Pipeline

🔄 Four-Stage Processing Flow

Complete signal path from input to output:

Stage 1: Spectral Entropy Analysis

StepOperationOutput
1.1Sound → SpectrogramTime-frequency representation
1.2Frame-by-frame FFTIndividual spectra
1.3Power normalizationProbability distribution
1.4Entropy calculationRaw entropy values (0-1)
1.5Store in TableOfRealTime-entropy pairs

Stage 2: Control Signal Conditioning

StepOperationOutput
2.1Exponential smoothingSmoothed entropy
2.2Create IntensityTierContinuous control signal
2.3InterpolationSample-accurate modulation

Stage 3: Reverb Generation

StepOperationOutput
3.1Generate dark impulseIR_dark (2.5s decay)
3.2Generate bright impulseIR_bright (1.0s decay)
3.3Convolve input with IR_darkReverb_dark
3.4Convolve input with IR_brightReverb_bright
3.5Peak normalizationPrevent clipping

Stage 4: Matrix-Based Mixing

StepOperationOutput
4.1Create entropy soundControl signal as audio
4.2Length matchingAll signals same duration
4.3Convert to matricesdry[], dark[], bright[], ent[]
4.4Compute wet envelopewet[] based on mapping
4.5Final mix formulaoutput[] matrix
4.6Matrix → SoundFinal output
4.7Peak normalizationSafe playback level

Complete Signal Flow

INPUT SOUND ↓ SPECTROGRAM (25ms windows, 25ms hop) ↓ FRAME-WISE FFT → SPECTRAL ENTROPY CALCULATION ↓ EXPONENTIAL SMOOTHING (α=0.15) ↓ INTENSITYTIER CONTROL SIGNAL ↓ ↓ GENERATE IR_DARK (2.5s) → CONVOLVE → REVERB_DARK ↓ INPUT SOUND → CONVOLUTION ↓ GENERATE IR_BRIGHT (1.0s) → CONVOLVE → REVERB_BRIGHT ↓ LENGTH MATCHING (all signals to max_dur) ↓ MATRIX CONVERSION (dry[], dark[], bright[], ent[]) ↓ WET ENVELOPE CALCULATION (wet[] = f(ent[])) ↓ FINAL MIX: dry[]*(1-wet[]) + (dark[]*(1-ent[]) + bright[]*ent[])*wet[] ↓ MATRIX → SOUND CONVERSION ↓ PEAK NORMALIZATION (0.98) ↓ OUTPUT: originalname_entropyReverb

Computational Optimizations

Performance enhancements:
  • No progress updates in inner loops: Uses 'noprogress' for speed
  • Matrix operations: Vectorized processing eliminates sample loops
  • Efficient memory management: Intermediate objects cleaned up promptly
  • Optimized FFT usage: Spectrogram provides efficient spectral analysis
  • Causal processing: No look-ahead enables real-time implementation

Balance between computational efficiency and audio quality

Parameters Guide

⚙️ Complete Parameter Reference

Detailed explanation of all user-controllable parameters:

Analysis Parameters

ParameterDefaultRangeDescription
analysis_window_size0.0250.01-0.05FFT window size in seconds
hop_size0.0250.01-0.05Analysis frame hop size
smoothing_alpha0.150.05-0.5Exponential smoothing factor

Reverb Parameters

ParameterDefaultRangeDescription
reverb_time_dark2.51.0-5.0Dark reverb decay time (seconds)
reverb_time_bright1.00.5-3.0Bright reverb decay time (seconds)
damping_dark0.80.1-1.0Dark reverb high-frequency damping
damping_bright0.30.1-1.0Bright reverb high-frequency damping

Mix Parameters

ParameterDefaultRangeDescription
min_wet_amount0.10.0-0.5Minimum wet/dry mix ratio
max_wet_amount0.90.5-1.0Maximum wet/dry mix ratio
invert_mapping00/1Reverse entropy-to-wet mapping

Parameter Interactions

Key relationships:
  • Window size vs hop size: Smaller values = higher temporal resolution
  • Reverb time difference: Larger difference = more dramatic contrast
  • Damping values: Higher = more high-frequency loss
  • Wet amount range: Wider range = more dramatic mix changes
  • Smoothing alpha: Higher = faster response to changes

Parameters work together to create the overall effect character

Recommended Settings

🎤 Vocal Processing

Goal: Clear vocals with adaptive spatial enhancement

Settings:

  • Window: 20ms, Hop: 20ms
  • Smoothing: 0.2 (responsive)
  • Dark reverb: 3.0s, Damping 0.7
  • Bright reverb: 1.2s, Damping 0.4
  • Wet range: 0.2-0.6
  • Mapping: Normal (0)

🥁 Drum Processing

Goal: Rhythmic clarity with atmospheric tails

Settings:

  • Window: 15ms, Hop: 15ms
  • Smoothing: 0.1 (gradual)
  • Dark reverb: 2.0s, Damping 0.9
  • Bright reverb: 0.8s, Damping 0.2
  • Wet range: 0.3-0.7
  • Mapping: Normal (0)

🎹 Dialogue Enhancement

Goal: Intelligible speech with controlled space

Settings:

  • Window: 25ms, Hop: 25ms
  • Smoothing: 0.25 (responsive)
  • Dark reverb: 1.5s, Damping 0.6
  • Bright reverb: 0.5s, Damping 0.4
  • Wet range: 0.1-0.4
  • Mapping: Inverted (1)

Applications

Music Production

Use case: Intelligent reverb that adapts to musical content

Technique: Use moderate wet levels with contrasting reverb times

Example: Vocal tracks where sustained notes get lush reverb but consonants remain clear

Sound Design

Use case: Creating evolving spatial textures

Technique: Extreme parameter settings for dramatic effects

Example: Transform dry samples into dynamically spatialized sounds

Dialogue Processing

Use case: Adding space to speech while maintaining intelligibility

Technique: Inverted mapping with conservative wet levels

Example: Film dialogue where room tone is added but sibilants remain clean

Algorithmic Composition

Use case: Automated spatialization of generated material

Technique: Process algorithmically generated sounds

Example: L-system generated patterns with intelligent reverb application

Advanced Techniques

Creative applications:
  • Serial processing: Apply multiple times with different settings
  • Section processing: Different parameters for different song sections
  • Hybrid approaches: Combine with other DSP effects
  • Automation: Vary parameters over time for evolving spaces

Entropy modulation can be integrated into complex production workflows

Troubleshooting Common Issues

Problem: Processing very slow
Cause: Long audio files, small window sizes, many FFT calculations
Solution: Use larger window/hop sizes, process shorter segments
Problem: Modulation sounds choppy
Cause: Too much smoothing (low alpha), large hop size
Solution: Increase smoothing_alpha, decrease hop_size
Problem: Reverb sounds muddy
Cause: Dark reverb too dominant, excessive reverb times
Solution: Reduce reverb_time_dark, increase damping_dark
Problem: Output too quiet or clipped
Cause: Extreme wet/dry settings, hot input signal
Solution: Adjust min/max_wet_amount, normalize input first

Technical Deep Dive

Spectral Analysis Mathematics

Entropy Calculation Details

Implementation specifics:

Power calculation from complex FFT: For each bin k: power[k] = real[k]² + imag[k]² Total power: P_total = Σ power[k] for k=1..N Normalized distribution: p[k] = power[k] / P_total Spectral entropy: H = -Σ p[k] * log₂(p[k]) (Sum only over bins where p[k] > threshold) Maximum entropy: H_max = log₂(N) Normalized entropy: H_norm = H / H_max Numerical considerations: Small power values (< 1e-7) ignored for stability log₂ computation uses natural log conversion Normalization ensures 0 ≤ H_norm ≤ 1

Reverb Impulse Physics

Exponential Decay Modeling

Physical interpretation:

Amplitude envelope: A(t) = exp(-t/τ) Where τ = time constant related to reverb time Reverb time (RT60): Time for level to drop 60dB Relationship: RT60 = τ * ln(1000) ≈ 6.91τ In impulse formulas: exp(-t*5/RT) approximates amplitude decay exp(-t*damping*10/RT) models frequency-dependent absorption Different coefficients for dark/bright: Dark: Slow amplitude decay (5/RT), fast HF loss (10*damping/RT) Bright: Fast amplitude decay (8/RT), slow HF loss (3*damping/RT) Gaussian noise excitation: randomGauss(0,1) provides dense excitation spectrum Creates natural-smooth reverb character