Forums > MaxMSP

pack and unpack discrete lists

April 22, 2013 | 5:32 pm

I want to combine 3 or more different items/lists and then send those into a poly~. Once inside the poly~, I then want to unpack them into their respective lists. The reason I want to do this is to get data lists that are associated with each other into the same poly~.

– Pasted Max Patch, click to expand. –

EDIT: These lists will be of variable length.



dtr
April 22, 2013 | 5:47 pm

zl lace / delace
or
zl group /slice


April 22, 2013 | 6:37 pm

I thought that but given that the lists contents are variable I am not sure how to implement those.


April 22, 2013 | 9:40 pm

Before you lace or group, you could get the lengths of your lists and prepend that. Then, inside the poly~, slice off the list lengths (which I understand to be a constant length), and pass those parameters to your zl delace/slice guys.

If the number of lists itself is variable, then you’ll have to prepend *that* value in front of all the others, then handle that in your poly~. You may try scripting the patcher inside your poly~ to do this, or it might be easier to hardcode a maximum number of [zl] guys. Or there are other approaches.

At this stage you might want to start looking at Javascript, or one of the other procedural languages you can talk to in Max as an alternative. Depends on what you find the most productive path to Nirvana.-)


April 22, 2013 | 11:05 pm

If I can get the list length that would be good. What’s the best way to get that? I looked at [zl] but do not see where it outputs list length. Is there another object I should use? I want to avoid coding since I know nothing if it :)


April 22, 2013 | 11:18 pm

zl len

I fear this may be too ambitious a project for a "cargo cult" approach



ak
April 23, 2013 | 1:23 am

@OP it seems you need a [dict]…

– Pasted Max Patch, click to expand. –

April 23, 2013 | 2:37 pm

Andrzej, BRILLIANT!!!!!


April 23, 2013 | 6:26 pm

Just in case you missed it, I implemented a similar approach, using coll, in the other thread:

http://cycling74.com/forums/topic.php?id=46746


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