Analogique B: Stochastic Sound Mass Generator

Generates a mono electronic sound mass from independently evolving bands of filtered noise, with stochastic spectral and amplitude states, equal-power state transitions, reproducible random seeds, and a Xenakis-inspired control-field visualization.

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

What this does

The script synthesizes a sound mass from multiple independent noise layers. Each layer occupies a time-varying frequency band whose centre frequency, bandwidth, and amplitude evolve stochastically from one control state to the next. Adjacent states are joined with overlapping equal-power-compensated transitions, and the layers are mixed to a single mono output.

Relation to Analogique B: the audio engine uses continuous band-limited noise states controlled by bounded random walks. Its connection to Xenakis is conceptual and graphical: the stored control states are re-expressed in the visualization as frequency × control-level “screens,” a frequency-register transition matrix, and an ataxy measure. The matrix is calculated from the realized walk after synthesis; it does not generate the walk.

Signal path:

independent white-noise state → Hann band-pass filter → stochastic amplitude state → overlap-crossfade to next state → 1/√N layer sum → global edge fade → optional target-peak normalization

Quick start

  1. Run Analogique_B_Stochastic_Mass.praat. No input Sound is required.
  2. Choose a morphology preset or leave Custom.
  3. Set the duration and, for a custom mass, the number of layers, spectral range, drift, bandwidth variation, and amplitude turbulence.
  4. Set Random_seed to a positive integer when you want the stochastic realization to be repeatable; leave it at 0 for a new realization.
  5. Use Fast_mode when a coarser 2-second control grid is appropriate.
  6. Run the script. The finished Sound remains selected and can optionally be played and visualized.

Signal model

Control-state timing

ModeState durationNoise sourceState crossfade
Normal1.0 sGaussian white noise, σ = 0.5200 ms
Fast2.0 sUniform white noise in ±0.8660254, matched to variance 0.25400 ms

The random-walk step sizes are multiplied by √Δt, so changing the state duration changes temporal resolution while keeping the per-second diffusion scale comparable. Fast mode also uses the uniform white-noise generator shown above.

Initial layer states

State evolution

log f[n+1] = reflect(log f[n] + N(0, 0.10 × drift × √Δt)) BW[n+1] = reflect(BW[n] × exp(N(0, 0.08 × BW-variation × √Δt))) A[n+1] = reflect(A[n] + N(0, 0.10 × turbulence × √Δt))

Centre frequency is reflected between the requested spectral bounds. Bandwidth remains positive and is reflected within a state-dependent range from max(30 Hz, 0.10 × centre) to min(0.80 × Nyquist, 1.50 × centre). Amplitude is reflected between 0.05 and 1.00.

Filtering and transitions

For each state, the pass band is centred on the current frequency with the current bandwidth. The lower edge is kept at or above 20 Hz and the upper edge at or below 95% of Nyquist. The Hann-band transition width is 15% of pass-band width, constrained to 8–120 Hz.

Neighbouring noise states overlap. Before Praat performs Concatenate with overlap, the short overlap regions are compensated by

g(u) = √(2 / (1 + cos²(πu)))

so the complementary raised-cosine fades have approximately constant expected power for independent adjacent noise states. The overlap is therefore a genuine overlap-crossfade, not merely separate fade-in/fade-out envelopes.

Parameters

