Crossfading buffers, or stopping single buffers

Hi all

Is there any way to stop single buffers or, even better, crossfading between them? Is it so obvious that I’ve not seen it? :slight_smile:

This would be a must for me playing it live

Or is there any alternative workflow to, let’s say, change scenes?

Great stuff however, thanks!

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.

Thanks for the answer

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 :frowning:

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?

Hmmm, I guess you could have OSC messages between buffers and wait for the messages to run functions that fade and/or stop.

Hi all

I was asking for something more “Ableton-ish” and embedded in the UI.

But I’ll try your options for sure

thanks to all!

Sorry I couldn’t help more.

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.

Sorry if my questions are too obvious, but it is my first day with Sonic Pi and I definitively need to check deeper the documentation

Just a final might-be-stupid question: Is it possible to play/stop single buffers through OSC or MIDI?

you can add/run the stop lines whenever you feel like ending it. You could also use a die roller or something (randomization).

1 Like

It’s not a stupid question at all, because it’s more complex than it might seem.

As sam once wrote at:!topic/sonic-pi/AyR4mPgMmv4

Hi there,

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…


So stopping a buffer really means stopping all threads generated in a buffer. (at least from what I can tell)

PS: @csantin I’m new at this too :slight_smile:

1 Like

Ahh, a buffer mixer, I was looking exactly for that minutes ago

Good to know that there are future implementation plans

Thanks to all for the help

1 Like

So I just replace the whole buffer content with a stop statement, now I get it

Although such a workflow is not exactly intuitive


Actually put a “stop” on each “thread” - loops included. Replacing everything for a “stop” wont stop already running threads.

Not the whole buffer – stop stops the current thread. Just add it somewhere in the individual loops.

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 :slight_smile: