Additive Particle Field — User Guide
Granular sound transformation: decomposes audio into pitched particles distributed in time and space, creating ethereal clouds, rhythmic pulses, and shimmering textures.
What this does
This script implements additive particle synthesis — a granular approach to audio transformation that decomposes a source sound into short "grains" or "particles" and redistributes them according to analytical and stochastic parameters. Each particle is a pitched sine grain whose frequency, amplitude, timing, and panning are derived from the source sound's features. The result is a shimmering, cloud‑like texture that retains spectral characteristics of the original while creating entirely new temporal and spatial structures.
Key Features:
- 5 Built‑in Presets — Dense Cloud, Sparse Field, Rhythmic Pulse, Shimmer, Long Resonance
- Analytical Parameter Extraction — Pitch, intensity, and waveform amplitude inform particle properties
- 3 Envelope Shapes — Hann, Gaussian, Rectangular grain windows
- 3 Panning Modes — Pitch‑derived, Random, Fixed spatial distribution
- LFO Modulation — Optional amplitude modulation for rhythmic/textural variation
- 3 Time Distributions — Linear, Exponential, Random particle placement
- Multidimensional Visualization — Shows particle distribution in time‑pitch‑pan space
Technical Implementation: (1) Analysis: Extract pitch (via Praat's Pitch object) and intensity from the source sound. (2) Particle Generation: For each of N particles, determine its time position (linear/exponential/random), pitch (from Pitch object at that time), amplitude (from waveform + intensity), panning (pitch‑derived/random/fixed). (3) Grain Synthesis: Create a short sine wave with the selected pitch, windowed by the chosen envelope shape. (4) Spatial Mixing: Add each grain to left/right buffers with appropriate panning gains. (5) Visualization: Plot particles in time‑pitch and time‑pan spaces, color‑coded by panning/amplitude.
Quick start
- In Praat, select exactly one Sound object (mono or stereo).
- Run script… →
additive_particle_field.praat. - Choose a Preset or select "Custom" to adjust all parameters manually.
- Adjust Particles parameters (number, grain duration, envelope shape).
- Set Panning mode and Fixed pan if using fixed panning.
- Optionally enable Apply_LFO and set its frequency.
- Choose Time distribution (how particles are spread over time).
- Enable Draw_visualization to see the particle field.
- Click OK — the particle‑based sound appears as "originalname_particles".
Granular & Particle Theory
Granular Synthesis Basics
The Sonic Particle
Each particle (grain) is defined by:
Why Sine Grains?
Sine waves are used because:
- Spectral purity: Each grain contributes a single frequency component
- Additive control: The sum of sine grains creates complex spectra
- Pitch tracking: Direct mapping from source pitch to grain frequency
- Computational efficiency: Sine evaluation is fast
Alternatives (not implemented): Saw/triangle waves (harmonic richness), filtered noise (textural), windowed source excerpts (granular sampling).
Parameter Extraction
Pitch Tracking
🎵 Pitch‑to‑Particle Mapping
Praat's Pitch object analyzes the source sound using an autocorrelation method.
For each particle at time t:
- Query pitch at time t (linear interpolation between frames)
- If pitch is undefined (unvoiced/noise), use defaultPitch (200 Hz)
- Clamp to minPitch (75 Hz) and maxPitch (600 Hz) for musical range
Result: Particles follow the melodic contour of the source.
Amplitude Determination
Two sources combined:
Spatialization (Panning)
Three Panning Modes
pan = (cos(2π × pitch/maxPitch) + 1) / 2
Low pitches → left, high pitches → right
Creates spectral spread across stereo field
2. Random panning:
pan = randomUniform(0, 1)
Each particle gets random stereo position
Creates diffuse, cloud‑like spatialization
3. Fixed panning:
pan = fixed_pan (0–1)
All particles at same stereo position
Useful for mono‑compatible effects
Pan‑to‑Gain Conversion
Time Distribution Strategies
Linear Distribution
Particles evenly spaced in time:
Exponential Distribution
More particles near the beginning:
Random Distribution
Uniform random timing:
LFO Modulation
Amplitude Modulation
Optional sine‑wave LFO:
LFO Applications
- Low frequency (0.1–0.5 Hz): Slow amplitude swells
- Medium frequency (1–4 Hz): Rhythmic pulsation
- High frequency (8–20 Hz): Tremolo/vibrato effects
Processing Pipeline
Preset Descriptions
Built‑in Presets
| Preset | Particles | Grain Duration | Envelope | Panning | LFO | Time Dist. | Character |
|---|---|---|---|---|---|---|---|
| Dense Cloud | 300 | 30 ms | Gaussian | Random | No | Random | Rich, diffuse texture |
| Sparse Field | 30 | 150 ms | Hann | Pitch‑derived | No | Linear | Articulated individual grains |
| Rhythmic Pulse | 80 | 40 ms | Rectangular | Fixed (center) | 4 Hz | Linear | Metronomic, rhythmic |
| Shimmer | 150 | 60 ms | Gaussian | Random | 0.25 Hz | Exponential | Slowly evolving, sparkling |
| Long Resonance | 15 | 800 ms | Hann | Pitch‑derived | 0.15 Hz | Exponential | Sustained, drone‑like |
☁️ Preset Deep Dive: Dense Cloud
Intended use: Create rich, granular textures from any source.
Parameters: 300 particles (dense), 30 ms grains (short), Gaussian envelope (smooth), random panning (diffuse), random timing (cloud‑like).
Result: The source sound is transformed into a shimmering particle cloud where individual grains blend into a continuous texture. Works well on speech, instruments, or noise.
🎯 Preset Deep Dive: Sparse Field
Intended use: Highlight individual grains for melodic/rhythmic clarity.
Parameters: 30 particles (sparse), 150 ms grains (long), Hann envelope (natural), pitch‑derived panning (spectral spread), linear timing (even spacing).
Result: Each particle is clearly audible, creating a pointillistic rendition of the source. Pitch contours remain recognizable; stereo field reflects pitch height.
✨ Preset Deep Dive: Shimmer
Intended use: Create evolving, sparkling textures with slow amplitude modulation.
Parameters: 150 particles (medium‑dense), 60 ms grains, Gaussian envelope, random panning, 0.25 Hz LFO (slow swell), exponential timing (dense→sparse).
Result: A slowly pulsating particle field that "shimmers" with amplitude variation. Exponential timing creates a natural decay feeling. Excellent for pad creation.
Parameters & Controls
Particle Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Number_of_particles | integer | 100 | Total number of grains (10–1000) |
| Grain_duration_s | real | 0.050 | Duration of each grain in seconds (0.005–2.0) |
| Envelope_shape | option | Hann | Grain window: Hann (smooth), Gaussian (softer), Rectangular (abrupt) |
Panning Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Panning_mode | option | Pitch‑derived | Spatial distribution: Pitch‑derived, Random, Fixed |
| Fixed_pan | real | 0.5 | When Panning_mode = Fixed, stereo position (0=left, 1=right) |
Modulation Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Apply_LFO | boolean | 0 | Enable amplitude modulation via LFO |
| LFO_frequency | real | 0.5 | LFO rate in Hz (0.05–20.0) |
Time Distribution Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Time_distribution | option | Linear | How particles are spread over time: Linear (even), Exponential (dense→sparse), Random (cloud) |
Output Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Draw_visualization | boolean | 1 | Draw particle field visualization after processing |
| Play_result | boolean | 1 | Play the result automatically |
⚙️ Parameter Interactions
Number_of_particles × Grain_duration_s: Determines density. Many short grains = cloud; few long grains = individual events.
Time_distribution × Apply_LFO: Exponential + LFO = natural decay with pulsation; Random + LFO = chaotic amplitude variation.
Panning_mode × Envelope_shape: Pitch‑derived + Hann = clear spectral stereo image; Random + Gaussian = diffuse spatial cloud.
Fixed ranges: Pitch clamped to 75–600 Hz (musical range); Panning limited to 0–1; Grain duration positive but typically 0.005–0.5 s.
Applications
Granular Texture Creation
Use case: Transform any sound into evolving granular textures for ambient music, sound design, or experimental composition.
Technique: Use Dense Cloud preset with 300–500 particles, random timing, Gaussian envelopes.
Example: Process a spoken word into a shimmering texture that retains phonetic contours but loses intelligibility.
Pointillistic Music
Use case: Create "particle‑based" arrangements where individual grains act as musical notes.
Technique: Use Sparse Field preset with 20–50 particles, linear timing, Hann envelopes.
Workflow:
- Process a melodic instrument recording
- Each grain becomes a "note" in a new arrangement
- Pitch‑derived panning creates stereo orchestration
- Export and sequence multiple instances
Rhythmic Processing
Use case: Add rhythmic pulsation or gating effects to sustained sounds.
Technique: Use Rhythmic Pulse preset with LFO enabled (4–8 Hz), rectangular envelopes, fixed panning.
Advantages:
- Creates rhythmic interest without tempo sync
- Amplitude modulation follows source dynamics
- Can be layered with dry signal for hybrid textures
Spectral Spatialization
Use case: Create immersive stereo or surround‑like effects from mono sources.
Technique: Use pitch‑derived panning with many particles (200+), random timing.
Example: Process a mono violin recording; high notes appear on right, low notes on left, creating a "virtual orchestra" effect.
Drone & Ambient Pad Generation
Use case: Generate sustained, evolving drones from short source sounds.
Technique: Use Long Resonance preset with very long grains (0.5–2.0 s), exponential timing, slow LFO.
Example: Process a 2‑second guitar note into a 30‑second drone with slowly shifting particle density and amplitude.
Practical Workflow Examples
🎵 Ambient Texture from Field Recording
Goal: Transform urban noise into ethereal ambient material.
Settings:
- Preset: Dense Cloud
- Adjust: Particles = 400, Grain duration = 0.02 s
- Add: LFO at 0.3 Hz for slow pulsation
- Time distribution: Random
Result: The noise becomes a shimmering, cloud‑like texture suitable for film backgrounds or music beds.
🎻 Virtual String Orchestra
Goal: Create ensemble‑like texture from solo violin.
Settings:
- Preset: Sparse Field
- Adjust: Particles = 60, Grain duration = 0.2 s
- Panning: Pitch‑derived
- Time distribution: Linear with slight randomness
Result: The solo violin expands into a chamber‑like texture with individual "players" spread across stereo field.
🔬 Scientific Sonification
Goal: Represent data as particle sound for auditory display.
Settings:
- Custom parameters
- Map data values to pitch (min/max frequency)
- Map time series to particle timing
- Use amplitude for data intensity
- Panning for categorical differentiation
Result: Multidimensional data becomes an audible particle field where patterns can be heard.
Advanced Techniques
- Dynamic particle count: Use a for-loop to process the same sound multiple times with increasing particle counts, then mix.
- Evolutionary textures: Start with Sparse Field, end with Dense Cloud by interpolating parameters over time.
- Spatial animation: Automate Fixed_pan from 0 to 1 over duration for moving particle clouds.
- Multi‑stage processing: Process sound → particle field → process again with different settings → layer results.
- Extreme values: 1000 particles × 0.005 s grains = "stochastic rain" texture.
- Contradictory settings: Linear timing + Random panning + LFO = rhythmic pattern with random spatial jumps.
- Minimalist: 5 particles × 2.0 s grains = sparse, meditative events.
- Hyper‑dense: 800 particles × 0.015 s grains = continuous granular mass.
Troubleshooting Common Issues
Cause: Source has low amplitude or pitch tracking fails (unvoiced/noisy).
Solution: Normalize source first; adjust minPitch/maxPitch; use defaultPitch for unvoiced sections.
Cause: Grain duration too short for pitch frequency (less than 2–3 cycles).
Solution: Increase grain_duration_s, especially for low pitches; use Gaussian envelope.
Cause: Too many particles and/or long grain duration creating many overlapping grains.
Solution: Reduce number_of_particles or grain_duration_s; disable visualization for speed.
Cause: Panning mode not matching material; all particles clustered or too diffuse.
Solution: Try different panning mode; adjust fixed_pan; combine with dry signal for anchor.
Technical Deep Dive
Particle Storage & Visualization
Data Structures
During synthesis, particle parameters are stored in arrays:
Visualization Algorithm
1. Waveform comparison:
Top: Original waveform (gray)
Bottom: Particle output (purple)
2. Time‑Pitch space:
X‑axis: Time (0–duration)
Y‑axis: Pitch (75–600 Hz)
Color: Blue→Red gradient based on panning
Dot size: Fixed
3. Time‑Pan space:
X‑axis: Time (0–duration)
Y‑axis: Panning (0=left, 1=right)
Color: Green→Yellow gradient based on amplitude
Horizontal line at 0.5 (center reference)
Optimization Strategies
Efficient Grain Synthesis
Instead of creating full‑length sounds for each grain:
Formula‑Based Mixing
Using Praat's Formula for buffer addition:
Mathematical Foundations
Envelope Functions
Three window functions implemented:
Exponential Time Distribution
The exponential mapping formula: