home/ atoms/ sonic-pi-deterministic-randomness

Sonic Pi's randomness is deterministic so a 'random' pattern you like can be reproduced and performed

In Sonic Pi nothing is truly random: the same seed always yields the same sequence of ‘random’ values. Artists initially object, wanting different music on every run — but Sam Aaron argues what they really want is reproducibility. If you use randomization to generate a riff or drum break you like, you need to be able to hold, name, reuse and perform it; with true randomness it slips away ‘like trying to pick up water with your hands’. Determinism gives you that grip, and you can still get variety by making it non-deterministic on purpose — e.g. setting the random seed to the current time gives fresh music each run. This is a clear case of musical need driving API design.

Examples

A random-generated melody replays identically each time the loop restarts; setting the random seed to the current time at the start yields a different pattern per run.

Assessment

Why is true randomness a problem for performing with Sonic Pi? How does deterministic randomness give both reproducibility and variety, and what is the mechanism for varying between runs?

“in Sonic Pi there is no randomization everything is deterministic and artists often they like laugh at me say that's rubbish”
corpus · sam-aaron-sonic-pi-how-to-live-code-an-orchestra-goto-2023 · chunk 3