Running code via OSC plays sound, but oscilloscope stays idle

Hi, thanks for a great music tool!

When I enter some code in Sonic Pi’s own editor and press Run, I hear both sound and I see the scope viewer visualizing sound. This is expected.

However, when I load code from the “outside” using OSC (e.g. sonic-pi-cli Ruby library, or any other OSC library), the sound plays as expected, but the oscilloscope stays flat. It does not visualize sound at all.

Is this by design? Can we somehow instruct the oscilloscope to visualize sound even if the code was set via OSC?

Sonic Pi v3.3 on Mac, all default settings

Hi @mislav,

for the record, I should mention that running code from outside the main GUI e.g. via OSC is unsupported is not behaviour that’s guaranteed to be available in future versions.

Thanks for the fast response. Does this mean that live coding from any text editor other than the built-in editor is essentially unsupported?

Right now, running code and stopping playback works well via OSC, so I hope those features at least don’t go away intentionally in future versions. If the oscilloscope also worked, that would be a nice touch, but is not strictly necessary for me.

Sorry for not making it a bit clearer previously - just because something is unsupported doesn’t mean you shouldn’t do it - it’s just not behaviour we can guarantee will work and/or will continue to work.

The only way to really support the maintenance and growth of a project like Sonic Pi with such limited resources is to reduce the surface area we offer to support as much as possible.

Thanks for clarifying. Coming from one software maintainer to another, that absolutely makes sense.

I didn’t want to waste any more of your time yesterday, so I dove into the source code to find out whether connecting the oscilloscope to server commands is something that could be relatively trivial. It’s a large codebase and I’m not at all familiar with Qt, but for the sake for posterity, I think that this is where the oscilloscope gets activated when Run is pressed in Sonic Pi GUI, and this is where the Ruby server processes incoming OSC messages. Indeed, it doesn’t seem like the latter mechanism has any interface to the oscilloscope, and to grant it access could likely necessitate code restructuring. To be clear, I do not expect that you @samaaron undertake that without a strong reason. :bowing_man:‍♂

2 Likes