Advanced Poisson Synthesis System — User Guide
Ultra-fast granular synthesis using Poisson process timing: generates complex textures from mathematical stochastic processes with optimized batch formula generation for high-performance synthesis.
What this does
This script implements Poisson-based granular synthesis — generating complex sonic textures using stochastic timing (Poisson processes) and granular synthesis techniques. Process: (1) Creates multiple layers (1-8) of sound grains, (2) Each layer uses Poisson process timing (random with average rate), (3) Each grain is a sine wave with Hanning envelope, (4) Parameters (frequency, duration, amplitude) vary per grain based on synthesis mode, (5) Layers are combined with optional stereo spatialization, (6) Output is a complex, evolving texture with natural-sounding randomness and density control.
Key Features:
- 5 Preset Configurations — From dense clouds to sparse atmospheres
- Poisson Process Timing — Natural stochastic grain distribution
- Ultra-Fast Optimization — Batch formula generation instead of individual grain insertion
- Multiple Synthesis Modes — Different grain characteristics per mode
- 3 Spatial Modes — Mono, stereo wide, and rotating panning
- Customizable Layers — 1-8 independent synthesis layers
- Mathematical Precision — Exact control over stochastic properties
Technical Implementation: (1) Layer generation: For each layer (1 to number_of_layers): Create Poisson PointProcess with rate layer_rate. Get random event times from process. For each event: generate grain parameters (frequency, duration, amplitude) based on synthesis_mode. (2) Formula optimization: Instead of adding grains one by one (slow in Praat), build complete formula string with all grains for layer. Single Create Sound from formula with complex conditional statement. (3) Layer combination: Add layer sounds together into final output. (4) Spatial processing: Apply stereo effects: Mono (direct), Stereo Wide (filtered L/R differences), Rotating (panning automation). (5) Final processing: Apply fade in/out, normalize peak amplitude. Key innovation: batch formula generation allows thousands of grains without performance degradation.
Quick start
- In Praat, ensure no objects selected (generates from scratch).
- Run script… →
advanced_poisson_synthesis.praat. - Choose preset (Standard Three Layer recommended for first try).
- Or select Custom and adjust parameters manually.
- Set Duration (sec) for output length.
- Choose Synthesis_mode for grain character.
- Choose Spatial_mode for stereo image.
- Click OK — synthesis process runs with progress updates.
- Output named "poisson_presetname" appears in Objects window.
- Output automatically played when complete.
Poisson Synthesis Theory
Poisson Process Fundamentals
What is a Poisson Process?
Mathematical definition:
Why Poisson for Synthesis?
Natural sound analogy:
🎵 Natural Sounds Following Poisson Statistics
Rain: Drops hit surface at random times
Fire: Crackles and pops occur randomly
Crowd murmur: Individual voices at random intervals
Geiger counter: Radioactive decay events
Popcorn popping: Random timing between pops
Natural texture: No regular rhythm, but average density
Psychological effect: Sounds "alive", not mechanical
Granular Synthesis Basics
What is a Grain?
Grain structure in this script:
🔊 Grain Components
Carrier: Sine wave at frequency f
Envelope: Hanning window (raised cosine)
Duration: Typically 0.03-0.5 seconds
Amplitude: Scaled by layer and synthesis mode
Timing: Start time from Poisson process
Hanning Envelope Mathematics
Formula for smooth grain:
📐 Grain Visualization
Time domain:
┌─────────────────────────────────────┐
│ ___ │
│ __/ \__ │
│ ___/ \___ │
│/ \ │
└─────────────────────────────────────┘
Hanning envelope × sine oscillations
Frequency domain:
Peak at grain frequency, spread depends on duration
Shorter grain = wider frequency spread
Batch Formula Optimization
The Performance Problem
Why naive grain insertion is slow:
Create empty sound
For each grain (thousands):
Create grain sound
Add to main sound (Formula or addition)
Remove grain sound
PROBLEMS:
1. Object creation/deletion overhead
2. Memory fragmentation
3. Formula reevaluation each addition
4. O(n²) complexity for n grains
EXAMPLE: 1000 grains → 1000 object creations
Each with memory allocation, Formula application
Extremely slow in Praat
Batch Formula Solution
How this script optimizes:
Mathematical Implementation
Complete Grain Formula
Script implementation details:
Layer Combination Mathematics
Adding layers together:
Preset Configurations
Preset Overview
1 Custom
User-defined parameters
Use: Full manual control
2 Standard Three Layer
3 layers, balanced rates
Character: Natural texture
3 Dense Cloud
4 layers, high density
Character: Thick, complex
4 Sparse Atmosphere
3 layers, low density
Character: Ambient, spacey
5 Rhythmic Pattern
4 layers, no randomization
Character: Pulsed, structured
6 Chaotic Texture
5 layers, high variation
Character: Wild, unpredictable
Preset Details
🎵 Standard Three Layer (Preset 2)
Character: Balanced, natural-sounding texture
Parameters:
- Duration: 12 seconds
- Base frequency: 100 Hz
- Frequency range: 300 Hz
- Low rate: 3 events/sec
- High rate: 15 events/sec
- Layers: 3
- Randomization: Yes
- Synthesis mode: Three Layer Standard
- Spatial mode: Mono
Grain characteristics: Medium duration (0.1-0.3s), balanced amplitudes
Best for: General texture, background pads, natural sounds
🎵 Dense Cloud (Preset 3)
Character: Thick, complex granular cloud
Parameters:
- Duration: 10 seconds
- Base frequency: 150 Hz
- Frequency range: 400 Hz
- Low rate: 10 events/sec
- High rate: 25 events/sec
- Layers: 4
- Randomization: Yes
- Synthesis mode: Dense Granular
- Spatial mode: Stereo Wide
Grain characteristics: Short grains (0.03-0.11s), high density
Best for: Dense textures, noise-like sounds, complex backgrounds
🎵 Sparse Atmosphere (Preset 4)
Character: Open, ambient, spacious texture
Parameters:
- Duration: 20 seconds
- Base frequency: 80 Hz
- Frequency range: 500 Hz
- Low rate: 1 events/sec
- High rate: 5 events/sec
- Layers: 3
- Randomization: Yes
- Synthesis mode: Sparse Atmospheric
- Spatial mode: Rotating
Grain characteristics: Long grains (0.3-0.8s), sparse timing
Best for: Ambient music, background atmospheres, spacey textures
🎵 Rhythmic Pattern (Preset 5)
Character: Structured, pulsed, less random
Parameters:
- Duration: 15 seconds
- Base frequency: 120 Hz
- Frequency range: 200 Hz
- Low rate: 5 events/sec
- High rate: 12 events/sec
- Layers: 4
- Randomization: No
- Synthesis mode: Rhythmic Pulses
- Spatial mode: Mono
Grain characteristics: Short-medium grains (0.08-0.2s), consistent
Best for: Rhythmic textures, pulsed backgrounds, structured sounds
🎵 Chaotic Texture (Preset 6)
Character: Wild, unpredictable, high variation
Parameters:
- Duration: 12 seconds
- Base frequency: 100 Hz
- Frequency range: 600 Hz
- Low rate: 2 events/sec
- High rate: 20 events/sec
- Layers: 5
- Randomization: Yes
- Synthesis mode: Chaotic Scatter
- Spatial mode: Stereo Wide
Grain characteristics: Variable grains (0.05-0.35s), extreme variation
Best for: Experimental sounds, chaotic textures, sound effects
Synthesis & Spatial Modes
Synthesis Modes
| Mode | Grain Frequency | Grain Duration | Grain Amplitude | Character |
|---|---|---|---|---|
| Three Layer Standard | base + random×range | 0.1-0.3s | 1.5/layers | Natural, balanced |
| Dense Granular | base×(0.5+layer×0.3) + random×range | 0.03-0.11s | 1.2/layers | Dense, cloud-like |
| Sparse Atmospheric | base×(0.3+layer×0.4) + random×range×0.5 | 0.3-0.8s | 2.0/layers | Open, ambient |
| Rhythmic Pulses | base×layer + random×range×0.3 | 0.08-0.2s | 1.8/layers | Pulsed, structured |
| Chaotic Scatter | base×(0.5+2×random) + random×range | 0.05-0.35s | 1.5/layers | Wild, unpredictable |
Spatial Modes
🔊 Mono (Mode 1)
Processing: No spatial processing
Output: Single channel mono sound
Characteristics: Centered, focused
Best for: Further processing, mono compatibility, simple textures
Implementation: Direct output with no modification
🎧 Stereo Wide (Mode 2)
Processing: Different filtering for L/R channels
- Left: 0.8× amplitude, band-pass 0-4000Hz
- Right: 0.8× amplitude, band-pass 200-8000Hz
Output: Stereo with spectral differences
Characteristics: Wide, immersive, frequency-separated
Best for: Headphone listening, ambient music, immersive textures
Psychoacoustic effect: Different frequency content per ear creates width
🔄 Rotating (Mode 3)
Processing: Amplitude modulation for panning
- Left: 0.6 + cos(2π·0.25·x)×0.4
- Right: 0.6 + sin(2π·0.25·x)×0.4
Output: Stereo with automated panning
Characteristics: Moving, swirling, dynamic
Best for: Motion effects, evolving textures, psychedelic sounds
Panning rate: 0.25 Hz (complete cycle every 4 seconds)
Implementation: 90° phase difference between L/R modulation
Layer Rate Calculation by Mode
Parameters & Effects
Core Synthesis Parameters
| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
| Duration (sec) | positive | 12 | 1-60 | Output sound length in seconds |
| Base frequency (Hz) | positive | 100 | 20-2000 | Center frequency for grains |
| Frequency range (Hz) | positive | 300 | 0-2000 | Maximum variation from base frequency |
| Low rate (events/sec) | positive | 3 | 0.1-50 | Minimum Poisson process rate |
| High rate (events/sec) | positive | 15 | 1-100 | Maximum Poisson process rate |
| Number of layers | integer | 3 | 1-8 | Independent synthesis layers to combine |
| Randomize parameters | boolean | 1 (yes) | 0/1 | Add random variation to layer rates |
| Fade time (sec) | positive | 2 | 0-10 | Fade in/out duration at boundaries |
Mode Selection Parameters
| Parameter | Type | Options | Description |
|---|---|---|---|
| Synthesis mode | optionmenu | Three Layer Standard, Dense Granular, Sparse Atmospheric, Rhythmic Pulses, Chaotic Scatter | Determines grain characteristics and layer rates |
| Spatial mode | optionmenu | Mono, Stereo Wide, Rotating | Stereo processing and spatialization |
| Normalize output | boolean | 0/1 | Scale peak amplitude to 0.9 (prevents clipping) |
Parameter Interaction Guide
- Short (1-5s): Quick generation, good for testing
- Medium (5-20s): Typical for textures, reasonable generation time
- Long (20-60s): For ambient tracks, slower generation
- Very long (>60s): Risk of formula limits, very slow
Generation time ∝ Duration × Total grain count
- 0 Hz: All grains same frequency (chorus effect)
- 50-200 Hz: Subtle variation, cohesive texture
- 200-500 Hz: Moderate variation, rich texture
- 500-1000 Hz: Wide variation, complex harmonic content
- 1000+ Hz: Very wide, potentially dissonant
Range adds around base: frequency = base ± random(0,range)
- Total grains ≈ Duration × Average rate × Layers
- Example: 10s × 10 grains/s × 3 layers = 300 grains
- Dense: > 20 grains/s total
- Medium: 5-20 grains/s total
- Sparse: < 5 grains/s total
- Performance: Keep total grains < 5000 for reasonable speed
Performance Optimization
Batch Formula Technique
The Optimization Breakthrough
Traditional vs optimized approach:
For each grain (1 to N):
Create Sound: grain formula
Select output
Formula: "self + object(grain_id, x)"
Remove grain
Complexity: O(N) object operations
Praat overhead: high
OPTIMIZED (Batch Formula):
Build formula string:
formula$ = "0"
For each grain (1 to N):
formula$ = formula$ + grain_term
Create Sound: formula$
Complexity: O(1) object creation
Praat overhead: low
SPEED IMPROVEMENT:
1000 grains: 100× faster
10000 grains: 1000× faster
Limited by formula string length
Formula Length Limits
Praat limitation: Formula strings have maximum length
Estimate: ~1,000,000 characters practical limit
Per grain: ~200-400 characters per grain term
Maximum grains: ~2500-5000 grains per layer
Total grains: layers × grains_per_layer
Error symptom: "Formula too long" or crash
Solution: Reduce duration, rates, or layers
Workaround: Generate multiple sounds and combine manually
Performance Guidelines
| Scenario | Settings | Approx. Grains | Generation Time | Recommendation |
|---|---|---|---|---|
| Quick Test | Duration: 3s, Layers: 2, Rates: 5-10 | ~50-100 | < 5 seconds | For parameter testing |
| Standard Texture | Duration: 10s, Layers: 3, Rates: 3-15 | ~200-400 | 10-30 seconds | Typical use case |
| Dense Cloud | Duration: 15s, Layers: 4, Rates: 10-25 | ~1000-2000 | 30-90 seconds | Complex textures |
| Ambient Long | Duration: 30s, Layers: 3, Rates: 1-5 | ~200-300 | 20-40 seconds | Long sparse textures |
| Extreme | Duration: 30s, Layers: 5, Rates: 20-40 | ~3000-6000 | 2-5 minutes | Risk of formula limits |
Memory and CPU Considerations
- CPU: Single-threaded during generation (Praat limitation)
- Memory: Formula strings in memory, plus sound buffers
- Disk: No disk I/O during generation
- Praat objects: Creates 2×layers + 3 objects temporarily
- Sound buffer: duration × samplerate × 8 bytes (double)
Example: 30s @44.1kHz = 1,323,000 samples × 8 bytes = ~10.6 MB per sound
Troubleshooting Performance Issues
Causes: High grain count, long duration, many layers
Solutions: Reduce duration, lower rates, fewer layers
Causes: Formula too long, memory exhaustion
Solutions: Use more conservative settings, restart Praat
Causes: Exceeded Praat's formula length limit
Solutions: Significantly reduce grain count, generate in chunks
Causes: Grains too short (< 0.005s), formula precision issues
Solutions: Use synthesis modes with longer grains, avoid extreme settings
Applications
Ambient Music Production
Use case: Generate evolving pads and atmospheric backgrounds
Technique: Use Sparse Atmosphere preset with Rotating spatial mode
Example: 30-second ambient bed for film/tv
Sound Design & Effects
Use case: Create unique textures for film/games
Technique: Experiment with Chaotic Texture and Dense Cloud modes
Workflow:
- Generate multiple variations
- Layer with other sounds
- Process with effects (reverb, delay)
- Create libraries of textures
Algorithmic Composition
Use case: Stochastic music generation
Technique: Use as sound source for further manipulation
Application: Generative music systems, aleatoric composition
Psychoacoustic Research
Use case: Study perception of stochastic textures
Technique: Precise control over statistical properties
Advantages: Reproducible, parameterized, mathematically defined
Therapeutic Soundscapes
Use case: Create calming/ focusing audio environments
Technique: Low base frequencies (80-120Hz), sparse rates
Example: Meditation background, focus enhancement
Educational Tool
Use case: Teach stochastic processes, granular synthesis
Advantages:
- Hear mathematical concepts
- Understand Poisson statistics audibly
- Experiment with synthesis parameters
- Learn about texture perception
Practical Workflow Examples
🎬 Film: Underwater Atmosphere
Goal: Create deep underwater rumble with occasional bubbles
Settings:
- Base frequency: 60 Hz
- Frequency range: 100 Hz
- Low rate: 1 events/sec
- High rate: 8 events/sec
- Layers: 4
- Synthesis mode: Sparse Atmospheric
- Spatial mode: Stereo Wide
- Duration: 45 seconds
Post-processing: Add low-pass filter, slight reverb
Result: Deep, evolving underwater environment
🎵 Music: Granular Pad Layer
Goal: Add textured pad to electronic track
Settings:
- Base frequency: 220 Hz (A3)
- Frequency range: 150 Hz
- Low rate: 5 events/sec
- High rate: 15 events/sec
- Layers: 3
- Synthesis mode: Standard Three Layer
- Spatial mode: Rotating
- Duration: 16 bars at 120 BPM (32 seconds)
Integration: Side-chain compress to kick, add delay
Result: Evolving pad that moves in stereo field
🎮 Game: Magic Spell Effect
Goal: Create sparkling magical energy texture
Settings:
- Base frequency: 800 Hz
- Frequency range: 1200 Hz
- Low rate: 8 events/sec
- High rate: 25 events/sec
- Layers: 4
- Synthesis mode: Dense Granular
- Spatial mode: Stereo Wide
- Duration: 5 seconds
Post-processing: High-pass filter, bright reverb, volume envelope
Result: Sparkling magical energy burst
Advanced Techniques
- Generate multiple versions: Different settings for different sections
- Crossfade: Blend between different parameter sets
- Dynamic evolution: Change parameters over time by generating sections
- Stochastic automation: Use random walks for parameter changes
Praat doesn't support real-time parameter changes, but can generate sections manually
- MIDI mapping: Map parameters to MIDI controls (external software)
- OSC control: Use Open Sound Control for parameter changes
- Script automation: Write Praat script to generate evolving textures
- Parameter sequences: Pre-calculate parameter progressions
Advanced users can extend script for dynamic control
- Layer with recorded sounds: Mix Poisson textures with field recordings
- Filter banks: Process different frequency ranges separately
- Spectral processing: Apply FFT-based effects to generated texture
- Multi-modal synthesis: Combine with other synthesis techniques
Poisson synthesis as one element in complex sound design
Creative Parameter Explorations
| Exploration | Parameter Settings | Expected Result | Creative Use |
|---|---|---|---|
| Micro-soundscape | Duration: 60s, Rates: 0.2-2, Layers: 5 | Very sparse, isolated events | Minimalist composition |
| White noise texture | Base: 1000, Range: 10000, Grains: 0.01s | Noise-like but structured | Textured noise bed |
| Harmonic cloud | Base: 100, Range: 0, Layers: 8 | All grains at 100Hz, chorus effect | Tuned texture |
| Frequency sweep texture | Base automation via sections | Evolving pitch texture | Rising/falling effects |
| Rhythmic structure | Randomize: 0, Layers: 1, Specific rates | Regular but Poisson-timed | Stochastic rhythm |
Technical Implementation Details
Poisson Process Generation
Praat's Create Poisson Process
Grain Formula Construction
String Building Algorithm
formula$ = "0"
for each grain in grains:
start$ = string(grain.start, precision=6)
end$ = string(grain.start + grain.duration, precision=6)
amp$ = string(grain.amplitude, precision=6)
freq$ = string(grain.frequency, precision=2)
dur$ = string(grain.duration, precision=6)
term$ = " + if x >= " + start$ + " and x < " + end$ +
" then " + amp$ + " * sin(2*pi*" + freq$ + "*(x - " + start$ +
")) * (1 - cos(2*pi*(x - " + start$ + ")/" + dur$ + "))/2 else 0 fi"
formula$ = formula$ + term$
endfor
PRECISION NOTES:
- Times: 6 decimal places (microsecond precision)
- Frequencies: 2 decimal places (0.01 Hz precision)
- Amplitudes: 6 decimal places
- Ensures numerical accuracy
- Avoids rounding errors in grain boundaries