rand is an oscillator that generates a continuous pattern of
(pseudo-)random numbers between 0 and 1.
For example, to randomly pan around the stereo field:
d1 $ sound "bd*8" # pan rand
Or to enjoy a randomised speed from 0.5 to 1.5, add 0.5 to it:
d1 $ sound "arpy*4" # speed (rand + 0.5)
To make the snares randomly loud and quiet:
sound "sn sn ~ sn" # gain rand
Numbers coming from this pattern are 'seeded' by time. So if you reset
time (using
resetCycles,
setCycle, or
cps)
the random pattern will emit the exact same _random_ numbers again.
In cases where you need two different random patterns, you can shift
one of them around to change the time from which the _random_ pattern
is read, note the difference:
jux (# gain rand) $ sound "sn sn ~ sn" # gain rand
and with the juxed version shifted backwards for 1024 cycles:
jux (# ((1024 <~) $ gain rand)) $ sound "sn sn ~ sn" # gain rand