DDSS instrument audio off
Drone
Paper companion ↓
Particles · Fig. 6
Buffer samples
Spectrum
Solution paths rk(t) (Fig. 5)
OctaveC3
Keys A–K play · Z/X octave
Interactive companion · Computer Music Journal 45:2

Diffusion Dynamic
Stochastic Synthesis

Emilio L. Rojas & Rodrigo F. Cádiz. “A Physically Inspired Implementation of Xenakis’s Stochastic Synthesis: Diffusion Dynamic Stochastic Synthesis.” Computer Music Journal 45(2): 48–66, Summer 2021. doi:10.1162/COMJ_a_00606

01 · BackgroundXenakis’s Dynamic Stochastic Synthesis

DSS, formalized by Xenakis (1992) and realized in his program Gendyn for “Gendy3” (1991) and “S709” (1994), builds a waveform from a handful of breakpoints joined by straight lines. The waveform repeats at audio rate, and at every repetition each breakpoint takes a random step in amplitude and in time, held inside elastic barriers. The sound is the trace of a Brownian walk carried out directly on the waveform: microcomposition, sample by sample.

The paper summarizes the procedure in nine steps, following Luque (2006):

1Choose a number of breakpoints n.
2Choose a frequency range νmin–νmax and translate it to durations in samples, smin = SR/νmax, smax = SR/νmin.
3Temporal barriers per breakpoint: θmin = smin/n, θmax = smax/n.
4–5Choose a probability distribution for the random walk of the time values and an initial value for each.
6–8Choose amplitude barriers, a distribution for the amplitude random walk and initial amplitudes.
9Join the breakpoints by linear interpolation to obtain the waveform.

The figure on the right runs these steps for five moving breakpoints plus two fixed at zero, as in Figure 1 of the article. In the instrument above, the engine DSS · classic implements the full nine steps (time and amplitude walks, mirrors at the barriers); DSS · same seed is the simplified, amplitude-only version the authors built for the comparison in Figure 7 and 8.

After Figure 1. The current cycle in ink, the three previous cycles fading behind it. Each click moves every inner breakpoint once in amplitude (barriers at ±1) and in time (barriers θmin, θmax), then re-joins the dots.

02 · PhysicsDiffusion and the d-dimensional Bessel process

A drop of ink in water spreads until the color is uniform. The probability density p(r, t) of finding one ink particle at position r obeys the diffusion equation with diffusivity D:

∂p∂t=D∇2p(r,t)(1)

At the level of a single particle, collisions produce a drag and random kicks, written as a Langevin equation and, in Itô form, as a stochastic differential equation driven by a Wiener process W(t):

mdvdt=−γv(t)+η(t)dx=a(x,t)dt+b(x,t)dW(t)(2), (4)

Itô’s formula links any SDE dx = f(x)dt + g(x)dW to a Fokker–Planck equation for its density:

∂p∂t=−∂∂x[f(x)p]+12∂2∂x2[g2(x)p](11)

Starting from an impulse at the origin, Equation 1 has the Gaussian solution below. Integrating over all angles in d dimensions (surface Sd = 2πd/2/Γ(d/2)) gives the density ρ(r, t) of the radial distance, which satisfies its own Fokker–Planck equation:

p(r,t)=1(4πDt)d/2e−r2/4Dt∂ρ∂t=−∂∂r[D(d−1)rρ]+D∂2ρ∂r2(12), (18)

Reading Equation 18 against Equation 11 gives the SDE at the heart of DDSS, the d-dimensional Bessel process:

dr=D(d−1)rdt⏟drift+2DdW(t)⏟Brownian(19)

The drift pushes the particle away from the origin, so the paths share a direction that pure Brownian motion lacks. It is solved with the Euler–Maruyama scheme (Higham 2001), with ΔWj drawn from a normal distribution of variance Δt:

rj+1=rj+D(d−1)rjΔt+2DΔWj

Two parameters, D and the dimension d, set the strength of the drift. The article lists control over both as future work for the synthesizer; here they are live in the Diffusion panel of the instrument.

