Use OSC instead of raw MIDI
Closed this issue · 6 comments
Open Sound Control (OSC) has a lot of advantages over raw MIDI. Not insignificantly, it will allow control surfaces to be used on Mac OS - which doesn't allow access to raw MIDI devices.
Do you plan to implement osc in C (or C++) and bind to it in guile or implement it completely in guile?
I happen to need a an osc implementation to be used in guile as well.
I would be willing to work on this as well.
Unfortunately my scheme is very basic, I'm much more at home in native code.
Thanks for your interest! I hadn't got as far as deciding how to implement the OSC server yet. I think it makes more sense to do it in C, than to attempt all the network stuff directly in Scheme. There would even be a possibility of wrapping one of the established OSC libraries, which would make things a lot easier. Both ways would be completely possible, though. Starlet already has a significant compiled C portion, so it's not bad from my point of view to add more.
I did some experiments using liblo on branches osc-with-ffi and osc-with-extension.
It appears to be impossible to use liblo via pure Scheme FFI, at least when using the liblo server thread (the most straightforward way). The reason is that liblo invokes the method callbacks from its own thread, which is not in Guile mode, immediately corrupting the stack. However, from a C-language Guile extension library, it's quite easy to make the necessary arrangements. So, for now I'm proceeding in that direction.
Work on Starlet's use of OSC, based on this extension, is on branch osc-with-guileosc.
@CasparKielwein if you're still interested in this, please join me over at taw10/guile-osc 🙂
I'll have a look at it.
As far as I could see it, it should be possible to use the "non blocking server" as shown in the example: https://github.com/radarsat1/liblo/blob/master/examples/nonblocking_server_example.c
I'll see if I can use that correctly from guile.
Unfortunately for the next two weeks I'm pretty busy having to prepare a release for Prolight + Sound.
If you happen to be there as well, drop me an email.
I've added a rough non-blocking server since it was a pretty quick job. There are many other OSC/liblo concepts that still need to be wrapped (blobs and bundles are two notable omissions so far). If you need to use file descriptors and e.g. select()
for the OSC server, some more work would be needed. Take a look and see how you get on.
I won't be in Frankfurt this week (entertainment tech isn't my day job), but I hope it goes well!
Closing, now that the OSC branch has been merged!