Random number in centred distribution

rdist  width (number), centre (number)

Returns a random number within the range with width around centre. If optional arg step: is used, the result is quantised by step.

Introduced in v2.3

Examples

# Example 1

print rdist(1, 0)



#=> will print a number between -1 and 1



# Example 2

print rdist(1)



#=> centre defaults to 0 so this is the same as rdist(1, 0)



# Example 3

loop do
    play :c3, pan: rdist(1)
    sleep 0.125
  end



 
#=> Will play :c3 with random L/R panning