Granular Sampler — User Guide
Generates a granular synthesis texture by repeatedly sampling small segments (grains) from a source sound and layering them over time.
What this does
This Praat script performs granular synthesis by taking small, time-stretched slices (grains) from a selected source sound and distributing them across a new timeline. This technique can transform a simple sound into dense sonic clouds, rhythmic pulses, or shimmering textures.
The final stereo output is constructed by layering hundreds of short grains, each having its own unique properties derived from the script parameters (duration, panning, pitch shift, and amplitude modulation).
Presets
The script includes several presets that automatically set the synthesis parameters to achieve specific effects. When you select a preset, all other parameters in the form will be overridden internally before processing.
- Dense Cloud: High grain count, short duration, random distribution, and panning for thick, diffused textures.
- Sparse Field: Low grain count, long duration, linear distribution, and source-position panning for a delicate, scattered feel.
- Rhythmic Pulse: Rectangular envelope, fixed center panning, and a fast LFO for a noticeable amplitude pulsing effect.
- Shimmer: Higher grain count, Gaussian envelope, and random pitch variation for a metallic, swirling effect.
- Long Resonance: Very long grains, exponential time distribution, and moderate pitch variation for droning, sustained sounds.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
Granular Sampler.praat. - Select a Preset (e.g., Dense Cloud) or choose Custom to manually set all parameters.
- If using Custom, adjust the Number of Grains, Grain Duration, and Panning Mode.
- Click OK.
- The output object, named
Granular_mix, is created and plays automatically.
Parameters (form fields)
| Name (GUI) | Type | Default | Description |
|---|---|---|---|
| Preset | optionmenu | Custom | Selects a pre-defined set of parameters for common granular effects. Choosing this overrides manual settings. |
| numberOfGrains | integer | 100 | The total number of sound grains to synthesize and layer in the output sound. |
| grainDur | real | 0.050 | The duration (in seconds) of the segment sampled from the source sound for each grain. |
| envelopeShape | choice | Hann | The amplitude curve applied to the grain: Hann (smooth fade), Gaussian (bell-shaped), or Rectangular (hard edges). |
| applyPitchShift | boolean | 0 (unchecked) | If checked, pitch shifting is applied to the grains. |
| pitchShiftSemitones | real | 0.0 | The base pitch shift (in semitones, e.g., 12.0 for an octave up). |
| pitchVariation | real | 0.0 | The range (in semitones) for random pitch variation around the base shift (e.g., 5.0 for ±5 semitones). |
| panningMode | choice | Position-derived | How the stereo pan position is determined: Position-derived (pan corresponds to the source time), Random, or Fixed. |
| fixedPan | real | 0.5 | The pan position (0.0=Left, 1.0=Right) used when Panning Mode is set to Fixed. |
| applyLFO | boolean | 0 (unchecked) | If checked, a sine wave LFO modulates the amplitude of the grains over time. |
| lfoFrequency | real | 0.5 | The frequency (in Hz) of the LFO, controlling the speed of the amplitude pulsing. |
| timeDistribution | choice | Linear | How the grains are distributed across the output duration: Linear (evenly spaced), Exponential (more dense towards the end), or Random. |
| grainSource | choice | Sequential | How the grain's start position is chosen from the source sound: Sequential (progresses linearly through the source) or Random. |
| outputDuration | real | 0.0 | The length (in seconds) of the final output sound. Use 0.0 to match the duration of the input sound. |
Outputs
- Object name:
Granular_mix - Type: Sound (Stereo, 2 channels)
- Normalization: Peak-scaled to 0.99.
- Requirement: Requires a single selected Sound object to run.