Hoping somebody has an idea for me here. I'm using node-red on a raspi 4 for a fun musical project (a 10 m long touch Musical keyboard).
Im using very nice extension node-red-contrib-music Which is perfect for my application. The catch is I need to start the super collider synthesizer before I start node-red. If I try to start node-red first then supercollider it seems supercollider cant find its sounddefs. This order is very easy from the command line prompt… But I Generally run node red as a service that started at boot time.. I like doing it this way because it's easy and not restart if and when it crashes… What's the best way to start up another program like super collider before starting node-red as a service ? ...or Should I start both programs in a script and use another way to start things at boot ?
Any suggestions very welcome! Have a happy and safe holiday everybody!
Hi John - happy and safe holidays to you too !
Can supercollider be stated as a service as well ? If so then you can potential chain them up with some systemd magic - but to be honest I'd revert to the "old ways"... and use something like
screen to run it as a detached processes - and just add that to
/etc/rc.local - something like
screen -dmS super supercollider command line and params systemctl start nodered
and turn off autostarting not start node-red as a service -
sudo systemctl disable nodered.service
then you can attach to it of them using
screen -r super and use ctrl-a-d to detach it again etc...
All the best
Great to hear from you ! Thanks for the ideas . I don’t know if I can call supercollider as a service but I’ll look into that. If I go the route of screen and called node read from there… Do you know any way to make sure that node red auto starts if it fails?… For some reason the combination of node red and this sound stuff causes sporadic crashes of nodered and it’s nice to have it auto start .
One question there .. Is there anyway to put the call to start supercollider in some of the initializations of node-red ? I think it just needs to be before nodered looks for udp port declarations.
as long as you call node-red-start it will start it as a service which will then attempt to restart if it crashes so that should be ok.
If you check inside the nodered.service file we call node-red-pi command to actually start node-red - so I guess you could possibly add supercollider into node-red-pi shell script if you wanted - but then it would become part of the service call - and in case of a crash would be called again etc - not sure if that is a good thing if that part hasn't crashed.