That works in your situation, so it’s good you figured it out!
Hmm, from the tutorial, there’s this:
If you want something to repeat a lot of times, you might find yourself using really large numbers such as
1000.times do
. In this case, you’re probably better off asking Sonic Pi to repeat forever (at least until you press the stop button!).
It’s true that you could create a global time limit and use a function to determine the number of repetitions needed for each loop based on its sleep duration. Otherwise, with a lot of threads, maintenance might get a bit tedious.