Feasible way to modify text in buffer via external controller?

As I (and Sam) have said, the current release version will work with the earliest sonic pi and with versions 3… It needs to be altered to work with SP4betas as it extracts the number for the server-port from the log files, and this location has changed. I have an updated version working, but until SP 4.0 is released I don’t want to to issue a pr to get the gem updated. It would also be nice to cater for all three possibilities in a single gem. My update at present just caters for the earliest version and version SP4beta.
This is a utility which is NOT directly supported by SP as it uses undocumented data which may (and has) changed twice so far! The existing published gem will work with version 3.3.1 the latest official release version of SP. You use it at your own risk that software that depends on it may break in the future.

I guess you’re talking about sonic-pi-cli and not sonic-pi-tool. From what Sam says, the latter must be updated to stop listening on a fixed port.

But I still have one remaining need from sonic-pi-cli that I can’t figure out how to do: how to effect the changes made to a text file in the SPI reload way, not a stop-and-start. As you said, sonic-pi-cli will superimpose on what’s already running, but I need to replace gracefully, in a musically useful way. I tried having sonic-pi-cli send a run_file command, but that also superimposes and doesn’t replace.