Hi, I’m a total noob playing with Sonic Pi and some Y8s.
Is it possible to do maths (or use variables) with Sleep?
For example, if you want a loop to sleep for 3 times the duration of a sample?
Or you want to do something like:
Such that the sleep value gets slightly shorter each time?
thanks for your question
It’s totally possible to use variables in Sonic Pi - simply use the
= operator to assign a value to a letter:
x = 3
x = x - 0.1
Great! I was trying similar but didn’t quite get the syntax right. Thanks!
you could also use the
x -= 0.1 syntax to reduce the value of x