How many items can a list contain?

Thinksamuel's icon

Just to be sure so I do not run into troubles later on: What is the maximum number of items a list can contain?

mzed's icon

The default limit for objects is 256 items, but the zl object (at least) can do up to 32767. Look at the "list length" tab in the zl help file. Also, other data types (jitter matrices) can hold more items and third party objects don't necessarily have these limits.

metamax's icon

I think it depends on the object. As mentioned, zl objects default to 256 but have an actual limit of 32,767.

However vexpr can only handle lists up to 4096 elements

I also seem to recall hitting a limit in the length of an expr argument (characters in the formula) In think 256? Hopefully someone can confirm that.

Thinksamuel's icon

Using zl len I get 256 as the length. However, the mapping is performed and the output message box seems to contain all values. What would be an alternative external to use a bigger list? I think the maximum number of items I will use would be 10000 but I think I can limit it to 4096 if there would not be any alternative. In either case, I should be able to handle more than 256 values at a time.

Emmanuel Jourdan's icon

With [zl.len @zlmaxsize 10000] you will be able to get the length up to 10000 items.

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

This patch seems to do the trick but I am still confused about the two arguments. What is the difference between list length and list size?

convertedtotext.txt
txt
bertrandscherrer's icon

I too have encountered a limit number of arguments for the expr object.

Is there a way to change that maximum number of arguments ?

I have attached the problematic expression I would like to evaluate.

Thanks for your help !

expr_too_long.maxpat
Max Patch
vichug's icon

i can't seem to open your patcher here !

vichug's icon

@thinksamuel (even if late) : the zlmaxsize is the maximum size of a list that can be processed. The length given by zl length is the actual size of the list. Therefore, zlmaxsize will always be superior or equal to a list length.

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

@vichug: sorry about the patch: here it is inline: