Universal Convolution Generator — User Guide
Multi-algorithm impulse response generator: creates complex rhythmic patterns and temporal structures using mathematical, physical, and musical algorithms for convolution-based audio processing.
What this does
This script implements a universal convolution generator that creates complex impulse responses using nine different mathematical, physical, and musical algorithms. Unlike traditional convolution that uses pre-recorded impulse responses, this generator creates synthetic impulse patterns based on algorithmic principles, allowing for precise control over rhythmic structures, temporal patterns, and spatial effects when convolved with audio sources.
Key Features:
- 9 Generation Algorithms – Mathematical, physical, and musical pattern generation
- Two-Step Interface – Algorithm selection followed by context-aware parameters
- Mathematical Precision – Exact implementation of Fibonacci, Euclidean, golden ratio algorithms
- Physical Modeling – Realistic bouncing ball physics and accelerando effects
- Stereo Capabilities – Independent channel processing for spatial effects
- Real-time Preview – Immediate auditory feedback after processing
- High-Quality Convolution – Professional-grade audio convolution processing
Technical Implementation: (1) Two-stage interface: Algorithm selection → context-aware parameter dialog. (2) Pattern generation: Each algorithm creates PointProcess objects with precise timing. (3) Impulse creation: Convert PointProcess to pulse train sound. (4) Convolution: Resample source → convolve with generated impulse → output processed audio. (5) Quality control: Fixed pulse characteristics (amplitude=1, width=0.02s), peak normalization, proper cleanup. Key insight: Different algorithms create fundamentally different convolution effects — mathematical sequences create structured rhythms, physical simulations create natural decays, random processes create complex textures.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
universal_convolution_generator.praat. - Step 1: Algorithm Selection
- Choose from 9 generation algorithms
- Set Duration (seconds) for impulse pattern
- Enable Play after processing for preview
- Click Next >>
- Step 2: Algorithm-Specific Parameters
- Adjust parameters specific to chosen algorithm
- Set Sampling frequency (typically 44100 Hz)
- Click Run to process
- The script automatically:
- Generates impulse pattern using selected algorithm
- Convolves with your source audio
- Creates result named "originalname_conv_algorithm"
- Plays result if enabled
- Cleans up intermediate objects
Algorithms
Mathematical Sequences
🔢 Fibonacci (Mono)
Concept: Generates impulses at Fibonacci sequence intervals
Pattern: Exponential spacing based on Fibonacci numbers
Parameters: Number of impulses, Scale divisor, Jitter
Result: Rhythmic patterns with exponential acceleration
🎵 Euclidean Rhythm
Concept: Evenly distributes pulses across time steps
Pattern: Mathematical rhythm generation algorithm
Parameters: Total steps, Active pulses
Result: Perfectly balanced rhythmic patterns
📐 Golden Angle Drift
Concept: Uses golden ratio for optimal spacing
Pattern: Irrational angle distribution prevents repetition
Parameters: Number of impulses, Margin
Result: Evenly distributed, non-repeating patterns
Physical Simulations
🏀 Bouncing Ball
Concept: Simulates physics of a bouncing ball
Pattern: Exponential decay of bounce intervals
Parameters: First bounce time, Gravity, Initial velocity, Bounce coefficient
Result: Natural-sounding decay patterns
⚡ Accelerando
Concept: Exponential acceleration of pulse rate
Pattern: Geometrically decreasing intervals
Parameters: First hit time, Number of pulses, Gap shrink ratio
Result: Rhythmic acceleration effects
🎲 Random Walk
Concept: Stochastic variation of time intervals
Pattern: Random walk with bounded variation
Parameters: Initial gap, Gap variation
Result: Organic, human-like timing variations
Musical & Spatial Patterns
🎧 Stereo Fibonacci
Concept: Independent Fibonacci sequences for left/right channels
Pattern: Different sequences create spatial effects
Parameters: Number of impulses, Left/right start values
Result: True stereo impulse responses with phasing
🎶 Swing
Concept: Applies swing rhythm to regular pulse train
Pattern: Delayed even-numbered beats
Parameters: Tempo (BPM), Swing delay
Result: Musical swing/shuffle rhythms
💥 Bursts and Taps (Ping-Pong)
Concept: Combines isolated taps with dense burst clusters
Pattern: Gaussian-distributed bursts around random centers
Parameters: Tap times, Number of bursts, Points per burst, StdDev
Result: Complex textures with clear reference points
Algorithm Selection Guide
| Desired Effect | Recommended Algorithm | Typical Duration | Source Material |
|---|---|---|---|
| Rhythmic patterns | Euclidean Rhythm, Swing | 2-5 seconds | Percussion, drums |
| Natural decay | Bouncing Ball, Accelerando | 3-8 seconds | Reverb tails, sustained sounds |
| Spatial effects | Stereo Fibonacci | 4-10 seconds | Mono sources, vocals |
| Complex textures | Bursts and Taps, Random Walk | 5-15 seconds | Noise, textures, pads |
| Mathematical structures | Fibonacci, Golden Angle | 3-10 seconds | Melodic material, synths |
Parameters
Common Parameters
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| Duration | positive | 0.1-60.0 seconds | 2.0 seconds | Total length of generated impulse pattern |
| Sampling frequency | positive | 8000-192000 Hz | 44100 Hz | Sample rate for impulse generation |
| Play after processing | boolean | 0/1 | 1 (enabled) | Auto-play result after processing |
Algorithm-Specific Parameters
Fibonacci (Mono)
| Parameter | Range | Default | Effect |
|---|---|---|---|
| Number of impulses | 1-100 | 12 | Total Fibonacci sequence elements |
| Scale divisor | 10.0-1000.0 | 100.0 | Scales sequence to fit duration |
| Jitter (std dev) | 0.0-1.0 | 0.1 | Random timing variation |
Bouncing Ball
| Parameter | Range | Default | Effect |
|---|---|---|---|
| First bounce time | 0.01-5.0 seconds | 0.10 seconds | Initial impact time |
| Gravity | 1.0-20.0 m/s² | 9.81 m/s² | Physical gravity constant |
| Initial velocity | 0.5-10.0 m/s | 3.0 m/s | Rebound speed after first bounce |
| Bounce coefficient | 0.1-0.95 | 0.60 | Energy retention per bounce |
Euclidean Rhythm
| Parameter | Range | Default | Effect |
|---|---|---|---|
| Total Steps | 2-64 | 16 | Division of timeline |
| Active Pulses | 1-Total Steps | 5 | Number of impulses to distribute |
Stereo Fibonacci
| Parameter | Range | Default | Effect |
|---|---|---|---|
| Number of impulses | 1-50 | 12 | Sequence length per channel |
| Left Start 1 & 2 | 1-100 | 1, 1 | Left channel Fibonacci seeds |
| Right Start 1 & 2 | 1-100 | 2, 3 | Right channel Fibonacci seeds |
Parameter Effects Summary
< 1s: Very short, percussive effects
1-3s: Rhythmic patterns, short textures
3-10s: Complex patterns, medium textures
>10s: Very complex, evolving textures
Density Control (algorithm-specific):
Fibonacci: Higher "number of impulses" = denser
Euclidean: Higher "active pulses" = denser
Bouncing Ball: Higher "initial velocity" = more bounces
Random Walk: Lower "initial gap" = denser
Timing Character:
Mathematical: Precise, structured timing
Physical: Natural, exponential decays
Random: Organic, human-like variations
Musical: Groove-based, rhythmic timing
Technical Theory
Convolution Mathematics
Digital Convolution Fundamentals
Convolution operation:
Algorithm Mathematics
Fibonacci Sequence Generation
Classic Fibonacci algorithm:
Euclidean Rhythm Algorithm
Bjorklund's algorithm implementation:
Bouncing Ball Physics
Physical simulation equations:
Implementation Architecture
Processing Pipeline
Computational Considerations
Performance Characteristics
Pattern Generation: O(N) where N = number of impulses
PointProcess Creation: O(N) operations
Pulse Train Generation: O(sr × duration) operations
Convolution: O(M × log M) where M = samples in signal
Memory Usage:
PointProcess: Minimal (stores only time points)
Impulse Sound: O(sr × duration) samples
Temporary objects: 3-4 Sound objects during processing
Typical Processing Times:
1-second impulse + 10-second audio: 2-5 seconds
5-second impulse + 30-second audio: 10-20 seconds
10-second impulse + 60-second audio: 30-60 seconds
Applications
Rhythmic Processing
Use case: Adding complex rhythmic patterns to audio material
Technique: Use Euclidean Rhythm or Swing algorithms with percussive sources
Examples: Drum loop enhancement, rhythmic guitar processing, vocal rhythm effects
Sound Design and Textures
Use case: Creating complex evolving textures from simple sources
Technique: Use long-duration algorithms with noise or sustained sounds
Results: Granular-like textures, ambient beds, synthetic environments
Spatial Audio Effects
Use case: Creating stereo width and spatial movement
Technique: Stereo Fibonacci with mono sources
Applications: Mono-to-stereo conversion, phantom center effects, rotating sounds
Algorithmic Composition
Use case: Generating musical structures through mathematical processes
Technique: Process melodic material with mathematical sequences
Results: Structured variations, canon-like effects, mathematical music
Practical Workflow Examples
🥁 Drum Loop Enhancement
Goal: Add complex rhythmic variations to drum loops
Settings:
- Algorithm: Euclidean Rhythm
- Duration: 2.0 seconds
- Total Steps: 16, Active Pulses: 5
- Source: Drum loop or percussion track
Result: Drum loop with added polyrhythmic complexity and variation
🎹 Synthetic Texture Creation
Goal: Transform simple synth sounds into complex textures
Settings:
- Algorithm: Bursts and Taps
- Duration: 8.0 seconds
- Bursts: 4, Points per burst: 15, StdDev: 0.05
- Source: Sustained synth pad or drone
Result: Evolving granular texture with clear rhythmic reference points
🎤 Vocal Spatial Effects
Goal: Create stereo width and movement for mono vocals
Settings:
- Algorithm: Stereo Fibonacci
- Duration: 6.0 seconds
- Impulses: 20, Different L/R seeds
- Source: Mono vocal recording
Result: Vocals with natural stereo width and subtle phasing effects
Advanced Techniques
- Multiple passes: Apply different algorithms sequentially
- Layered processing: Process same source with different algorithms and mix
- Parameter automation: Change algorithm parameters over time
- Extreme settings: Push parameters beyond normal ranges for experimental results
Combine with other Praat AudioTools for complex processing chains
- Rhythmic + Spatial: Euclidean → Stereo Fibonacci
- Natural + Mathematical: Bouncing Ball → Fibonacci
- Structured + Random: Swing → Random Walk
- Simple → Complex: Short duration → Long duration processing
Troubleshooting Common Issues
Cause: Source material lacks transients, impulse too sparse
Solution: Use transient-rich sources, increase impulse density, try shorter duration
Cause: Too many impulses, source too dense
Solution: Reduce number of impulses, use sparser algorithms, try cleaner sources
Cause: Long duration, high sampling frequency
Solution: Reduce duration, lower sampling frequency, use faster algorithms
Cause: Random elements, extreme parameters
Solution: Use deterministic algorithms, moderate parameter values, preview first