How to send OSC messages

Discuss using the OSC interface to control SL

Moderator: jesse

Post Reply
ColinZeal
Posts: 4
Joined: Sun Dec 22, 2013 11:12 pm

How to send OSC messages

Post by ColinZeal »

Hi there, I am using SooperLooper in my Mac and I think I'm missing something here. How do I send the OSC messages to SooperLooper? I can't seem to find some easy implementation where I simply type the command and it does what I want. Can someone at least tell me if it exists? Thank you.
kasbah
Posts: 117
Joined: Tue Sep 06, 2011 7:01 pm

Re: How to send OSC messages

Post by kasbah »

There are _a lot_ of ways to send OSC. Maybe the tools available in liblo (oscsend) would fit the bill? Or maybe liblo's Python bindings? Or you could use Puredata or Supercollider or whatever. Have fun ! :D
ColinZeal
Posts: 4
Joined: Sun Dec 22, 2013 11:12 pm

Re: How to send OSC messages

Post by ColinZeal »

Thanks for the help. Apparently I would have to make programs with Liblo and Puredata, right? They are not interfaces by themselves. I read that "sendOSC" is a command-line tool that allows me to send messages right away, but I can't seem to find it for downloading - I get 404 on the original page. Maybe someone here has it?
kasbah
Posts: 117
Joined: Tue Sep 06, 2011 7:01 pm

Re: How to send OSC messages

Post by kasbah »

Well, liblo is a developer library so they don't provide binaries, so you have to compile it.

There is probably some convenient app for OSX but I don't know it, sorry. On Linux you could get the liblo tools from your package manager.
ColinZeal
Posts: 4
Joined: Sun Dec 22, 2013 11:12 pm

Re: How to send OSC messages

Post by ColinZeal »

Thanks kasbah, I've made some progress with your suggestion. Turns out it was just a matter of compiling liblo, the oscsend tool seems to work - I have been able to send some commands to SL successfully.

I don't get how I'm supposed to get the return value of some messages though. E.g. the /ping message, nothing happens. I see there's a "oscdump" tool but it complains the port 9951 is being used already - if not the SL port, which port am I supposed to listen to?
kasbah
Posts: 117
Joined: Tue Sep 06, 2011 7:01 pm

Re: How to send OSC messages

Post by kasbah »

You specify the return port in your registration message.
ColinZeal
Posts: 4
Joined: Sun Dec 22, 2013 11:12 pm

Re: How to send OSC messages

Post by ColinZeal »

Right! The parameters of the /ping message dictate the return of the command. It took me a while but I've made it! Thank you kasbah. I'll document what I did below just in case anyone stumbles onto this topic in search for their questions.

I basically want to write a program that sends pre-programmed messages to SL whenever I tap my Bluetooth pedal. Probably will do that in AppleScript or something. So I have installed the liblo package (using its own installation guide to compile and run it); it comes with "oscsend" and "oscdump", two tools you can invoke from the command line. Sending messages is easy, just type "oscsend localhost 9951 /quit", as an example, you will see that your SL will freeze, because the engine is gone. In order to receive messages, whether you're getting the status of a setting, or you just want to ping, you have to leave "oscdump" running on another port, say 9952, and then point the return message from oscsend there: "oscsend localhost 9951 /ping ss osc.udp://localhost:9952/ osc.udp://localhost:9952/". The return of the command will show up on the "oscdump" output.
Post Reply