pack and unpack discrete lists

Apr 22, 2013 at 5:32pm

pack and unpack discrete lists

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.

Apr 22, 2013 at 5:47pm

zl lace / delace
zl group /slice

Apr 22, 2013 at 6:37pm

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

Apr 22, 2013 at 9:40pm

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.-)

Apr 22, 2013 at 11:05pm

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 :)

Apr 22, 2013 at 11:18pm

zl len

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

Apr 23, 2013 at 1:23am

@OP it seems you need a [dict]…

– Pasted Max Patch, click to expand. –
Apr 23, 2013 at 2:37pm

Andrzej, BRILLIANT!!!!!

Apr 23, 2013 at 6:26pm

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


You must be logged in to reply to this topic.