Granular Synthesis — Tiny Windows from a Buffer

A granular synthesiser repeatedly takes very small windows of audio from a buffer and plays them as individual grains. Once we control where those grains come from, how long they are and how they overlap, the buffer itself becomes an instrument.

Everything here comes from earlier pages: buffer position, start points, playback rate, reverse, windowing and overlap. Granular synthesis simply makes those operations happen many times per second.

1. Load a source buffer

Drag on the waveform to move the central grain position. With FREEZE off, the position scans through the buffer automatically. Amber blocks show recent grain windows.

Source—
Duration—
Position—
Active grains0

Pan spread: 0% keeps every grain in the centre. Increasing spread gives each new grain a random position across the stereo field.

2. Grain controls

Try: VOX → 40 ms grains → density 30 → scatter 5% → Hann → FREEZE. Move the position over different vowels/consonants and turn a fraction of a second into a sustained texture.

3. What each control does

Position
Where each grain begins.
Grain size
How much audio each window contains.
Density
How many grains trigger each second.
Scatter
Randomises start positions around the centre of the source buffer.
Pan spread
Randomises each grain across the stereo field. 0% = centre/mono; 100% = full left-to-right spread.
Pitch
Changes grain playback rate.
Direction
Forward, reverse or random.
Window
Shapes each grain's amplitude edges.
Freeze
Stops scanning while grains continue.

4. Windowing becomes audible

grain output = buffer samples × window
There is our multiply again. Hann and triangle fade 0 → 1 → 0. Rectangle stays at 1, preserving abrupt edges and making clicks/roughness easier to hear.

5. From fragments to a cloud

At low density you hear separate grains. Increase density and overlap and they merge into texture. Increase scatter and the engine samples a wider neighbourhood of the source. Increase pan spread and independent grains occupy a wider stereo field.

BUFFER → MANY START POSITIONS → WINDOW → PITCH / DIRECTION → OVERLAP + ADD → CLOUD
Granular synthesis is still buffer reading. The musical change comes from many short independent reads instead of one continuous playback head.

6. Why the source matters

Vocal material makes position and formant changes obvious; pizzicato exposes transients and boundaries; bell-like or tinkly material can become shimmering clouds very quickly.

The buffer does not know what it contains. Voice, instrument, chord, noise or phrase — it is all stored samples and read positions.

7. Sampling chapter recap

BUFFER → START/END → KEYSPAN → INTERPOLATION → TIME STRETCH → GRAINS

We began with a recording in memory and progressively gained more control over how it is read.

Now we are ready for DSP: underneath all of this we keep finding the same small operations — store, read, add, multiply, measure, compare and change values over time.