Control the stop of a live_loop with a condition

Hi @nlb,

well, the problem is, that once you’ve stopped the live_loop you’d have to (re)evaluate the code to start it again. One way how to circumvent this is, to let the live_loop run but stop only the sample (or synth) code from being run:

live_loop :foo, sync: :metronome do # sync just once: http://in-thread.sonic-pi.net/t/live-loops-sync-questions/1172/16
  sample :bass_dnb_f if get(:toggleOn) == false
  sleep 1
end

(not tested)