TidalCycles choose emits continuous random values from a list; wchoose adds probability weights to make some values more likely
choose [a,b,c] produces a continuous pattern that randomly selects from the list. Because it’s continuous (no built-in structure), it must be paired with a structured pattern to produce events — # n (choose [0,2,3]) adds random note selection to whatever rhythm the rest of the pattern provides. wchoose [(0,0.25),(2,0.5),(3,0.25)] weights the choices: value 2 is twice as likely as 0 or 3 (weights no longer need to sum to 1 since version 1.0). chooseBy pattern list uses a 0–1 pattern to deterministically index into the list. wchooseBy combines weights with a deterministic selector. These functions are essential for adding melodic variation while maintaining control over probability distributions.
Examples
d1 $ sound "drum ~ drum drum" # n (choose [0,2,3])
d1 $ sound "drum ~ drum drum" # n (wchoose [(0,0.25),(2,0.5),(3,0.25)])
-- deterministic selection:
chooseBy "0 0.25 0.5" ["a","b","c","d"] -- produces "a b c"
Assessment
What is the difference between choose and a random number generator applied once? Why does choose [0,1,2] need to be combined with a structured rhythm pattern? How would you use wchoose to make a hi-hat accent appear 80% of the time?