Problem with UDP
Dec 11, 2007 at 8:12am
Problem with UDP
I am trying to send messages to max by UDP from a C++ program. I tried to send a string from a char buffer. However, I received errors such as :
1) net.recv.udp: OSC packet size(19) not a multiple of 4 bytes: dropping or
How can I resolve this error?
Also, is there any other way i can communicate betw. a C++ program and a MAX patch?
I would greatly appreciate some advice. Thanks in advance :P
Dec 11, 2007 at 10:56am
Udp communication in max is based on the OpenSoundControl standard.
A tip might be to use the udpsend object to send data to your program and check the received bytes to see how data is formatted by max. Format the data you send to max the same way.
For example if you input a list starting with a symbol to udpsend, you’ll see that the first element is interpreted as osc address, then there is the comma, then the characters indicating the types of the remaining elements of the list, then the remaining elements themselves.
For example if I input “ding ja 45 e”, the bytes look like this:
100 (d) 105 (i) 110 (n) 103 (g)
Note how every argument is padded with zero’s depending on the argument type.
Dec 11, 2007 at 7:25pm
Quote: tiutababo wrote on Tue, 11 December 2007 00:12
Ross Bencina has made an implementation of OSC in C++ here:
Dec 12, 2007 at 5:10am
Thanks for your replies.
I’ve tried udpsend using max. However, it seems to work fine… returning just a string on C++ instead of the OSC format. strange…
Dec 12, 2007 at 5:11am
I’ve tried to compile this in visual C++ 6.0. However, i keep getting errors.
Dec 12, 2007 at 9:18am
btw, I’m moving this topic to the dev forum
You must be logged in to reply to this topic.