After Figures 3 and 4. Top: one Brownian path r0 + √(2D) W(t) (dashed) and the solution of Equation 19 driven by exactly the same noise (solid). Bottom: the mean of many solutions (solid), five individual solutions (thin), and the reference √(r0² + 2dDt), which is the exact root-mean-square radius of d-dimensional diffusion. 1,500 steps over t ∈ [0, 1]; the paper’s Figure 3 uses D = 1 and d = 3.

03 · MethodFrom particles to a waveform

DDSS solves Equation 19 for n particles in two dimensions (d = 2, D = 1, 1,500 steps each). Each solution rk(t) is one breakpoint. Values over 1 or under −1 by an amount m are reflected back by m, a mirror that plays the role of Xenakis’s elastic barriers. Each particle gets an angle

φk=(k−1)2πn,k=1,…,n(20)

so that x = r cos φ and y = r sin φ. The y coordinate is the breakpoint’s amplitude; x, scaled by 0.1, makes the amplitude oscillate around y. Two extra breakpoints fixed at zero close the cycle, and four interpolated samples between neighbors fill a buffer of

s=5(n+2)−4(21)

samples: 186 for the paper’s 36 particles. A phasor reads the buffer at the pitch ν, and at the end of each cycle the next step of every solution is mapped into the buffer.

1Generate n solutions of Equation 19; reflect values beyond ±1.
2Assign the angle φk to each solution (Equation 20).
3Split the current step of each solution into x and y.
4y is the amplitude; x, scaled down, is the depth of an oscillation around y.
5Interpolate the breakpoints linearly into the buffer.
6–7Read the buffer at ν; at each cycle’s end repeat steps 2–5 with the next step. (Waveform approach: phasor at ν. Spectral approach: buffer values drive an oscillator bank.)
The angle span is a waveshaper. Equation 20 spreads the angles over 2π, but the comparison section of the paper describes 36 angles “from 0 to 35π/36”, a half circle. Since y = r sin φ, the angles impose a sinusoidal envelope on the breakpoints: one full period across the buffer for 2π, one positive lobe for π. This is why DDSS has a much stronger fundamental than DSS, and the authors suggest it as a new kind of waveshaping. Try the Angle span control in the Mapping panel.
Mapping, step by step. Left: each solution as a radius on its own angle, with the unit circle where values are reflected. Right: the projections yk become breakpoints (dots) and the buffer (stems), framed by the two zeros. The thin curve is sin φ, the envelope imposed by the angles. Uses the paths simulated in the instrument.

04 · VariationThe spectral approach

The same buffer can describe a spectrum instead of a waveform. Its s samples, taken in absolute value, become the amplitudes of s sinusoidal oscillators spread over a range νmin–νmax with separation

νs=νmax−νmins,νi=νi−1+νs(22), (23)

The authors acknowledge that this goes against Xenakis’s rejection of Fourier synthesis (“portions of circles” for a mountain silhouette), but it yields rich timbres: additive-sounding with wide ranges, closer to small-window granular synthesis with narrow ones, always with a slow amplitude modulation because the oscillator amplitudes keep diffusing.

In the synthesizer, the key played sets the separation νs, so a chord maps the same shape onto several harmonic series at once. The Spectral panel also offers a fixed range mode (transposed by the key relative to A3) and an offset that makes the series inharmonic.

Listen in the instrument. Choose a preset, then hold a key or the drone. The buffer pane shows the oscillator amplitudes; the spectrum pane shows them laid out in frequency.

05 · AnalysisWhy the spectral peaks are (n+1)ν apart

Spectra of DSS and DDSS at the same fundamental share the same roll-off and, strikingly, the same peaks and valleys. With 38 breakpoints the peaks sit about 37ν apart (1,120 Hz at 30 Hz, 1,870 Hz at 50 Hz, 2,990 Hz at 80 Hz), and about 18ν apart with 19 breakpoints.

To explain it, the authors build a period T from N equal triangles with random heights Cn, which has 2N + 1 breakpoints:

f(t)=∑n=1NCnΛ(t−(2n−1)T/2NT/2N)(24)

Its Fourier transform is a random phasor sum multiplied by a fixed envelope:

F(ω)=∑n=1NCne−2πi(2n−1)ωT/2NSinc2Tω2N(26)

The Sinc² envelope vanishes at regular intervals whatever the heights are, so the valleys, and the peaks between them, are spaced by

