Dynamically changing zl.group length

Phil Maguire's icon

EDIT - Just got it with the help of someone - [zl 32767 stream] works.

I'm looking to sample some data via a coll. The number of entries will be dynamic, so I need to get the number of entries, then create a list of that length to fill a multislider or matrix (or whatever else).

But I can't get zl.group to output a list longer than the default 256 entries. I've tried [zl 512 group] and I still get a 256 item list. And I need to be able set the list length to the number of entries in the coll.

Here is what I have. I'm sure the [if] section isn't very efficient but it's what I could work out.

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

double_UG's icon

@zlmaxsize

set zlmaxsize and bang zl.group when all is grouped.

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

Source Audio's icon

if you anyway need a list, why not merge incomming values into same coll line ?


If coll is not needed even simpler is to capture directly into zl.group

indexing the list if needed is also easy with listfunnel

Phil Maguire's icon

Thanks both!

@double_ug - I've tried that and for some reason the list maxes out at the default 256 item length. I don't get an error in the Max console.

@Source Audio - interesting! I'm sampling input from an arduino & motion sensor, so coll made the most sense to get the data in and then process. But maybe listfunnel could be useful.

Source Audio's icon

what Double_Ug suggested works 100%.
maybe you use older max version that needs different
arguments to increase max list length ?
the way you collect data from sensor, and when
the list has to be created is unknown parameter here,
also if you need time stamped capture or not etc.

for example you could decide to sample period of time,
or maybe only if sensor was enough busy over period of time or so many other possible factors...
my suggestion with merge would be helpfull to create several lists,
for example time based, every 10 minutes new line or so.
I think the main factor is maximum number of entries that one eventually has to deal with.

listfunnel would only help if you want to index list
captured in some other object to dump it into coll.

Phil Maguire's icon

Okay cool. Thanks for the info!

I'm on 8.5.5 - no idea why the message isn't working for me.

Source Audio's icon

maybe you still try to evalute coll length,
then set zl.group size, and after that bang.
take a look at my screenshots,
coll bangs when dump is done .
set zl.group to maximum ever possible list size with argument.
That must work.

Phil Maguire's icon

For clarity, I can edit the max list length and that works. I mean that [zlmaxsize $1] as a message doesn't seem to do anything.

Source Audio's icon

you mean that something like this does not work in 8.5.5 ?

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

Phil Maguire's icon

Ahh. That works! I didn't realise that zl.len also needed the message. I assumed it would read the length of whatever you sent it whether it was longer than 256 items or not.

Thanks!