Searching for ideas for random rhythm

Here would be somewhere to start

16.times do
  play scale(:c4, :major).choose
  sleep 0.5
end

16.times do
  play scale(:c4, :major).choose
  sleep rrand(0.1, 1)
end

The second block will choose random sleep values between 0.1 and 1. However, be aware that it is not true randomness. Every time you play it , it will give you the same pattern. you can change the pattern by adding use_random_seed above the second block along with a number to change the pattern but it will still play the same way each time you run it.

Check out this thread for more about using true randomness as it seems applicable to what you might be trying to do -> More real randomization

Hope that helps

1 Like