I’m a total newbie to live coding, but I have some programming background so I was able to get up and running with Sonic Pi without too much difficulty. Tremendous thanks to Sam Aaron for creating such an amazing piece of software
Now, onto the question: I have a live loop with a ring in it, and I can turn it on and off by commenting it out. However, every time I hit run, the ring starts from the point where it was last stopped. I would like it to start from the beginning so I was looking through the methods for something like “reset”. Does not seem to exist…
Here is the code:
use_bpm 120 use_synth:pretty_bell notes = (ring :C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4) live_loop :ex do play notes.tick sleep 0.5 end live_loop :bar do sample :bd_pure, amp: 2.5 sleep 1 end
For completeness, I am commenting out the “play notes.tick” line. There must be an easy solution to this - in a performance you would want your melody to start from the beginning when you “unmute” it (not that the C major scale counts a melody but you get the idea). Sorry if this is a common question, I searched the forum but could not find an answer.