Unpack message with variable length

Sjoerd Mol's icon

Hi,

I want to unpack a message with a length between 1 and 16 integers.
Every time I change the number to X, a X amount of random values between 1 and 16 are generated.

How can I unpack the last message when the length is changing?
In the end I want to check if a numbers is in the message and turn a toggle on/off when it is the case.
Maybe I have to use something else than unpack...

Thanks! :)

Sjoerd

Max Patch
Copy patch and select New From Clipboard in Max.

yaniki's icon

I think, you may be interested in and to build your construction on top on the [iter] object. Another solution may be made from the [zl.length] (to check current length of the list) and [zl.slice] (to split it).

mizu's icon

spray ?

Max Patch
Copy patch and select New From Clipboard in Max.

zzz

double_UG's icon

Max Patch
Copy patch and select New From Clipboard in Max.

I am not shure if you whant it like this. I turns the toggles on when the number is in list

double_UG's icon

Max Patch
Copy patch and select New From Clipboard in Max.

Sjoerd Mol's icon

Thanks for the answers! :)
It was exactly what I was looking for, thanks @DOUBLE_UG