zl size question

Ed Majcher's icon

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.

Roman Thilenius's icon

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

bkshepard's icon

[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.

Ed Majcher's icon

Everything works fine as long as I do a lookup for anything

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

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

Ed Majcher's icon

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

bkshepard's icon

Nevermind, I answered my own question.

Ed Majcher's icon

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!

Emmanuel Jourdan's icon

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 ;-)

Ed Majcher's icon

@Emmanuel

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).