Δu=2Nν(30)

that is, the number of breakpoints minus one, times the fundamental.

A slightly more general reading. Any piecewise-linear cycle whose B breakpoints are equally spaced is a sum of hat functions of half-width T/(B − 1), one per breakpoint. Its spectrum is therefore always enveloped by Sinc² with zeros at multiples of (B − 1)ν, for DSS and DDSS alike, which is why the two spectra share their valleys. For DDSS, B = n + 2 and the spacing is (n + 1)ν: 37ν with 36 particles. The instrument marks these frequencies on its spectrum. (Classic DSS, whose breakpoints wander in time, blurs them.)
After Figures 9 and 10. Top: one realization of Equation 24. Bottom: mean |F| of the realizations (linear scale), computed exactly from Equation 26; dashed lines mark multiples of 2Nν. Faint stems show the harmonics kν where a periodic repetition of the cycle samples this envelope. With N = 17 and ν = 30 Hz the spacing is 1,020 Hz, as in Figure 10b.

06 · ResultsThe original recordings, compared

These are the demonstration files from the Max implementation, rendered with the same seed paths for both methods (the simplified DSS changes amplitudes only, so the comparison is direct). Each plot is the average magnitude spectrum of the whole file, on a linear scale like Figure 8; dashed lines mark multiples of 37ν.

Listen for the stronger fundamental and the darker tone of DDSS, which the paper traces to the smoother, sinusoidally enveloped waveform produced by the circular arrangement of angles. Both recordings start almost silent, because every path begins at the origin and has to diffuse outward.

DDSS DSS (same seed) (n+1)ν = 37ν

07 · About this pageImplementation notes

Everything here runs in the browser, in a single self-contained file. The synthesizer is an AudioWorklet that follows the article’s Max implementation in spirit; the simulation is regenerated from a seed, so every experiment is repeatable, as the authors stress. Where the article leaves a detail open, this page makes the following choices:

  • Initial radius. Paths start at r0 = 0, as in Figure 6a and the recordings (both start near silence). Figures 3 and 4 start at r0 = 1; section 02 uses that value. At r = 0 the drift is singular, so it is evaluated with r no smaller than √(2DΔt), and a negative radius is reflected at the origin.
  • Time scale. t ∈ [0, T] with T = 1 and 1,500 steps, so Δt = 1/1499, matching the axes of Figures 3 and 4. One step is read per waveform cycle, which matches the length of the recordings (1,000 cycles at 50, 80 and 150 Hz).
  • Reflection. The radius is reflected into [−1, 1] before the polar projection, repeatedly if needed, so a large radius can fold through zero and flip the sign of a breakpoint.
  • The x modulation. The amplitude of breakpoint k is yk + 0.1 · xk · sin(2π fLFO t). The article does not state the oscillation’s rate; it is a control here (default 4 Hz).
  • DSS with the same seed. Breakpoint amplitudes are the reflected Brownian seed paths r0 + √(2D) Wk(t), using the very increments that drive the Bessel solutions.
  • Spectral approach. Oscillator i has frequency νmin + (i − 1)νs; partials above 45% of the sample rate are dropped. Amplitudes glide linearly from one step to the next to avoid clicks, and initial phases are random.
  • Additions suggested as future work in the article: live control of D and d, an ADSR envelope, a low-pass filter and a delay. A DC blocker and a soft limiter sit at the output.

Links

Audio and video demonstrations by the authors: diffusiondss.github.io

Article: doi.org/10.1162/COMJ_a_00606 · Project MUSE article 856999

Selected references from the article

Higham, D. 2001. “An Algorithmic Introduction to Numerical Simulation of Stochastic Differential Equations.” SIAM Review 43(3):525–546.

Hoffmann, P. 2000. “The New Gendyn Program.” Computer Music Journal 24(2):31–38.

Luque, S. 2009. “The Stochastic Synthesis of Iannis Xenakis.” Leonardo Music Journal 19:77–84.

Xenakis, I. 1992. Formalized Music. Hillsdale, New York: Pendragon Press.

Parts of the work were first presented at ICMC 2021, Santiago, Chile. Research partially funded by FONDECYT grant 1161328, ANID, Government of Chile.