Unpacking 3 number values from a msg

Feb 25, 2012 at 6:35pm

Unpacking 3 number values from a msg

Hi, how might I go about incoming streaming numbers in a single message. I feel [unpack] might be a good way yet am unsure how to implement this… i have attached a picture of what the message looks like.

#61974
Feb 25, 2012 at 6:37pm

The number message attached

[attachment=186377,3425]

Attachments:
  1. Screenshot20120225at18.30.12.png
#223824
Feb 25, 2012 at 6:55pm

Could you specify a bit more what are you looking for, or what would you like to do with the numbers?
Generally speaking, you could unpack such a message with [unpack f f f].

#223825
Feb 25, 2012 at 6:56pm
– Pasted Max Patch, click to expand. –

dont forget about “.” after 0 in unpack message, it makes this object work with floating point numbers. are you using help files? its a very handy way, to learn max and can help you a lot solving problems :)

#223826
Feb 25, 2012 at 8:29pm

Thanks for your help guys. I got as far as this, I should have said. Appologies, I will outline what is happening. The three sets of number is accelerometer data and streams in at a fast rate. I would like to split that into three equally fast streams of different number boxes – the unpack object as far as I can work it needs to have a bang from the original message (of three numbers that I posted a picture of) first before it splits the number. I looked through the help files and the only way I could figure to do this was to send a load of bangs e.h [metro 1] to the message to output the numbers at anywhere near the right rate. There must be a more sensible, more cpu friendly way though…

Thanks for your help and if I have missed a key issue here, apologies.

#223827
Feb 25, 2012 at 8:31pm

I basically want to send each different set of values out as midi data so I need it to be outputted at the same rate it comes into the original message.

#223828
Feb 25, 2012 at 8:35pm

The unpack object doesn’t require a bang, just a list. However in the picture you posted, you just set the value/contents of the message box. In other words, you connect some object above it to the right inlet of the message box. Just connect that object directly to [unpack] and it’ll work.

#223829
Feb 25, 2012 at 8:44pm

I’m an idiot. Thanks for your patience and help.

#223830

You must be logged in to reply to this topic.