Osc-bundle help

Hi. I just began a project I need to have done by tomorrow. Im receiving Osc messages from pure data, but I don’t understand how I can separate the data? In pure data you just route the osc and [ unpack f f f ], in my case that will be one objects x position, y position and rotation. How do I not mix these messages up in open frameworks? So far I just receive one message at the time and when I send a message with more that one number from pd, I only get the first one… I feel like there must be an easy answer to this. If pure data can do this, OF can too. But how?

if i understand well your question, you should use the getArgAs method to handle the data, For example in case of int type

 if(m.getAddress() == "/mouse/position"){
 			// both the arguments are int32's
 			mouseX = m.getArgAsInt32(0);
 			mouseY = m.getArgAsInt32(1);

How did you organize your code?

I have 12 tables with 4 objects on each table. A x,y,rot information is send as /tableOne/objZero/ . This gives three values. But they are constantly updated, so I don’t know how to separate the signals…

if the message is

 /tableOne/objZero/ 1.2 3.4 3.3 

where 1.2 is ‘x’ float value data, 3.4 ‘y’ float value data, 3.3 ‘rot’ float value data,

the code to receive this data should be:

if(m.getAddress() == " /tableOne/objZero/"){
// both the arguments are floats
x = m.getArgAsFloat(0);
y = m.getArgAsFloat(1);
rot = m.getArgAsFloat(2);

I think it seems to work. But what happens if only 2 signals are sent, like x,y and then x,y again, will it then think that the second x is rotation? Can that even happen? In pd I write

[pack f f f]
[send /objZero[

Anyway, if it works it is great. If it doesn’t none will be surprised…

Another question, in Pd the Gem shows movies that has alpha channels so I can layer many video files. But I don’t know how to do this with ofxVideoPlayer ? Is there a quick-fix for this or should I just use png files for this? (I only use video because it is quick to load 60 images and then show them by jumping to specific frame…)

but /objZero is part of the address of the message or is an argument of the message?
if objZero is an String argument you should add

String = m.getArgAsString(0);

if nothing is sent you will simply receive many zeros…

regarding the Gem question i think you have to create how many ofxVideoPlayer object you need and put each streams in a separate ofTexture and do whatever you want with it, adding shaders, alphas channels, or use the ofxOpenCv addon …

What is this now? bad acces… It started after I tried to draw a png file… !

if(bAllocated && w == width && h == height && channels ==_channels){
	return; //we don't need to allocate