Evolving Grain Mass — User Guide

An evolving stochastic granular synthesizer. Grain onsets follow a time-varying Poisson event field; the selected evolution mode then controls whether only density changes, whether the pitch center also sweeps, or whether pitch spread and grain duration morph as well.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4 (2026) License: MIT License Repo: Praat AudioTools
Contents:

What this does

Evolving Grain Mass builds a cloud from many short sine-wave grains. The grains do not sit on a fixed grid: their onset times are stochastic, their frequencies are sampled in log-frequency space, their phases are random, and each grain has a Hann envelope.

Signal process:
time-varying event density → Poisson onset times → evolving pitch statistics → Hann-windowed grains → grain-level spatialization → short edge fade → optional peak normalization

The important distinction is between event density and spectral evolution. Initial Density and Final Density always control how frequently grains are expected to occur. The three Evolution modes then decide what else changes over time.

This is best described as a stochastic granular mass. It is not a breakpoint-based dynamic-stochastic waveform generator: the stochastic process here schedules and parameterizes grains.

Event density: target versus realization

The requested grain rate changes linearly from Initial density to Final density over the duration:

lambda(t) = d0 + (d1 - d0) * t / T

This is the target intensity in grains per second, not a deterministic event count. Onsets are generated as a genuine inhomogeneous Poisson process. The expected total number of grains is:

expected grains = T * (d0 + d1) / 2

The actual number is random and normally differs from that expectation. The visualization therefore shows both the target density line and the realized event density measured in time bins.

Density is not used as a loudness envelope. Per-grain amplitude is reduced according to expected local overlap. Higher density therefore mainly increases occupancy and texture thickness rather than simply making the output louder.

The three evolution modes

ModeDensityPitch centerPitch spreadGrain duration
Density Only Moves from Initial to Final density Fixed at Base frequency Fixed at Initial pitch spread Uniform random between Min and Max duration
Density + Pitch Sweep Moves from Initial to Final density Moves exponentially in octave space Fixed at Initial pitch spread Uniform random between Min and Max duration
Density + Distribution Morph Moves from Initial to Final density Moves exponentially in octave space Morphs continuously from Initial to Final spread Distribution moves continuously from longer toward shorter grains

Pitch-center trajectory

Modes 2 and 3 interpret Pitch evolution directly in octaves:

center(t) = BaseFrequency * 2^(PitchEvolutionOctaves * t / T)

For example, +1 means one octave upward by the end, -1 means one octave downward, and 0 keeps the center frequency stationary.

Distribution Morph

Mode 3 changes more than the center frequency. Its pitch spread moves linearly from the Initial to the Final pitch-spread value. At the same time, the center of the grain-duration distribution moves from the maximum duration toward the minimum duration. Each grain receives additional random duration variation around that moving center, then is clipped to the user-defined Min/Max limits.

In modes 1 and 2, Final pitch spread is not used; the pitch spread remains at Initial pitch spread for the whole sound.

Presets

Each non-Custom preset is a complete configuration: it overrides Duration, densities, Base frequency, Pitch evolution, Evolution mode, grain-duration range, pitch spread, and Spatial mode. Sample rate, random seed, edge fade, normalization, visualization, and playback are not preset-specific.

PresetDurationDensityBase / pitch evolutionModeGrainsSpreadSpatial
Low Cloud Growth6 s10 → 45/s80 Hz / 0 octDensity Only45–120 ms0.22 octMono
Rising Fine Sweep6 s7 → 32/s140 Hz / +1.1 octPitch Sweep30–90 ms0.12 octRotating Cloud
Dense Low Build8 s18 → 110/s95 Hz / 0 octDensity Only15–55 ms0.28 octStereo Evolution
Slow Wide Sweep10 s8 → 35/s60 Hz / +1.7 octPitch Sweep60–160 ms0.20 octRotating Cloud
Short-Grain Cascade5 s28 → 130/s170 Hz / +1.2 octPitch Sweep8–35 ms0.25 octWide Field
Broadening Bloom8 s12 → 55/s105 Hz / +0.55 octDistribution Morph30–110 ms0.08 → 0.55 octStereo Evolution
High Digital Morph5 s30 → 95/s200 Hz / +0.8 octDistribution Morph7–32 ms0.12 → 0.70 octWide Field
Narrow Rising Band6 s18 → 55/s130 Hz / +1.25 octPitch Sweep25–70 ms0.08 octMono
Dense Swarm5 s55 → 170/s150 Hz / +0.35 octDistribution Morph5–28 ms0.30 → 0.65 octRotating Cloud
Because the presets explicitly set Spatial mode, the Spatial-mode choice in the main form is retained only for Custom. The same applies to the main synthesis parameters that a preset overrides.

