Receiving OSC?

soulfulmojo's icon

Does anybody know if it's possible to receive OSC messages in Max? I'm able to send messages but can't figure out how to receive them and it's really important that I can get two way communication

Edit -------------
Thanks Christopher,

Max Patch
Copy patch and select New From Clipboard in Max.

So I set it up so I should be receiving the integer from UE4 like this but it doesn't seem to be coming through. I thought I got it working once but it hasn't since. Does this look right or have I missed something obvious? sorry to be a bother! For reference I've attached an image of how it is set up in UE4 and I'm pretty sure that it is sending through the value's correctly so it has to be the max set up

Trond Lossius's icon

You first receive them using the udpreceive object, and next you need an object to parse the osc string. The CNMAT osc-route object is one option:

soulfulmojo's icon

Oh wow! Thanks. So which way round would that work?

Would I need to set UDP to receive the port (8000) and then connect that to OSCroute? or connect UDPreceive to OSCroute /8000?

Christopher Dobrian's icon
soulfulmojo's icon

Thanks Christopher,

Max Patch
Copy patch and select New From Clipboard in Max.

So I set it up so I should be receiving the integer from UE4 like this but it doesn't seem to be coming through. I thought I got it working once but it hasn't since. Does this look right or have I missed something obvious? sorry to be a bother! For reference I've attached an image of how it is set up in UE4 and I'm pretty sure that it is sending through the value's correctly so it has to be the max set up

1.png
png
Stephane Morisse's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You've connected integer boxes to the OSC-route objects. If that doesn't match the type of data you send from UE, they will never show in those boxes. To see clearly if things are set up properly in Max, you should attach the right inlet of message boxes to the OSC-route like that :

Christopher Dobrian's icon

And to see if things are set up properly outside of Max, make sure that your other application is sending to the local IP address (127.0.0.1) and that the sending application and your udpreceive object are both using the same port number, and attach a print object (or the right inlet of a message box) to the outlet of udpreceive, to see if anything is coming into Max at all.

meeble's icon

Does anyone know where I can get the Berkeley "osc-route" Max external now? All of the above links to obtain that point here:

which is a dead link. I would think that OSC sending and receiving would be built in to Max.7 by now.

Any ideas?

Jan M's icon

Actually it is built in into max with [udpsend] and [udpreceive] - the names are misleading, they actually don't handle raw UDP but OSC data.

You can easily break down an OSC path into a Max list and route it with [route] by using [regexp / @substitute " "]

LSka's icon

You can install them with the new Package Manager.

dhjdhjdhj's icon

Hmmm, I was under the impression that those two objects just handled the data part of a UDP packet. Certainly, I've thrown single numbers (e.g, output of a slider) into a udpsend and had it received perfectly fine on another device. So they don't require you to use OSC formatted data.

Jan M's icon

true, they don't require a OSC path, but internally they use OSC formatted data packages not raw UDP.

dhjdhjdhj's icon

Fascinating --- did not know that and I just did an experiment using Packet Sender to see this behavior (see screenshot).

I am curious however as to why this was done, rather than just sending raw data.

Secondly, I noticed that incoming data, although displayable in a messagebox, was NOT displayed in the Max Console. Curious as to why THAT is not working, particularly since 'print' is so important for debugging

screenshot_1184.png
png
Jan M's icon

Secondly, I noticed that incoming data, although displayable in a messagebox, was NOT displayed in the Max Console.

... probably because there is a message box connected instead of a print object ... ? ;)

dhjdhjdhj's icon

If you look at the screenshot I posted, you'll see that both a print object and a message box are connected. At first I only had a print object and I was wondering why nothing was appearing in the console window, other than error messages about badly formed OSC packet (proving your original comment of course) and so I added a message box as well. Once I started sending valid OSC packets, they appeared in the message box but not in the console.

pdelges's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Look closer at your patch, as Jan noted you don't have a print object, but a print message:

dhjdhjdhj's icon

Arrggg--- you're absolutely right.

Score -1000 for Max 7.

If I had done this with Max 5, it would have been instantly visually obvious (see attached)

Thanks

screenshot_1187.png
png