Bringing Raspberry Pi CPU Clock Data into RNBO
Hello!
I created a Max patch for a sound installation that made a functioning timepiece using the cpuclock object. I want to create a similar patch in RNBO that can operate on a Raspberry Pi that has a clock module installed, but to my knowledge there is no equivalent to the cpuclock object.
Is there a way to bring the RP's CPU clock data into RNBO?
Thanks!
Hello Thomas,
AFAIK there is no cpu clock object or similar in RNBO - and I would be surprised if it'll ever come. The reason is that things like CPU times are highly platforms dependent and RNBO is a tool for platform agnostic C++ code generation.
But you could write your own script on the Pi (Python, Java, C++, Node.js whatever you feel most comfortable with) that reads the CPU time and send the value to an RNBO parameter via OSC.
Thank you, Jan!
I guess I have a lot of reading to do this weekend. I haven't delved into OSC yet, but just a cursory look opens up a whole world of opportunities for the Pi.
Actually, and currently, accessing this through RNBO (bidirectionnal way, btw) can only be done through:
Audio
MIDI
OSC
The easiest / most flexible way is indeed OSC here.
https://rnbo.cycling74.com/learn/rnbo-raspberry-pi-oscquery-runner can help, maybe.
inport RNBO object can be used as an OSC input, on a way.
Hi,
I just got this thread...
Here's a python script I use to retrieve time...
I added in /etc/rc.local, on the rpi OS, the following command I want executed to the end of the file. With exit 0 at the very end of the file to make sure it continues working as intended.
sudo bash -c 'python3 /home/pi/Documents/rnbo/datafiles/rpi_getTime.py > /home/pi/Documents/rnbo/datafiles/getTimes.log 2>&1' &
The second part of the cmd will print the time log, make sure getTimes.log file exists beforehand)
Hope it helps,
p.s. change .txt to .py this web interface do not accept .py file and do not mind the commented lines, I tweaked a script from the photosensor example in the rnbo examples :-)