Grain statistics and randomness

Enable Edit grain statistics to open the second compact page after preset application. It provides:

ControlBaselineMeaning
Min grain duration20 msLower duration bound.
Max grain duration80 msUpper duration bound.
Initial pitch spread0.18 octaves SDStandard deviation of the log-frequency offset at the beginning.
Final pitch spread0.45 octaves SDEnd spread used only by Distribution Morph.
Random seed00 = unpredictable; positive integer = reproducible realization.
Edge fade0.02 sShort global protection fade at the two outer edges.

Frequency draw

Each grain frequency is drawn in octave space, not directly in Hz:

z = clipped Gaussian(0,1), limited to ±2.5
frequency = center * 2^(spreadOctaves * z)

This means the distribution is symmetric around the center in log-frequency space. The script uses a practical upper limit of 0.45 × sample rate and a lower limit of 20 Hz. It also reduces Base frequency in advance when the requested upward trajectory plus maximum spread would otherwise exceed practical sampling headroom.

Grain waveform

Every grain is a sinusoid with a random starting phase and a full Hann envelope:

grain = amplitude
      * sin(2*pi*frequency*age + phase)
      * 0.5*(1 - cos(2*pi*age/duration))

A grain beginning near the end of the requested duration is shortened so that the final Sound keeps the requested overall duration.

Spatial modes

Stereo positioning happens per grain. For stereo modes, a pan value from 0 to 1 is converted to equal-power gains:

left  = cos(pi/2 * pan)
right = sin(pi/2 * pan)
ModePan model
MonoOne-channel output; pan metadata is centered but no stereo rendering occurs.
Stereo EvolutionGlobal left-to-right trajectory pan ≈ t/T plus random ±0.10 deviation, clipped to 0.02–0.98.
Rotating CloudSinusoidal pan trajectory whose rotation rate rises from 0.06 to 0.24 Hz over the sound.
Wide FieldEach grain is placed randomly near one edge: 0.03–0.25 or 0.75–0.97.

There is no post-mix complementary filtering or synthetic stereo widening stage: the stereo image comes directly from grain positions.

Rendering, chunking, and output

The stochastic event list is generated once in chronological order. Rendering then uses local chunks of at most 1 second to keep Praat formulas manageable.

A grain that crosses a chunk boundary is not restarted or truncated at that boundary. The next chunk evaluates the same grain using its original onset-relative age, duration, frequency, phase, and Hann envelope. The chunks are therefore only a rendering strategy, not a change to the musical timeline.

The script does not silently discard grains when a chunk becomes dense. If more than 400 grain terms would be required in one one-second chunk, it stops with an explicit message asking for lower density or shorter grains.

PropertyBehavior
DurationThe requested/preset duration.
Sample rateDirect synthesis at the selected Sample rate, 8–192 kHz.
ChannelsMono for Mono; stereo for the three spatial modes.
Edge fadeLinear fade-in/out, capped at 20% of total duration.
Normalize outputIf enabled, every non-zero result receives target peak normalization to 0.90.
Output nameevolving_grain_mass_<preset>.

The Info window reports expected versus actual grain count, realized mean density, realized frequency range, mean grain duration, pre/post-normalization levels, maximum terms used by any one-second chunk, and any low/high-frequency corrections.

Visualization and QC

PanelWhat it shows
A — Event DensityLinear target intensity against actual binned Poisson density.
B — Actual Grain FieldRendered grain onset-to-end segments on a log-frequency axis. In stereo modes, colour indicates broad pan region. The target pitch-center trajectory is overlaid.
C — Model → MeasurementMeasured spectrogram of a representative final-output channel with sampled actual grain-frequency guides overlaid.
D — Actual Pitch StatisticsBinned geometric mean frequency with ±1 log-standard-deviation bars, compared with the target pitch center.

For stereo output, the representative channel used for the measured spectrogram is whichever channel has the higher whole-file RMS. The QC strip summarizes expected/actual events, seed state, realized frequency and duration statistics, spatial mode, and output levels.

Further Reading