zl size question

Jul 18, 2010 at 4:50am

zl size question

Does the order of zl arguments matter? For instance, I need to specify a zl lookup with a size of 1024, is this the correct format: “zl 1024 lookup”??? I keep have this very odd error which seems to be related to the size of a zl where upon restore a zl only process the 256th zl value.

Jul 18, 2010 at 4:59am

the order of arguments to patches and objects do always matter.

Jul 18, 2010 at 5:08am

[zl 1024 lookup] should be right. That sets the list length at 1024 (the default is 256). You still need to tell it which item to lookup in the list with an integer message into the left inlet.

Jul 18, 2010 at 4:24pm

Everything works fine as long as I do a lookup for anything < = 256, it is when I attempt to do a lookup on a value that exceeds the 256th element that it ends up defaulting to 256 which leads me to believe it is an issue with a zl. But they all appear to have the length specified correctly.

Jul 18, 2010 at 5:30pm

Try this, it works for me (Mac OS 10.4.11, Max 5.1.4).

– Pasted Max Patch, click to expand. –
Jul 18, 2010 at 5:38pm

thanks, that looks like it matches my implementation … i am starting to think this is another m4l glitch.

Jul 18, 2010 at 7:31pm

Nevermind, I answered my own question.

Jul 18, 2010 at 9:37pm

i found the source of my problem … i am saving the number via pattr as a int which in max for live cannot exceed 255. Funnily enough, normal operation, it works fine, only upon restore of a live set does the value get clipped at 255!

Jul 19, 2010 at 6:34am

I’m not sure I completely understand what your problem is, but the parameter type int is indeed limited to the range 0-255. You have to use float for larger ranges. I’m don’t really see what this as to do with zl though ;-)

Jul 19, 2010 at 8:53pm


Well, you are right, that is why I posted a response that absolved zl … i had list of parameters for a max device that exceeds 700+, I was storing the selected parameter (index>255) in a pattr object of type int. upon restore of the patch, I am reloading the list of parameters and then attempting to lookup the parameter via index in zl from the pattr but the number I stored get’s clipped at 255, so my lookup was failing in the zl. I initially thought my problem was with zl because earlier in the week I found that zl defaulted to 256, but I couldn’t find any misconfigured zl, which is why I posted initially. In the end it was the int max value (which I always assumed was greater then 255).


You must be logged in to reply to this topic.