Phase Shaper — User Guide
Extreme convolution-based sound design: generates 10 radical impulse responses for transforming audio through convolution, creating effects from drones to glitches to spectral freezing.
What this does
This script implements extreme convolution sound design — generating 10 unique impulse responses algorithmically and convolving them with audio to create radical transformations. Each mode creates a different character: from spectral freezing to bouncing ball effects, alien resonators to cyber glitches. Process: (1) Select audio input, (2) Choose transformation mode, (3) Script generates custom impulse response based on mathematical formulas, (4) Convolves input with impulse response, (5) Outputs transformed audio with extreme sound design effects.
Key Features:
- 10 Radical Modes — From drones to glitches to spectral effects
- Algorithmic IR Generation — Mathematical formula-based impulse responses
- Intensity Control — Single parameter scales effect aggression/duration
- Real-time Generation — IRs generated on-the-fly, no pre-recorded samples
- Stereo/Mono Handling — Automatically converts stereo to mono for convolution
- Non-Destructive — Original audio preserved (optional deletion)
Technical Implementation: (1) Input preparation: Store original properties, convert stereo→mono if needed (convolution works on mono). (2) IR generation: Based on selected mode, creates Sound from formula with mathematical expression defining waveform. Different formulas create different effects: sine sweeps, noise patterns, modulated signals, etc. (3) Envelope shaping: Applies amplitude envelopes (fades, gates) to IR using Formula commands. (4) Convolution: Uses Praat's Convolve function with "sum" normalization and "zero" padding. (5) Output processing: Renames, scales peak to prevent clipping, optionally deletes original. (6) Cleanup: Removes temporary IR and mono conversion objects. Key insight: The IR is the "sound design algorithm" — its mathematical properties define the transformation.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
phase_shaper.praat. - Choose Mode from 10 radical transformations.
- Adjust Intensity (default 1.0) — controls effect strength/duration.
- Set Scale_peak to prevent clipping (default 0.99).
- Choose whether to Keep_original sound.
- Click OK — IR generated and convolution applied.
- Output named "originalname_modeSuffix" appears in Objects window.
- Output automatically played if Play_result enabled.
Convolution Sound Design Theory
Convolution Fundamentals
What is Convolution?
Mathematical definition:
Creative Convolution vs Traditional
Traditional convolution (reverb):
- IR: Recorded room impulse (milliseconds)
- Purpose: Add realistic space/reverb
- Effect: Subtle, natural
- Examples: Hall, room, plate reverb
Creative convolution (this script):
- IR: Synthetic, algorithmic (seconds)
- Purpose: Radical sound transformation
- Effect: Extreme, unnatural
- Examples: Spectral freezing, glitches, drones
IR Generation Mathematics
Praat's Create Sound from Formula
Formula syntax for IR generation:
Envelope Shaping
Applying amplitude envelopes to IR:
1. Linear fade-out:
Formula: "self * (1 - x/duration)"
Creates smooth decay to zero
2. Exponential decay:
Formula: "self * exp(-rate * x)"
Natural decay, faster initially
3. Exponential rise (reverse decay):
Formula: "self * exp(rate * (x - duration))"
Starts quiet, gets louder (black hole effect)
4. Gate/Threshold:
Formula: "if self > threshold then 1 else 0 fi"
Creates hard digital gating
5. Window function multiplication:
Formula: "self * (if sin(density*x) > 0.9 then 1 else 0 fi)"
Creates rhythmic gating pattern
📐 Convolution Visualization
Input: Short transient (drum hit)
IR: Long noise burst (5 seconds)
Convolution process:
1. Drum hit occurs at time t=0
2. IR (noise) gets triggered by drum
3. Output = drum hit "smears" into 5 seconds of noise
4. Spectral content of noise imposed on drum
Result: Drum transformed into noise burst with drum's timing
Creative use: Turn any sound into noise texture
Praat Convolution Implementation
Convolve Function Parameters
Script uses: Convolve: "sum", "zero"
🔧 Convolution Settings
Normalization: "sum"
- Scales output so sum of IR samples = 1
- Prevents extreme volume changes
- Maintains approximate input loudness
- Important for consistent results
Padding: "zero"
- Assumes signal is zero outside boundaries
- Simplest padding method
- May cause artifacts at boundaries
- Acceptable for creative applications
Alternative: "peak" normalization
- Scales to preserve peak amplitude
- Better for preventing clipping
- But can make quiet IRs very loud
Computational Complexity
Why convolution can be slow:
Spectral Transformation Principle
Impulse Response Modes
Mode Overview
1 Hyper-Dispersion
5s frequency sweep drone
Character: Evolving, sweeping
2 Quantum Rain
Rhythmic Gaussian noise
Character: Pitter-patter, granular
3 Fractal Zap
FM-modulated sweep
Character: Metallic, buzzing
4 Reverse Black Hole
Exponentially rising noise
Character: Sucking, inhaling
5 Alien Resonator
Harmonic chord decay
Character: Metallic, resonant
6 Cyber Glitch
Square wave chirp
Character: Digital, 8-bit
7 Bouncing Ball
Accelerating impulses
Character: Rhythmic, playful
8 Deep Space
Low-pass filtered noise
Character: Rumble, drone
9 Spectral Freeze
Long Gaussian noise
Character: Frozen, ambient
10 Demon Growl
AM-modulated noise
Character: Growling, angry
Mode Details
🌀 Hyper-Dispersion (Mode 1)
Formula: 0.5 * sin(2*3.14 * (50 + (nyquist-50)/2 * x/duration) * x)
Envelope: Linear fade-out: self * (1 - x/duration)
IR Duration: 3.0 × intensity seconds
Effect: Creates sweeping frequency drone that evolves from low to high frequencies
Intensity controls: IR duration (longer = more extreme sweep)
Best for: Drone creation, evolving textures, sci-fi effects
Sound character: Smooth, sweeping, atmospheric
🌧️ Quantum Rain (Mode 2)
Formula: randomGauss(0,0.5) (Gaussian noise)
Envelope: Rhythmic gating + exponential decay: self * (if sin(density*x) > 0.9 then 1 else 0 fi) * exp(-2*x)
IR Duration: 2.0 seconds (fixed)
Effect: Creates pitter-patter rhythmic texture from noise
Intensity controls: Gating density (15 × intensity)
Best for: Granular textures, rain effects, rhythmic noise
Sound character: Crackly, granular, organic
⚡ Fractal Zap (Mode 3)
Formula: sin(2*3.14 * (20 + 1000*x) * x) * sin(2*3.14 * modulation*x)
Envelope: Linear fade-out: self * (1 - x/duration)
IR Duration: 0.5 seconds
Effect: Frequency-modulated sweep creates metallic buzzing
Intensity controls: Modulation rate (500 × intensity Hz)
Best for: Metallic textures, insect sounds, digital artifacts
Sound character: Buzzy, metallic, synthetic
⬅️ Reverse Black Hole (Mode 4)
Formula: randomGauss(0, 0.2) (quiet Gaussian noise)
Envelope: Exponential rise: self * exp(5*(x - duration))
IR Duration: 1.0 × intensity seconds
Effect: Noise that gets exponentially louder (reverse decay)
Intensity controls: IR duration (longer = more dramatic rise)
Best for: Sucking/inhaling effects, reverse sounds, tension builds
Sound character: Whooshing, sucking, building
👽 Alien Resonator (Mode 5)
Formula: (sin(f1*x) + sin(f2*x) + sin(f3*x)) * exp(-5*x)
Envelope: Exponential decay built into formula
IR Duration: 1.0 seconds (fixed)
Effect: Three sine waves at harmonically-related frequencies create metallic chord
Intensity controls: Base frequency (500 × intensity Hz)
Best for: Metallic resonances, bell-like sounds, synthetic tones
Sound character: Ringing, metallic, harmonic
💻 Cyber Glitch (Mode 6)
Formula: round(sin(2*3.14 * (100*x + freq_rate*x^2)))
Envelope: Linear fade-out: self * (1 - x/duration)
IR Duration: 0.5 × intensity seconds
Effect: Square wave chirp (round(sin()) creates -1/0/+1 values)
Intensity controls: Chirp rate (50 × intensity)
Best for: Digital glitches, 8-bit effects, data corruption sounds
Sound character: Digital, crunchy, bit-reduced
🏀 The Bouncing Ball (Mode 7)
Formula: sin(2*3.14 * speed * x^3)
Envelope: Hard gate: if self > 0.9 then 1 else 0 fi
IR Duration: 1.0 × intensity seconds
Effect: Sine wave with accelerating frequency (x³), gated to create impulses
Intensity controls: Acceleration speed (200 × intensity)
Best for: Rhythmic effects, bouncing sounds, accelerating patterns
Sound character: Rhythmic, playful, accelerating
🪐 Deep Space (Mode 8)
Formula: randomGauss(0,1) (full-volume Gaussian noise)
Envelope: Low-pass filter (0-200Hz) + linear fade-out
IR Duration: 3.0 seconds (fixed)
Effect: Heavy low-frequency rumble from filtered noise
Intensity controls: None (fixed effect)
Best for: Sub-bass enhancement, rumble effects, space ambiance
Sound character: Deep, rumbling, atmospheric
❄️ Spectral Freeze (Mode 9)
Formula: randomGauss(0,0.1) (quiet Gaussian noise)
Envelope: Linear fade-out: self * (1 - x/duration)
IR Duration: 5.0 × intensity seconds
Effect: Very long noise impulse destroys timing, leaves only "average" spectrum
Intensity controls: IR duration (longer = more extreme freezing)
Best for: Ambient drones, spectral freezing, texture creation
Sound character: Frozen, washed, ambient
😈 Demon Growl (Mode 10)
Formula: randomGauss(0,0.5) * sin(2*3.14 * rate * x)
Envelope: None (full length)
IR Duration: 1.0 seconds (fixed)
Effect: Noise amplitude-modulated by sub-bass sine wave
Intensity controls: Modulation rate (30 × intensity Hz)
Best for: Growling effects, angry textures, AM synthesis
Sound character: Growling, aggressive, modulated
Parameters & Effects
Core Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Mode | optionmenu | 1 (Hyper-Dispersion) | Transformation algorithm |
| Intensity | positive | 1.0 | Effect strength/duration (mode-dependent) |
| Scale_peak | positive | 0.99 | Output normalization to prevent clipping |
| Play_result | boolean | 1 (yes) | Auto-play after processing |
| Keep_original | boolean | 1 (yes) | Preserve original sound object |
Intensity Interpretation by Mode
| Mode | What Intensity Controls | Low (0.1-0.5) | Medium (0.5-2.0) | High (2.0-5.0) |
|---|---|---|---|---|
| Hyper-Dispersion | IR duration | Short sweep (0.3-1.5s) | Medium sweep (1.5-6s) | Long drone (6-15s) |
| Quantum Rain | Gating density | Sparse droplets | Moderate rain | Heavy downpour |
| Fractal Zap | Modulation rate | Slow buzz (50-250Hz) | Medium buzz (250-1000Hz) | Fast sizzle (1000-2500Hz) |
| Reverse Black Hole | IR duration | Quick suck (0.1-0.5s) | Medium inhale (0.5-2s) | Long vacuum (2-5s) |
| Alien Resonator | Base frequency | Low tones (50-250Hz) | Mid tones (250-1000Hz) | High tones (1000-2500Hz) |
| Cyber Glitch | IR duration & chirp rate | Short glitches | Medium digital noise | Long data bursts |
| Bouncing Ball | Acceleration speed | Slow bounces | Medium rhythm | Fast machine-gun |
| Deep Space | None (fixed) | Same effect | Same effect | Same effect |
| Spectral Freeze | IR duration | Brief freeze (0.5-2.5s) | Medium wash (2.5-10s) | Extreme drone (10-25s) |
| Demon Growl | Modulation rate | Slow growl (3-15Hz) | Medium pulse (15-60Hz) | Fast vibration (60-150Hz) |
Output Considerations
Why needed: Convolution can create peaks much louder than input
Default 0.99: Leaves 1dB headroom, prevents clipping
If clipping occurs: Reduce to 0.8-0.9
If too quiet: Increase to 1.0 (no scaling) or use amplification after
Mode variations: Some modes create louder outputs than others
Check visually: View waveform after processing to verify no clipping
- Keep_original = 1 (default): Original sound preserved in Objects window
- Keep_original = 0: Original sound deleted after processing
- Memory considerations: Each Sound object uses ~4×duration×samplerate bytes
- For long files: Keep originals only if needed for comparison
- For experimentation: Keep originals to try different modes
- Praat limitation: Too many objects can slow down interface
Applications
Sound Design & Effects Creation
Use case: Generate unique sound effects from ordinary sounds
Technique: Process short, percussive sounds with extreme modes
Example: Drum hit + Spectral Freeze = evolving drone
Ambient Music Production
Use case: Create evolving pads and textures
Technique: Use Spectral Freeze, Hyper-Dispersion, Deep Space modes
Workflow:
- Process field recordings or instrument samples
- Layer multiple processed versions
- Apply additional processing (reverb, delay)
- Create evolving ambient beds
Experimental Music
Use case: Radical transformation of acoustic sources
Technique: Chain multiple modes, extreme intensity settings
Application: Glitch, noise, avant-garde composition
Film & Game Audio
Use case: Create sci-fi, horror, fantasy sound effects
Technique:
- Alien Resonator for metallic creatures
- Demon Growl for monster vocals
- Cyber Glitch for technology sounds
- Reverse Black Hole for suction/portal effects
Audio Restoration Creative Reuse
Use case: Transform degraded audio into artistic material
Technique: Process noisy/artifacted recordings with creative intent
Example: Vinyl crackle + Quantum Rain = enhanced texture
Educational Tool
Use case: Teach convolution, sound design, spectral processing
Advantages:
- Hear mathematical formulas as sound
- Understand convolution through extreme examples
- Experiment with synthesis without synthesizers
- Learn about impulse responses creatively
Practical Workflow Examples
🎬 Sci-Fi Spaceship Interior
Source: Recording of refrigerator hum or air conditioner
Processing:
- Mode 5: Alien Resonator (intensity 0.8) → metallic resonance
- Mode 8: Deep Space (intensity 1.0) → add low rumble
- Mode 6: Cyber Glitch (intensity 0.3) → occasional digital glitches
Result: Complex, evolving spaceship engine sound
Tip: Process each mode on copy, mix to taste
🎹 Ambient Piano Texture
Source: Clean piano chord or single note
Processing:
- Mode 9: Spectral Freeze (intensity 3.0) → create long drone
- Mode 1: Hyper-Dispersion (intensity 1.5) → add frequency sweep
- Mode 2: Quantum Rain (intensity 0.5) → subtle granular texture
Result: Evolving ambient pad from piano source
Tip: Freeze mode first, then add movement with other modes
🥁 Experimental Percussion
Source: Simple drum hit or percussion sample
Processing:
- Mode 7: Bouncing Ball (intensity 2.0) → create rhythmic pattern
- Mode 3: Fractal Zap (intensity 0.7) → add metallic tail
- Mode 4: Reverse Black Hole (intensity 0.3) → occasional suck-back
Result: Complex, evolving percussion hit
Tip: Bounce mode works best on transient-rich sources
Advanced Techniques
- Process 1: Apply first mode to original
- Process 2: Apply second mode to result of first
- Process N: Continue chaining
- Extreme transformation: 3-4 modes can create completely new sounds
- Order matters: Try different sequences
Example: Original → Spectral Freeze → Alien Resonator → Quantum Rain
- Create copies: Duplicate original sound
- Different modes: Apply different mode to each copy
- Mix together: Combine processed versions
- Pan/balance: Place different modes in stereo field
- Volume automation: Bring different layers in/out
Example: Layer Hyper-Dispersion (left), Quantum Rain (center), Deep Space (right)
- Manual automation: Process multiple times with different intensities
- Crossfade: Blend between different intensity versions
- Dynamic effects: Create builds by increasing intensity over time
- Rhythmic variation: Alternate between high/low intensity
Note: Praat doesn't support parameter automation within script, need manual approach
Troubleshooting Common Issues
Cause: Long IR (Spectral Freeze high intensity) or long input
Solution: Reduce intensity, use shorter audio segments, be patient
Cause: Scale_peak too high, extreme mode settings
Solution: Reduce Scale_peak to 0.8-0.9, reduce intensity
Cause: IR too short, intensity too low, quiet source
Solution: Increase intensity, use louder source, try different mode
Cause: Very long convolution, too many objects
Solution: Process shorter segments, close other Praat objects, restart Praat
Cause: Using noise-based modes (2,4,8,9,10) with quiet source
Solution: Use tone-based modes (1,3,5,6,7) or louder source
Creative Combinations Guide
| Desired Effect | Recommended Modes | Intensity Range | Source Material |
|---|---|---|---|
| Metallic/industrial | 3, 5, 6 | 0.5-2.0 | Percussion, impacts, mechanical sounds |
| Ambient/drone | 1, 8, 9 | 2.0-5.0 | Sustained sounds, pads, field recordings |
| Rhythmic/textural | 2, 7, 10 | 0.5-3.0 | Percussion, staccato sounds |
| Digital/glitch | 3, 4, 6 | 0.3-1.5 | Clean digital sounds, speech, tones |
| Horror/uneasy | 4, 5, 10 | 1.0-3.0 | Voice, breath, organic sounds |
| Sci-fi/space | 1, 5, 8 | 1.0-4.0 | Electronic sounds, drones, sweeps |
Technical Notes
Mathematical Formulas Deep Dive
Understanding the Bouncing Ball Formula
Cyber Glitch: Round(Sin()) Trick
Performance Optimization
Managing Convolution Speed
Factors affecting processing time:
Longer = slower (linearly)
Solution: Process shorter segments
2. IR length (M samples):
Longer = much slower (convolution is O(N·M))
Spectral Freeze with high intensity → very long IR
Solution: Moderate intensity for long IRs
3. Sample rate:
Higher = more samples = slower
44.1kHz vs 96kHz: ~2× difference
Solution: Resample to lower rate if possible
4. Computer resources:
CPU speed, memory bandwidth
Praat uses single-threaded FFT convolution
Solution: Be patient, use faster computer
Estimate: Processing time ≈ (N×M) / (10⁹) seconds
Example: 1min audio + 5s IR → ~5-30 seconds
Memory Usage Considerations
Storage: Input, IR, and output all in memory
Bytes per sample: 8 (double precision)
Formula: Memory ≈ 8 × (N + M + N+M) bytes
Example: 1min @44.1kHz (2.6M samples) + 5s IR (220k samples)
Memory ≈ 8 × (2.6M + 0.22M + 2.82M) = 45 MB
Practical limit: Several hundred MB before slowdown/crash
Warning signs: Praat slows, computer fans spin up
Solution: Shorter files, moderate IR lengths
Alternative Approaches
Why Generate IRs vs Use Pre-recorded
- Infinite variety: Parameters create infinite variations
- Mathematical precision: Exact control over spectral properties
- No recording needed: No microphones, rooms, or equipment
- Extreme effects: Can create physically impossible IRs
- Reproducible: Same parameters = same IR
- Lightweight: Formula is compact, not audio file
Trade-off: Less "realistic" than recorded spaces, but that's the point!
Potential Script Extensions
- Stereo IRs: Generate different IRs for L/R channels
- Parameter automation: Change intensity over time within IR
- IR blending: Mix multiple IRs together
- Export IRs: Save generated IRs as Sound files for reuse
- Graphical preview: Show IR waveform before convolution
- More modes: Add user-defined formula entry
- Batch processing: Apply same mode to multiple files
Script is designed to be extensible — formulas are clearly separated