UDP/OSC message serialization format
udpsend serializes Max messages into an "OSC compatible UDP packet". I’d like to try to do the same from an external program; i.e., I want to send commands to Max via UDP via a program I create myself. I’m guessing this has been done before, but are there any publicly-available examples or documentation for doing this?
Thats funny, because I tryed the same yesterday :) I wrote a little C# program with Visual Studio Professional… but I can’t send any message that Max understand. I tryed many OSC examples but no one works :(
If I found an solution, I will add that information here :)
If you do NOT need OSC, just pure UDP send/receive, you could try [sadam.udpSender] and [sadam.udpReceiver] from the sadam Library:
Hope this helps,
Okay, thanks to Jan I found a solution :) Thank you. I have to test a little bit around and write then a little how-to => I attach the how-to here ;)
I’ve been playing around with the official OSC tools a little bit, and it seems like
udpreceive can receive strings sent by the command-line
sendOSC utility. I’ve tried doing the equivalent in custom code using the C OSC client library (OSC-client.h), but I haven’t had time to resolve some formatting errors I get when I send messages this way.
In any case, even if that succeeds, I’d still like to know how Max serializes its data into OSC messages. If I’m not able to figure that out, then another option would be to write a parser in Max that takes string data from OSC messages and translates them into some action or data structure that is native to Max.
Give me some time, jeffomatic. I think my howto would help you to do the job without any OSC lib. I hope that I find time to finish that document in the next days…
Okay, here is version 1. In the next version I want to describe howto send numbers. Version 1 covers just text messages :) With this information you are able to communicate with Max from any programming language that can send byte arrays over UDP :)
Here my Max code to receive:
----------begin_max5_patcher---------- 269.3ocoRsrSCCCD7riT9Gr74BJIsUnvM9NPUH23E5hRVakrABTw+NNNOTJ4 .Twowd1GynQ643Hg5nsCZTx6kOJEhydFQfqmQLQHTU5thRcSnQEAuaO9pZyX MF53.uqFIVhzbkmsD2feB8USytMYhmZqrsbIvg8MS6zbwIjd4oZnfGrTdheJ Y1t.r6tvG+a4gkRP5pfDpGpQc4r5nIP5s5MaUKjFoIkSCjeEG0idXy+NBZMN u4A7MPtOII4JShzeMIRy22C44qShg8ve3fgATpqMkx9aozvZUkHs5vI369B+ H6Zrs0ES9ZTJ4BuafFFIMiVZQSauroSnw.zEWLUnwY8Gci9PdXkUii7v2Xk+ jVI -----------end_max5_patcher-----------
Version 2: I added an UML diagram for building a text message :)
Here we are: Version 3 :) I added the information how to send numbers (integers and also floats) to Max. In chapter 3 I provide a quick and dirty implementation with Microsoft C# 4.0 to show how to do that :)
Next goal: How to receive messages and numbers from Max MSP.
Max’s UDP objects support pretty standard, if simple, OSC. There are a few Java OSC libraries out there (which makes them usable from Python, Clojure, Ruby and so on) – I’ve written one and Mattjis Kneppers has just implemented one.
Just wanted to say that I found this helpful when putting together an external UDP connection to Max. Thanks!
What is the scoop on addresses? It seems that when sending to Max, the address just comes through as part of the message (prepended to the list). Is the intent to use this on a [route] object or something?
Hey Vektoren, I’m not able to open those pdfs you posted back in 2011. I’ve tried in both firefox and safari on a mac– has anybody been able to open these?
I was able to save the pdf to the desk top, then open it with Preview.
strange, tried that, doesn’t work– do you mind emailing your pdf to me Rick?
terrymc at pacific dot net dot au