Chaotic Granular Synthesis — User Guide

A from-scratch granular synthesizer in which deterministic nonlinear systems control the timing, duration, frequency, amplitude, and spatial position of Hann-windowed sine grains.

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

What this does

Chaotic Granular Synthesis creates a new sound; it does not require or granulate an input Sound. Every grain is a sine oscillator shaped by a Hann envelope. A Logistic map, Hénon map, or Lorenz system supplies bounded control values that determine when grains occur and how each grain is rendered.

The central idea: the nonlinear system is not merely a frequency modulator. Its evolving state controls inter-onset interval/local density, grain duration, carrier frequency, amplitude, and pan. The result is a deterministic nonlinear grain schedule once the initial state has been chosen.

The script renders one to eight layers. Each layer follows the same selected dynamical law but begins from its own initial condition. A small fixed octave offset separates layers spectrally. The layers are then summed, optionally rendered in stereo, faded at the outer edges, and optionally normalized.

Quick start

  1. Run Chaotic Granular Synthesis.praat. No input Sound is required.
  2. Choose Custom, Logistic Sparse, Henon Texture, or Lorenz Atmospheric.
  3. For Custom, set duration, sample rate, base frequency, density, number of layers, grain-duration range, and frequency span.
  4. Choose the nonlinear system and decide whether its initial state should be randomized.
  5. Choose Mono or Stereo Wide, then set the edge fade, normalization, visualization, and playback options.
  6. The result remains in the Objects window as chaotic_granular_<preset>.
Useful first comparison: run the same preset twice with Randomize initial state off. The schedule should be identical. Then turn it on with seed 0 to hear how a new initial condition changes the trajectory while leaving the governing law itself unchanged.

How the synthesis works

NONLINEAR STATE → five bounded controls → grain schedule → Hann-windowed sine grains → exact chunk continuation → layer sum → optional normalization

1. The state becomes five controls

For every grain the selected system produces five values in the range 0–1: mFreq, mDur, mAmp, mDensity, and mPan. The exact extraction differs between Logistic, Hénon, and Lorenz, but the downstream mappings are shared.

2. Timing is chaos-controlled

The local density is

local density = nominal density × (0.55 + 0.90 × mDensity)
inter-onset interval = 1 / local density

Thus the requested density is a center value rather than a fixed event rate. Depending on the trajectory, instantaneous density spans approximately 0.55× to 1.45× the nominal value. The first event is placed at half of its first interval; later events advance by the current interval.

3. Duration, frequency, amplitude, phase, and pan

duration = minDuration + (maxDuration − minDuration) × mDur

frequency = base × 2^(layerOffset + spanOctaves × (mFreq − 0.5))
layerOffset = 0.18 octave × (layer − 1)

amplitude = baseGrainAmplitude × (0.45 + 0.55 × mAmp)
phase = 2π × mPan

Frequency is mapped logarithmically in octaves around the base frequency. The amplitude base value compensates approximately for expected grain overlap and the number of layers, so increasing density or layers is less likely to become an accidental gain control.

4. Each event is a true Hann grain

grain(age) = A × sin(2π f × age + phase) × 0.5(1 − cos(2π × age / duration))

Here age is time since the grain onset. This matters at internal chunk boundaries: the oscillator phase and Hann envelope continue from the same grain age instead of restarting.

Nonlinear systems

Logistic Map

x[n+1] = 3.97 × x[n] × (1 − x[n]). After a 250-iteration burn-in, each grain consumes five successive map states: frequency, duration, amplitude, density, and pan. The governing parameter r is fixed at 3.97; randomization changes the initial state, not the law.

Hénon Map

x[n+1] = 1 − 1.4x[n]^2 + y[n], y[n+1] = 0.3x[n], with a 600-iteration burn-in. The first new state supplies frequency and duration, the second amplitude and density, and the third pan. The state is mapped into bounded 0–1 controls; the underlying map itself is not hard-clamped.

Lorenz System

Uses the classical parameters σ=10, ρ=28, β=8/3 with explicit Euler integration at dt = 0.005. After a 4000-step burn-in, eight integration substeps lead to the state used for frequency, duration, and amplitude; another eight lead to density and pan. Logistic functions map the unbounded state coordinates smoothly into 0–1 controls.

Chaos and randomness are separate here. The Logistic, Hénon, and Lorenz evolutions are deterministic. Random numbers are used only when Randomize initial state is enabled, to choose the starting state before burn-in.

Parameters

