patch reads and prints all white pixels as list, but only 256 maximum, how come?

Ali's icon

Hello all!

Attatched is the part of my patch im having a probelm with

The forum link below is where the idea started,
forum poster 'MIB' has been very helpful
https://cycling74.com/forums/quick-store-patterns-in-coll

basically I can draw live cells into a jit.pwindow and then clicking the 'bang' produces a list of all the live cell coordinates. I have only recently noticed that it works for upto but not more than 256 live/white cells/pixels.

how exactly do I specify a new limit for the produced message (ideally I would like the limit to be every cell *in this cae for a 64x64 matrix i would need 1024)

I understand the Zl objects organise the data, search for live cells *donated by the number 255) and orders them into a list, but I can't understand why I can only have 256 cell coordinates saved.

Any help would be greatly appreciated as I have to draw patterns larger than 256 cells in by hand each time

Many thanks,
Alan

2464.matrixlivepixelsmax256inlistwhy.maxpat
Max Patch
MIB's icon

have a look at your subpatch called "p jit.spill Number of Live Cells". in there you have a zl object with an extra argument [zl 4096 sub 255]. That extra argument sets the internal "buffer". by default zl objects work with 256. give it an argument (I think 4096 might be the max) or send it the message "zlmaxsize" to change that buffer. that should do the trick...

Ali's icon

Hi MIB, I have treid your suggestion of both sending the 'zlmaxsize' message and also putting in 4096 to try to set the buffer. Both ways I still seem to get the max 256 value list. Just in case i worked it out wrong I tried sending the message to every zl object, changing arguments for other object etc and still no luck.

when you say 'give it an argument' do you mean the 4096 from [zl 4096 sub 255] in the subpatch? isn't this already specifcying the maximum size as 4096?

zlmaxsize in the help file says to send the 'zlmaxsize n' (n is the number) but I've tried lots of combinations and just end up at the same point. I'm confused

Alan

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

maybe I'm misunderstanding the problem, but this seems to work for me. I definitely get lists longer than 256 this way...

Ali's icon

Hi MIB, your right it works fine, Stupidly I didn't leave a space between group and 4096, rookie error

thanks for your help again it works just fine

Cheers ;)

Alan

Ali's icon

I can draw in any pattern into the jit.pwindow and click BANG to create a message of every live cell

so...

if I create a big list as a message then add it to the coll it appears in the coll as the entire full message. but if I load the preset pattern in the top right that is the pattern the ENTIRE message is a list of, , , then why do I still get only the first 128 cells (thus 256 live co-ordinates) only

The '4096' is put in for all zl objects (including the sub-patches and makes no differnece.

I still get a huge message of over 256 entries but when I load the pattern i get just 256 that appear in the window. Is there another argument I can specify for something that is responsible for storing or drawing the cells when the preset pattern is chosen.

My head says it tin the [p celldraw] but I can;t figure out where (if this is even the problem. Or perhaps the drop down menu has an argument somehwere to tell it to remeber more than 256 elements.... its driving me nuts so any help is truly welcome

regards, Ali

2492.Collentrysystemcanonlysavethelast25.maxpat
Max Patch
MIB's icon

works like a charm once you put [zl 4069 iter 2] in your [p putit].

My good deed for the day is done ;)

Ali's icon

Thats the puppy!, thanks again MIB, you've been really helpful

Ali