I would add the stop statement to the end of each thread (or live_loop) in the buffer, and add a sleep line to the BEGINNING of that buffer (at 60 bpm, sleep 5 should be more than enough). Then run the buffer, switch to the next buffer, and run THAT buffer. The first buffer will stop after 5 beats. I suggest adding a sleep 3 line to the beginning of the second buffer before running it, to provide a better fading effect.
But this means that the loop has to have a pre-defined length, and that I only can switch to the next buffer when the stop statement is reached… right?
My setup aims more to improvisation, therefore having fixed lengths of loops is not suitable for me
you can use cues in one buffer to switch to code in another one. Uase a correspnding sync command in the second buffer (You have to run the destination buffer first so that it is waiting for the cue). Does that help?
Btw, you probably can use MIDI messages as well (instead of OSC) and if you want, you can use MIDI control software to generate those or hardware, like a MIDI controller. (same with OSC)
There’s a plethora of options there, and that’s what those have been for even in DAWs.
Cheers, hope that helps a bit.
PS: Cues are also an option, but within Sonic Pi code itself.
buffers currently don’t do anything special other than house text. However, I have plans to change that and make buffers something you can start, stop, and mix…
Sam
So stopping a buffer really means stopping all threads generated in a buffer. (at least from what I can tell)
Currently there’s nothing like this - although I have planned stuff like this for a while now. Hopefully if I’m able to keep on hacking on Sonic Pi this is something I’m able to work on.
It’s definitely possible to play good quality live sets without this functionality. Using Robin’s advice of taking advantage of sync and cue across buffers is one way of ensuring the code in two buffers is working in time together. Then it’s just a matter of live coding the live loops to create a transition. This is the kind of thing I hope to make clearer in the video tutorials I have planned