GUI fieldDefaultWhat it controls
PresetCustomLoads one of three predefined configurations or leaves the form values unchanged.
Duration_s10Exact output duration in seconds.
Sample_rate_Hz44100Output sampling rate; accepted range 8000–192000 Hz.
Base_frequency_Hz120Center of the octave-based frequency mapping. It may be reduced automatically for Nyquist safety.
Grain_density_grains_per_s8Nominal density per layer. The nonlinear density control moves locally between about 0.55× and 1.45× this value.
Number_of_layers3Parallel nonlinear grain layers; allowed range 1–8.
Min_grain_duration_ms60Lower end of the chaos-controlled Hann-grain duration range.
Max_grain_duration_ms220Upper end; limited to 2000 ms and must be ≥ the minimum.
Frequency_span_octaves2.5Total logarithmic span around the base frequency; allowed range >0 to 8 octaves.
Synthesis_modeLogistic MapChooses Logistic, Hénon, or Lorenz control dynamics.
Randomize_initial_stateyesChooses whether each layer starts from a random or fixed deterministic initial condition.
Random_seed0With randomized initial states: positive = reproducible; 0 = unpredictable.
Spatial_modeMonoMono sum or per-grain equal-power stereo panning.
Edge_fade_s0.05Linear fade applied only to the outer edges of the completed output; capped at 49% of total duration.
Normalize_outputyesIf non-silent, target peak normalization to 0.90.
Draw_visualizationyesDraws the four-part control/measurement figure.
Play_afteryesPlays the final Sound after generation.

Presets

PresetMain values loaded
Logistic Sparse10 s, 44.1 kHz, base 120 Hz, density 7, 3 layers, 55–180 ms grains, 2.5-octave span, Logistic, Mono, 0.05 s edge fade.
Henon Texture12 s, 44.1 kHz, base 100 Hz, density 8, 4 layers, 70–240 ms grains, 3-octave span, Hénon, Stereo Wide, 0.05 s edge fade.
Lorenz Atmospheric15 s, 44.1 kHz, base 80 Hz, density 6, 3 layers, 110–360 ms grains, 3.5-octave span, Lorenz, Stereo Wide, 0.08 s edge fade.

The presets do not override Randomize_initial_state, Random_seed, Normalize_output, Draw_visualization, or Play_after; those retain the current form values.

Chunk continuity

The current engine uses synthesis chunks of at most 1 second. Chunking is only an implementation strategy for keeping Praat formula sizes manageable; it does not quantize the nonlinear schedule or shorten a grain.

A grain crossing a chunk boundary is rendered on both sides of that boundary. Its onset is converted to a local chunk coordinate, but the formula still evaluates the same global grain age. Therefore the sine phase and Hann envelope continue seamlessly. Ordinary concatenation of the rendered chunks is sufficient; there is no chunk crossfade.

The script no longer discards grains because a chunk is “full.” Instead it stops with an explicit message if more than 180 overlapping grain terms would be required in one layer/chunk. A separate workload guard rejects settings estimated to exceed 6000 grains.

Spatial rendering & reproducibility

Mono

All layers are summed into one channel. The chaos-derived mPan value still supplies the grain's initial oscillator phase, but no spatial panning is performed.

Stereo Wide

Every grain is placed independently with equal-power gains:

left = cos(π/2 × pan)
right = sin(π/2 × pan)

There is no complementary EQ, injected noise, Haas delay, or post-hoc widening stage. Stereo structure comes directly from the nonlinear grain control.

Initial state and seed

With Randomize initial state = off, each layer uses a deterministic layer-dependent starting state and the seed has no effect. With randomization on, a positive seed reproduces the initial states exactly; seed 0 leaves them unpredictable. After fixed-seed synthesis, the script returns Praat's RNG to an unpredictable state.

Visualization: quantum → law → statistics → sound

The current visualization deliberately separates control-domain plots from the measured acoustic output.

PanelWhat is drawn
I — The Information DiagramEvery actually scheduled grain is shown in the linear time–frequency plane. Rectangle width is the grain duration; height is 1.5 / duration, the equivalent noise bandwidth of a Hann window. Amplitude controls the shade. This is a Gabor-inspired information-plane visualization; the Hann ENBW cell is not claimed to be Gabor's Gaussian minimum-uncertainty cell.
II — The Dynamical LawLogistic mode shows a bifurcation diagram with the operating r = 3.97. Hénon and Lorenz show a long attractor re-run with the layer-1 states that actually drove the synthesis marked on top. A Lyapunov exponent is estimated from a separate long run of the law, not from the short musical trajectory.
III — The Invariant MeasureUpper plot: histogram of the realized layer-1 state coordinate with a long-run density of the same law overlaid. Lower plot: histogram of the frequencies of all rendered grains, showing the audible consequence of the state distribution.
IV — The Sound ItselfA measured spectrogram of the final rendered Sound. This is the only panel that directly measures the acoustic result.
The Lorenz Lyapunov value is reported for the Euler-discretized system as implemented at dt=0.005, rather than presented as the exact exponent of the ideal continuous differential equations.

Output & safeguards

Further Reading