Receiving an Array in Max from OSC.

Marigold Maripol's icon

Hi all-

I'm sending an array of values via OSC from another app on my computer.

I'm getting the following error message:
udpreceive: OSC Unrecognized type tag b. Unable to process message.

I may not understand OSC correctly, so maybe someone could help direct me towards some information on the proper protocol for how to send multiple numbers in one message?

Marigold Maripol's icon

It seems that if I specify [udpreceive 7771 CNMAT], I can receive a "full packet" message - but it seems to be encoded and I'm not sure how to decode.

TFL's icon

To deal with full packets, check the 'odot' package by CNMAT, in the Package manager.

But looking at your first issue, maybe your problem comes from the way you format your OSC messages on the other computer.

Source Audio's icon

what exactly are you sending ?

array of values or OSC message ?

anything to do with OSC needs / based messaging.

check odot package or OpenSoundControl (older stuff)

if you are sending only string of values,

then look into sadam package.

Marigold Maripol's icon

I'm dealing with an array of floating point numbers. I can send them as a string and see them with o.atomize, but it seems to round to integers. The "FullPacket" message does not resemble the incoming set of numbers.
More than simply downloading a package and relying on a prefabricated solution, I'd like to understand what is going on here and whether there is a way to solve it within Max itself. That way I can understand the protocol better in the future.

Source Audio's icon

then post what software is sending it and in what format.

array - you mean a list with float values ?

Marigold Maripol's icon

Yes, I am sending a list of float values from Processing. I think maybe the idea of a "list" in Max is a little different than how I would normally think of it. I've tried a couple of different ways of formatting the information at this point, though none of them have been successful yet.

I'd essentially like a dozen (or more..) floating point numbers in a single OSC message. Is this possible?

Source Audio's icon

As I allready mentioned, if you use OSC

then you can't just send a list of values like

0.1234 2.333 etc.

OSC must have OSC string, like

/xyz 123.456 222.333 etc

udp is network protocol,

not necessary OSC.

max udp send/receive can send messages without OSC formatting.

processing needs oscp5 OSC library to properly format it

Source Audio's icon

P.S. if you don't need to receive data in processing, simpler version can be used

  • import oscP5.*;

  • import netP5.*;

  • NetAddress ToMax;

  • void setup() {size(100,100); background(0);

  • ToMax = new NetAddress("127.0.0.1",6666);}

  • void draw() {}

  • void mousePressed() {

  • OscMessage fl_array = new OscMessage("/floatArray");

  • fl_array.add(new float[] {1.1234,2.2345,3.3456,4.4567});

  • OscP5.flush(fl_array, ToMax); }