giuliomoro I wouldn't say large chunks.. but there is a non-trivial number of OSC messages going between sclang and sc-server ...
Connecting to Serial Devices with SuperCollider
argl My trill ugens are public: here https://github.com/jreus/Trill_SC
I think for the screen you would ideally make a little C++ utility that connects to the screen and pipes OSC to sclang.. what do you think @giuliomoro ?
jonathan I think for the screen you would ideally make a little C++ utility that connects to the screen and pipes OSC to sclang.. what do you think @giuliomoro ?
I think that would be the best. I have done something like that for Trill that can work as a general template see here
jonathan My trill ugens are public: here https://github.com/jreus/Trill_SC
You will need my Pull Request for it to work with the released Trill!
giuliomoro I think that would be the best.
Actually I think I had something like that working done with @crosswick : see here
- Edited
Just following up now. This is helpful, thanks guys! I'll post some code examples that utilize either or both approaches later this week/early next. I2C might be outside our application space, but I'll talk to the UX/UI team.
@giuliomoro @jonathan
Hey all
I've been making some progress building a stand-alone serial utility on the Bela that converts incoming serial data to OSC (see code here)
I would like this little utility to run when the Bela boots up, and to have it quit when the halt switch on the Bela is triggered. Just curious... giuliomoro ...do you have any best practice way of accomplishing this?
you'll need a systemd
service.
Create a file following this template in /lib/systemd/system/serialosc.service
:
[Unit]
Description=serialosc daemon
[Service]
Type=simple
ExecStart=/usr/local/bin/serialoscd
PIDFile=/var/run/serialoscd.pid
RemainAfterExit=no
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
then edit the ExecStart
line to match your executable file path.
Then execute
- to start the service:
systemctl start serialosc
- to stop the service:
systemctl stop serialosc
- to look at the output:
journalctl -fu serialosc
- to enable it at startup
systemctl enable serialosc
- to disable it at startup
systemctl disable serialosc
Ultimately, I just realised that the serialosc
daemon used for the monome may already do all you need ... see here
giuliomoro perfect! thank you :-)
@spencer that'll be interesting to see!
giuliomoro interestingly enough, I accidentally found a more elegant way of launching the serial2osc utility with SuperCollider. I now launch the script from SClang when the SC patch loads using unixCmd
.
~spid = "/root/BelaUtils/serial2osc --port /dev/ttyS5 --baud 115200 --remote localhost:57120".unixCmd({|ec, pid| postln("serial2osc (pid %) exited with code %".format(pid, ec)) }, true);
Magically, when SC crashes or quits.. so does the serial2osc script. :-)