Tidal: randomness and probabilistic variation
Learning objectives
- learner can inject controlled randomness with rand/irand, degrade and sometimes
- learner can select among sub-patterns randomly and weight the choice
- learner can exploit deterministic cycle-seeded randomness for reproducible variation
Capstone — one whole task that evidences the objectives
Live-code a Tidal pattern whose variation is entirely randomised — degradeBy thinning, sometimes-family transforms, randcat/wchoose selection, perlin modulation — then use resetCycles to prove the 'random' performance is reproducible.
Prerequisite modules
A four-bar loop that repeats identically is dead on a dancefloor; a loop that mutates unpredictably but never loses its groove is what keeps a techno or IDM set alive for twenty minutes without retyping code. This module builds toward exactly that: a live-coded pattern whose entire evolution comes from randomness you shape and can replay on demand — the difference between rolling dice on stage and performing with dice you have already read.
Start supported: take a plain drum pattern from the prerequisite module and thin it with degrade and degradeBy, hearing how the rhythmic silhouette survives while individual hits flicker (the degrade/degradeBy atoms are your JIT how-to here). Then layer transformation probability with the sometimes family — sometimesBy, often, rarely, somecycles — choosing event-level scatter versus whole-cycle coherence. Next, move from gating one pattern to choosing among several: randcat for shuffled pattern selection, then wchoose and its weighted-selection procedure to bias which material dominates. Add rand/irand and perlin for parameter movement — jittery versus smoothly wandering — remembering the core principle that continuous random streams only make sound when a discrete structure samples them. Finally, the payoff: because every Tidal random function is seeded by cycle number, resetCycles replays the whole “improvised” performance verbatim — the deterministic-randomness atom is what turns chaos into a rehearsable set piece.
The required atoms are exactly the techniques the capstone demands: thinning (degrade and degradeBy), probabilistic transforms, weighted selection, perlin modulation, and cycle-seeded reproducibility. Supporting atoms widen the palette — the finer-grained degradeBy removal variant, mini-notation shortcuts (?, |), shuffle/scramble reordering, stripe’s elastic timing, and range/waveform plumbing — worth absorbing once the core moves are automatic under performance pressure.
Runnable examples
Generated from the context/ instrument corpus by concept (redistributable idioms only). Do not edit — regenerate with gen-module-examples.mjs.
probabilistic-variation
s("hh*16").degradeBy(0.3)
strudel-0026 · CC0
d1 $ degradeBy 0.3 $ sound "hh*16"
tidal-0025 · CC0
weighted-random-choice
play (ring :e3, :e3, :e3, :g3).choose; sleep 0.25
sonicpi-0020 · CC0
Pbind(\degree, Pwrand([0, 3, 7], [0.6, 0.3, 0.1], inf), \dur, 0.25).play
supercollider-0026 · CC0
step-probability
play :e4, release: 0.1 if one_in(3); sleep 0.25
sonicpi-0044 · CC0
SinOsc s => dac; while(true){ if(maybe) 440 => s.gain; else 0 => s.gain; 125::ms => now; }
chuck-0047 · MIT
seeded-randomness
use_random_seed 42; 8.times { play (scale :e3, :minor).choose; sleep 0.25 }
sonicpi-0051 · CC0
Atoms in this module
Required — these gate the capstone
Supporting — enrichment, not gating
Part of curricula
- Live Coder — zero to performing live-coded music — Generative Systems & the SuperCollider Stack required
Unlocks — modules that require this one