Quantise "run" / Update live loops without clicking "run"?

I’m not aware of any OSC endpoints for controlling the transport (run/stop), but that would make a nice addition in a future version IMO. (paging @samaaron :wink:

This might be an option for you: Tool to run Sonic Pi from command line. With that tool you should be able to execute new runs via eval. But it’s not clear who or what is changing (which) values from your description.

It sounds like you might be after a solution that relies more on set/get like @ethancrawford mentioned. The basic idea is:

  1. Something “external” is changing the state of your Sonic Pi program - which might a combo of any or all of: code running in another buffer, another program or a piece of hardware sending MIDI or OSC messages
  2. You have a piece of code (live_loop / in_thread) in Sonic Pi whose job is to receive these messages and then record them (using set) or pass them on to a function. We can call this piece the “Dispatcher”. This may be a logical place to handle quantization of the changes if you want that…
  3. You set up your main live_loop(s) and audio generation code to use get variables when setting options, notes to play, etc. You refer to the variables you’ve set in the dispatcher, which might be named things like next_note, loop_drums_amp, drone_reverb_mix, bpm, etc. (names are up to you)

One nice side effect of this setup is that every time the loop repeats any changes in your variables will become the new state - without needing an explicit “run”. In this way you can continually change the output within the same run.

Here’s an example of what I’m describing: Link sonic pi to Python - #5 by perpetual_monday