home/ modules/ tidal-randomness-and-probabilistic-variation

Tidal: randomness and probabilistic variation

  • 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

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.

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

Tidal's rand emits a continuous stream of random floats 0-1 and irand n emits random integers 0 to n-1, both deterministic in time
Concept L2 First instrument F
Tidal sometimes, degradeBy, irand, and rand add controlled randomness to patterns
Concept L2 First instrument F
Tidal's randomness is seeded by cycle count, so resetCycles restarts the same random sequence
Concept L2 First instrument F
degrade and degradeBy randomly drop events from a pattern with a given probability
Concept L2 First instrument F
Tidal's ? and degrade functions randomly remove pattern events to introduce controlled probabilistic variation
Procedure L2 First instrument F
Tidal's sometimes applies a function to random individual events; somecycles applies it to entire random cycles
Concept L3 Craft F
TidalCycles can pick one of several patterns at random each cycle to add variation
Concept L2 First instrument F
randcat plays patterns from a list in random order; wrandcat adds probability weights to the selection
Concept L3 Craft F
TidalCycles choose emits continuous random values from a list; wchoose adds probability weights to make some values more likely
Procedure L3 Craft F
Tidal's wchoose picks from a list with weighted probabilities, unlike choose which weights all options equally
Concept L3 Craft F
perlin produces smooth cycle-to-cycle random modulation unlike the per-event jitter of rand
Concept L3 Craft F
Continuous random patterns must be sampled by a discrete structure to produce events
Principle L3 Craft F

Supporting — enrichment, not gating

TidalCycles degrade and degradeBy randomly remove events from a pattern at a controllable probability
Procedure L3 Craft F
Tidal mini-notation uses | to randomly pick between subsequences, and ? to randomly drop events
Concept L2 First instrument F
Tidal's shuffle plays a random permutation of a pattern's parts (without replacement); scramble picks parts with replacement
Concept L3 Craft F
randrun emits a shuffled run of the integers below n, one distinct value per step
Concept L3 Craft F
Tidal's stripe repeats a pattern n times per cycle but with random sub-cycle durations that still fill the cycle
Concept L3 Craft F
TidalCycles stripe repeats a pattern n times at random speeds while keeping total duration constant
Procedure L3 Craft F
The run function generates sequential integer patterns for automatically stepping through sample indices or pitch values
Procedure L2 First instrument F
Tidal provides continuous waveform functions (sine, tri, saw, square) that return smoothly varying values for use as effect parameters
Concept L3 Craft F
TidalCycles range rescales a 0–1 continuous pattern to any numeric interval
Procedure L3 Craft F
Probabilistic variation at low amounts humanizes a pattern; at high amounts it thins or breaks it up
Concept L2 First instrument AF
Per-step firing probabilities create a living sequence with a fixed skeleton and flickering ornaments
Concept L2 First instrument AF
Weighted random choice picks among options by probability so the common case dominates and surprises stay rare
Concept L2 First instrument AF
Hard-coding the kick/bass/backbeat while making ornaments probabilistic gives a pattern both stability and life
Principle L2 First instrument AF