Forums > MaxMSP

Unpack variable with select?

May 22, 2012 | 12:57 pm

Hey,

I am quite new to Max MSP too. I am receiving data and unpack it. Data format is ID, VALUE.

Now I want to send the VALUE for ID == 1 to X … ID == 2 to Y. I thought the select object would be right but maybe I am totally wrong and I have to use a completely different object (?)

My actual patch just passes the ID anytime instead of the VALUE for just ID == 1.

Thanks for your help
Steve

– Pasted Max Patch, click to expand. –

May 22, 2012 | 1:03 pm

Sounds like you’re looking for [route]:

`

– Pasted Max Patch, click to expand. –

It might be good to go through the help files for these objects if you haven’t already; what you’re doing there looks logical but the right inlet on select is for choosing which item/number to look out for, and the right outlet is for passing through items that don’t match. Route can work the same way. This could be useful if you want to do something with messages that don’t match your IDs. Try putting through a list beginning with something other than one or two here:

– Pasted Max Patch, click to expand. –

May 22, 2012 | 1:09 pm

A couple of things… First: If you want to use number boxes as input, its better to set your values via the numbers first then send them (via the button I’ve added). Otherwise, every change to the Var ID value will send a pair regardless of whether you intended to send them or not.

Second: Route will do what you are trying to do with Unpack and select – which won’t work as select only outputs a bang when the number it is looking for, not the number itself…

Edit: Doh! beaten by that much, again!

– Pasted Max Patch, click to expand. –

May 22, 2012 | 1:44 pm

wow, thank you both so much!

the input with the numbers was just a replacement for the external input from flash ;)


Viewing 4 posts - 1 through 4 (of 4 total)