alternatives to (un)pack

jamesson's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Is there some neater way to do this?

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

Joe

willyc's icon

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

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

willyc's icon

They say a patch is worth a thousand words....

jamesson's icon

Awesome, thanks!

Wetterberg's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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:

jamesson's icon

Wittenberg

Sorry, I'm confused about what this does

Thanks

Joe

Wetterberg's icon

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.

jamesson's icon

Oh, that's what cnmat oscroute is for - do you know it?

Wetterberg's icon

yes, and I'm using regexp instead :)

Wetterberg's icon

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