alternatives to (un)pack

Jan 17, 2012 at 10:14pm

alternatives to (un)pack

Is there some neater way to do this?

– Pasted Max Patch, click to expand. –

To be specific, I’m trying to split a test string and 32 floats while keeping the floats together and in order. Surely there’s a better way than the above mess?

Thanks much


Jan 17, 2012 at 10:26pm

In your example, are you always dealing with a list comprising a single symbol followed by n (32 in your case) floats?

[zl slice 1]

Will do the trick

Jan 17, 2012 at 10:28pm

[edit willyc beat me by a minute, but only because I provided an example :-) ]

– Pasted Max Patch, click to expand. –
Jan 17, 2012 at 10:33pm

They say a patch is worth a thousand words….

Jan 17, 2012 at 10:54pm

Awesome, thanks!

Jan 18, 2012 at 7:04pm

also, in the case of OSC, a structure like this can help keep your hierarchy of incoming messages intact over time, as the number of inputs grows:

– Pasted Max Patch, click to expand. –
Jan 18, 2012 at 11:37pm


Sorry, I’m confused about what this does



Jan 19, 2012 at 6:21am

It strips away / and makes it a space instead, so you can use a normal [route] object to parse the message.

But again, this was in the case of OSC – if you’re not using that then just ignore it.

Jan 19, 2012 at 6:43am

Oh, that’s what cnmat oscroute is for – do you know it?

Jan 19, 2012 at 7:32am

yes, and I’m using regexp instead :)

Jan 19, 2012 at 7:32am

and there’s jmod.oscroute too, which is nice as well.


You must be logged in to reply to this topic.