Osc, time stamps and forward synchronization

Hey Folks,

Thanks for all your hard work on Sonic Pi.

I have been poking around the source code and documentation and can’t figure out if there is a way to send OSC bundles with a future timestamp (like the one the erlang scheduler uses). I’m building some instruments (using esp32s) that I was planning on controlling over osc/WiFi and the packet jitter is ugly looking. I was hoping to have time stamps and do forward synchronization.

I see mention of bundles and time stamps in the erlang code, but can’t figure out how to send one. I have not tried the use_real_time call.

Is this possible?

Thanks,
Chris

Hi there @cprosser,

welcome to our community and thanks for your question :slight_smile:

Unfortunately, sending timestamped OSC bundles isn’t something that’s directly accessibly from our API at this stage. Unfortunately it doesn’t seem that well-timed OSC schedulers are that standard in software/hardware that supports OSC so there hasn’t been a big need for such a thing. Of course, this is always something to be considered especially, as you say, all the plumbing infrastructure is already in place.

Out of interest, what were you considering to use as the OSC scheduler connected to your esp32-based instruments?

Unfortunately it doesn’t seem that well-timed OSC schedulers are that standard in software/hardware that supports OSC so there hasn’t been a big need for such a thing.

That would explain my difficulty in trying to find any documentation other than some research papers from 10 years ago ;). My plan was to use my own scheduler that I wrote on the ESP 32. I found some NTP software that stated it could get the devices within about 1 ms each other. But still, writing a scheduler, not fun.

In the end I decided I’m going to use this as an opportunity to experiment with RS485. It’s been on the list for a while to learn more about, and have a couple of other projects I could use it with. I found some node code that looks it should be pretty easy bridge UDP->Serial.

By the way, I’m thrilled to see you you are using Erlang. I’ve done a few tutorials but never had an opportunity to use it in production for anything.