Random number in centred distribution
rdist
[width (number), centre (number)]
Returns a random number within the range with width around centre. If optional arg :res is used, the result is quantised by res.
Introduced in v2.3
|
print rdist(1, 0) |
#=> will print a number between -1 and 1 |
|
print rdist(1) |
#=> centre defaults to 0 so this is the same as rdist(1, 0) |
|
loop do play :c3, pan: rdist(1) sleep 0.125 end |
#=> Will play :c3 with random L/R panning |