Edit sonic-pi code in my own editor?

Hi there. I’m having such fun with sonic-pi.

But, the one thing I’m struggling with is the editor, meaning the buffers.

For example, I wish I had more than just ten buffers. I’m often commenting out code when I’m experimenting and losing track of which code does what.

Also, I really wish I could do code folding on my live_loop blocks. I don’t see a way to do that.

Is there a way to use an alternative editor instead of the QT text edit field?

I thought perhaps the easiest thing would be to use one of the CLI options. But, none of those seem to work right now with my sonic-pi 4.3. maybe this is just a misconfiguration?

Does anyone have a suggestion?

Hi There. Happy Christmas!
as regards sonic-pi-cli II have written a version for Sonic Pi4 which you can install with sudo gem install sonic-pi-cli4
Usage is the same as for the original version except substitute sonic_pi4 for sonic_pi e.g. sonic_pi4 play 72
I produce a lot of programs which are too long for a sonic pi buffer so I usually work with Visual Studio Code editor on my Mac. (It is available for most platforms).
I then either drag the file icon into a sonic pi editor with run_file proceeding it.
Alternatively use
sonic_pi4 'run_file "path/to/sonicpi/file.rb"'
from a terminal window

1 Like

Very excited about this!

Does this permit updating a running live loop for example?

Thanks so much.

I think you could use run_code “” to do this. If you had a running live loop you could use
sonic_pi4 'run_code "<pasted new live_loop code>"'
to update the live loop code on the next iteration.