ParameterDefaultImplemented behavior
PresetCustomSelects one morphology preset. Presets override only the mass parameters listed in the Presets section.
Duration_minutes7.0Requested output duration in minutes.
Number_of_layers5Independent stochastic layers; accepted range is 1–32.
Min_frequency_Hz60Lower centre-frequency bound; values below 20 Hz are raised to 20 Hz.
Max_frequency_Hz8000Upper centre-frequency bound; capped at 90% of Nyquist. At 44.1 kHz this is 19,845 Hz.
Spectral_drift_rate0.3Scales Gaussian steps of the log-frequency walk. Must be non-negative; the script does not impose an upper limit.
Bandwidth_variation0.5Scales multiplicative log-bandwidth steps. Must be non-negative; no upper limit is imposed.
Amplitude_turbulence0.4Scales additive amplitude-walk steps. Must be non-negative; no upper limit is imposed.
Random_seed00 uses an unpredictable seed; a positive integer fixes the stochastic draws for repeatable synthesis.
Fast_modeOffUses 2-second control states and the matched-variance uniform noise source described above.
Normalize_outputOnIf the result is nonzero, Scale peak: 0.90 performs target peak normalization.
Figure_languageEnglishEnglish or French labels for the visualization.
Draw_visualizationOnDraws the control-field / measurement figure described below.
Play_resultOnPlays the completed Sound.
Workload guard: the script estimates layers × number of control states as filter calls and stops when this exceeds 50,000.

Presets

Presets change only Number_of_layers, Min_frequency_Hz, Max_frequency_Hz, Spectral_drift_rate, Bandwidth_variation, and Amplitude_turbulence. Duration, random seed, Fast mode, normalization, figure language, visualization, and playback remain as set in the form.

PresetLayersRange (Hz)DriftBW var.Turbulence
Balanced Mass560–80000.300.500.40
Slow Narrow Drift4120–50000.120.180.18
Migrating Bands580–80000.650.300.22
Turbulent Wide Cloud850–90000.450.850.75
Low Dark Mass640–22000.280.550.45
High Spectral Haze71500–95000.350.650.35
Sparse Streams3100–65000.350.150.30

Output & reproducibility

Random seed

A positive Random_seed fixes the stochastic initialization, noise generation, and random-walk updates. Seed 0 initializes unpredictably. After the stochastic DSP draws finish, the script restores Praat's global random generator to unpredictable operation.

The dots used in the screen visualization are positioned by a deterministic hash of screen, cell, and dot index rather than by additional random draws, so drawing the figure does not consume or alter the synthesis random stream.

Visualization

The figure can be labelled in English or French. Panels I–IV are derived from the recorded control-state history; Panel V is an acoustic measurement of the generated Sound.

I — The Book of Screens

Up to ten control states sampled across the piece are re-plotted as 8 logarithmic frequency cells × 5 control-level cells. Dot count represents each cell's share of model energy. These dots visualize the recorded filter-band/amplitude state rather than individual synthesized grains.

II — One Screen

The middle control state is enlarged. F is logarithmic frequency. G is the layer amplitude control converted with 20·log10(amplitude); it is a control-level scale, not measured dB SPL or RMS.

III — Frequency-Register Transition Matrix

The script divides the log-frequency span into six registers and counts how each layer's centre frequency moves between adjacent control states. Each row is normalized by its observed transition count, and the row's n is printed beside it. The matrix therefore describes this realized random walk. Its diagonal mass is reported as the frequency-register self-transition probability.

IV — Spectral Ataxy

For each control state, energy is accumulated over eight frequency cells and converted to normalized Shannon entropy:

ataxy = −Σ pᵢ ln(pᵢ) / ln(8)

0 means the control-field energy is concentrated in one frequency cell; 1 means it is evenly spread across all eight. This is the entropy of the frequency marginal only.

V — The Sound Itself

A measured spectrogram of the final mono Sound is drawn with the actual centre-frequency control paths overlaid. This panel anchors the control-domain description to the audio that was produced.

The summary strip reports realized centre-frequency, bandwidth and amplitude ranges, boundary reflections, control parameters, crossfade duration, register self-transition, number of filter states, output peak/RMS, and normalization state.

Historical context

Iannis Xenakis composed Analogique A et B in 1958–1959 for nine string instruments and tape; Analogique B is the tape component. Xenakis's original work used short sinusoidal sound grains organized as evolving “screens” and employed Markovian stochastic procedures to control the succession of states.

This AudioTools generator takes the historical idea as a compositional reference while using a different synthesis mechanism: stochastic, continuously filtered noise bands whose states are later mapped into screen-like coordinates for analysis and visualization.

Further Reading