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.
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.
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.
The three evolution modes
| Mode | Density | Pitch center | Pitch spread | Grain 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.
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.
| Preset | Duration | Density | Base / pitch evolution | Mode | Grains | Spread | Spatial |
|---|---|---|---|---|---|---|---|
| Low Cloud Growth | 6 s | 10 → 45/s | 80 Hz / 0 oct | Density Only | 45–120 ms | 0.22 oct | Mono |
| Rising Fine Sweep | 6 s | 7 → 32/s | 140 Hz / +1.1 oct | Pitch Sweep | 30–90 ms | 0.12 oct | Rotating Cloud |
| Dense Low Build | 8 s | 18 → 110/s | 95 Hz / 0 oct | Density Only | 15–55 ms | 0.28 oct | Stereo Evolution |
| Slow Wide Sweep | 10 s | 8 → 35/s | 60 Hz / +1.7 oct | Pitch Sweep | 60–160 ms | 0.20 oct | Rotating Cloud |
| Short-Grain Cascade | 5 s | 28 → 130/s | 170 Hz / +1.2 oct | Pitch Sweep | 8–35 ms | 0.25 oct | Wide Field |
| Broadening Bloom | 8 s | 12 → 55/s | 105 Hz / +0.55 oct | Distribution Morph | 30–110 ms | 0.08 → 0.55 oct | Stereo Evolution |
| High Digital Morph | 5 s | 30 → 95/s | 200 Hz / +0.8 oct | Distribution Morph | 7–32 ms | 0.12 → 0.70 oct | Wide Field |
| Narrow Rising Band | 6 s | 18 → 55/s | 130 Hz / +1.25 oct | Pitch Sweep | 25–70 ms | 0.08 oct | Mono |
| Dense Swarm | 5 s | 55 → 170/s | 150 Hz / +0.35 oct | Distribution Morph | 5–28 ms | 0.30 → 0.65 oct | Rotating Cloud |
Grain statistics and randomness
Enable Edit grain statistics to open the second compact page after preset application. It provides:
| Control | Baseline | Meaning |
|---|---|---|
| Min grain duration | 20 ms | Lower duration bound. |
| Max grain duration | 80 ms | Upper duration bound. |
| Initial pitch spread | 0.18 octaves SD | Standard deviation of the log-frequency offset at the beginning. |
| Final pitch spread | 0.45 octaves SD | End spread used only by Distribution Morph. |
| Random seed | 0 | 0 = unpredictable; positive integer = reproducible realization. |
| Edge fade | 0.02 s | Short 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)
| Mode | Pan model |
|---|---|
| Mono | One-channel output; pan metadata is centered but no stereo rendering occurs. |
| Stereo Evolution | Global left-to-right trajectory pan ≈ t/T plus random ±0.10 deviation, clipped to 0.02–0.98. |
| Rotating Cloud | Sinusoidal pan trajectory whose rotation rate rises from 0.06 to 0.24 Hz over the sound. |
| Wide Field | Each 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.
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.
| Property | Behavior |
|---|---|
| Duration | The requested/preset duration. |
| Sample rate | Direct synthesis at the selected Sample rate, 8–192 kHz. |
| Channels | Mono for Mono; stereo for the three spatial modes. |
| Edge fade | Linear fade-in/out, capped at 20% of total duration. |
| Normalize output | If enabled, every non-zero result receives target peak normalization to 0.90. |
| Output name | evolving_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
| Panel | What it shows |
|---|---|
| A — Event Density | Linear target intensity against actual binned Poisson density. |
| B — Actual Grain Field | Rendered 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 → Measurement | Measured spectrogram of a representative final-output channel with sampled actual grain-frequency guides overlaid. |
| D — Actual Pitch Statistics | Binned 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
- Roads, C. (2002). Microsound. MIT Press. A broad treatment of composition and synthesis with short sound particles, including granular techniques.
- Truax, B. (1988). “Real-Time Granular Synthesis with a Digital Signal Processor.” Computer Music Journal, 12(2), 14–26. DOI: 10.2307/3679938. A primary account of real-time granular synthesis and grain-based texture generation.