GENERATIVE MUSIC · AUDIO DSP · CHUCK_
A small album that composes itself. Six algorithmic études written in ChucK, a strongly-timed audio language — no samples and no DAW, every sound synthesised from oscillators and filters and every note chosen at run time by stochastic processes, Markov chains and self-mutating patterns. The piece is then rendered offline to audio, while ChucK emits each note it plays so the browser loom below can weave the exact same events in lock-step with the sound. Weefsel is Afrikaans for “weave”.
The six pieces play right here. The picture is not an audio analysis — it's a replay of the actual note events the ChucK program emitted at render time: pitch rises upward, each instrument is a colour, and notes flare as they cross the bright now-line. Audio streams as MP3; the visuals run from a small baked-in event file, so the only thing the browser needs is to play sound. Best with the volume up.
The album is rendered offline by real ChucK — but to show how the language itself works, I also wrote a simulated ChucK runtime in pure JavaScript: a from-scratch lexer, parser and tree-walking interpreter for a subset of ChucK, synthesising live on the Web Audio API. It's not the real VM — it exists to demo ChucK's two signature ideas in a page you can edit:
1::second => now genuinely blocks the running shred — each shred is a JS generator that yields at every time advance.spork ~ voice() launches a cooperative green-thread; a priority scheduler always runs whichever shred has the smallest now, so voices interleave in virtual time exactly like ChucK.Six editable demos ship with it — a strongly-timed sine, a pentatonic arpeggiator, a sporked chord pad, a Poisson rain, a self-rewriting drum machine, and a miniature of dagbreek. A lookahead scheduler keeps audio in sync and a runaway guard catches a while(true) with no => now. The interpreter is audio-agnostic, so its whole language core is unit-tested head-less under Node.
WEEFSEL is built the way ChucK is meant to be used: time is a value. A line like 4500::ms => now advances the piece by four and a half seconds, so rhythm and musical form are expressed directly in the language rather than in a sequencer. On top of that sits a shared library — a Theory class that turns abstract scale degrees into pitches, and a set of polyphonic Voice classes (pad, bell, pluck, bass, drop, electric piano, kick, hat) that each build their own signal chain, play an envelope, then disconnect and free themselves. A piece just sporks notes and lets ChucK's scheduler overlap them.
Slow pentatonic pads through a four-chord cycle while the register climbs and bells appear with rising probability — the music brightens like a sunrise.
A shower modelled as a Poisson point process: droplets arrive with exponentially-distributed gaps whose rate swells and recedes like a passing squall.
A slow minor groove — walking bass and a Rhodey electric piano over a pad — whose chords follow a Markov chain that wanders but always resolves home.
A 16-step clock drives kick, hat and a bass ostinato while a probability-masked lead improvises and the patterns mutate every few bars — a drum machine that re-writes itself.
Sparse lydian bells and soft piano over a thinning drone, with note density decaying toward silence as the light goes and the reverb gets the last word.
The closer: a nocturne whose melody is a 1/f fractal (Voss–McCartney) — self-similar pink-noise motion that wanders with both small wiggles and slow arcs, a single Rhodey line under bells with a sub-bass anchoring the low dips.
A Scribe taps every note to a CSV at render time; the page replays those events on a canvas in sync with the MP3, so what you see is what the algorithm played.
Rhodey for colour.chuck --silent bounces the whole ~7-minute album to WAV/MP3 in well under 30 seconds of wall time by running faster than real time.It also runs live — chuck lib/*.ck pieces/04-masjien.ck plays a piece in real time. Open the player →