Granular Sampler — User Guide

Generates a granular synthesis texture by repeatedly sampling small segments (grains) from a source sound and layering them over time.

Category: Synthesis / Granular Praat Script: Granular Sampler.praat
Contents:

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.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…Granular Sampler.praat.
  3. Select a Preset (e.g., Dense Cloud) or choose Custom to manually set all parameters.
  4. If using Custom, adjust the Number of Grains, Grain Duration, and Panning Mode.
  5. Click OK.
  6. The output object, named Granular_mix, is created and plays automatically.

Parameters (form fields)

Name (GUI)TypeDefaultDescription
PresetoptionmenuCustomSelects a pre-defined set of parameters for common granular effects. Choosing this overrides manual settings.
numberOfGrainsinteger100The total number of sound grains to synthesize and layer in the output sound.
grainDurreal0.050The duration (in seconds) of the segment sampled from the source sound for each grain.
envelopeShapechoiceHannThe amplitude curve applied to the grain: Hann (smooth fade), Gaussian (bell-shaped), or Rectangular (hard edges).
applyPitchShiftboolean0 (unchecked)If checked, pitch shifting is applied to the grains.
pitchShiftSemitonesreal0.0The base pitch shift (in semitones, e.g., 12.0 for an octave up).
pitchVariationreal0.0The range (in semitones) for random pitch variation around the base shift (e.g., 5.0 for ±5 semitones).
panningModechoicePosition-derivedHow the stereo pan position is determined: Position-derived (pan corresponds to the source time), Random, or Fixed.
fixedPanreal0.5The pan position (0.0=Left, 1.0=Right) used when Panning Mode is set to Fixed.
applyLFOboolean0 (unchecked)If checked, a sine wave LFO modulates the amplitude of the grains over time.
lfoFrequencyreal0.5The frequency (in Hz) of the LFO, controlling the speed of the amplitude pulsing.
timeDistributionchoiceLinearHow the grains are distributed across the output duration: Linear (evenly spaced), Exponential (more dense towards the end), or Random.
grainSourcechoiceSequentialHow the grain's start position is chosen from the source sound: Sequential (progresses linearly through the source) or Random.
outputDurationreal0.0The length (in seconds) of the final output sound. Use 0.0 to match the duration of the input sound.

Outputs