So I’m trying to get the 4.x version working in a headless mode (ubuntu 24.04, no gui). I’ve managed to get the daemon running and prevented it from auto-terminating
But I can’t get it to run SP code from there.
From what I can figure, this should work:
require "osc/osc"
client = SonicPi::OSC::UDPClient.new("localhost", SPIDER_LISTEN_TO_GUI_PORT)
client. send("/run-code", TOKEN, "play 60")
# or maybe?
client.send("/run-code", TOKEN, "SOMEPREFIXplay 60")
Right? What am I missing here?
Thank you?
Hi there @vomitHatSteve
as this is a dev question - the best place to ask this kind of question is on GitHub via an issue: Issues · sonic-pi-net/sonic-pi · GitHub
That way we get to keep these forums specifically for using the app rather than developing the app (or adjacent tools).
However, that said, I think there’s a good chance you’re sending your TOKEN
as a string rather than a 32 bit integer. Could you try check to see if you’re sending it as an integer?
Happy to help further over on GitHub if necessary!
Thank you. It’s possible my actual code was treating it as a string, yes. But the test code is definitely using an int.
I will take it over to Github to investigate further tho.