Using OSC in MaxMSP

I want to use OSC to send messages out from MaxMSP with the [udpsend] message.

While supported by Max, it's not well documented though and I don't understand from its help file, what ip and port out I am supposed to use to send the messages?

I don't and information on using OSC in Max on the Opensoundcontrol website either really.

Anyone out there a master at this, that might throw some light on the matter?

Re: Using OSC in MaxMSP

hi,

I have been trying to get OSC working in Max using the mxj network objects rather than udpsend and udpreceive and the OpenSoundControl object.

The objects give the appearance of working fine between editable max patches but stop when i convert a patch into an app.

When i run oscdump from the command line i get

*** ERROR: SynthControl packet size (22) not a multiple of 4 bytes: dropping

though this message is received within max. I am thinking the mxj objects are not sending the osc bundle correctly

any ideas?

Re: Using OSC in MaxMSP

Thanks very much Thorsten,

One note, I don't see this opensoundcontrol´ Object from CNMAT, linked at this site on ´Implementations´ of which you speak.

Also, I wanted to mention that I managed to get Max/MSP to read OSC data coming from another program (using the udpreceive object) but not the other way around using the udpreceive object.

Just now I did some perusing on the Max forums and read that "What the udpsend object sends out does not comply with the OSC standard."

So I guess it's a question of just formatting the message correctly.

If indeed this is the case, then I'm not clear on how I should be formatting the message so that it matches the OSC standard.

Re: Using OSC in MaxMSP

I've just added it to Implementations, for future reference.

Re: Using OSC in MaxMSP

There´s basically not a specific port required :)

So, it is only necessary that the port you use for sending a message fits the one used by the receiving counterpart and it´s a good idea the port isn´t reserved yet. It should be noted though that for full OSC compliance you need the ´opensoundcontrol´ Object from CNMAT, linked at this site on ´Implementations´. For basic stuff, this won´t be necessary.

For internal loopback using the IP 127.0.0.1 a stripped down example would be:


#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 176 86 65 9109513 print received;
#P message 58 34 62 9109513 /hello world 1;
#P newex 176 60 82 9109513 udpreceive 57130;
#P newex 58 61 113 9109513 udpsend 127.0.0.1 57130;
#P connect 1 0 3 0;
#P connect 2 0 0 0;
#P window clipboard copycount 4;

For the IP, if you don´t want to use the internal loopback but send to another machine, you need to find out/know the target IP somehow. If you´re writing for a fixed setup, you can hardcode it into the ´udpsend´ object, otherwise use the conservative way which would be entering IP and Port for your udpsend object via Text/Number boxes with prepended "host" and "port" or scan the LAN for your target OSC receivers and use a menu - the last part isn´t part of Max or OSC itself, but can easily be accomplished usually. But we´ll talk about that if that´s what you actually need :)

Greetings, Thorsten Weinz