tracking pixels in a matrix and output as individual numbers or list

Thinksamuel's icon

I have a matrix, where pixels change. Active state is white, inactive is black. I want to output a list of the active pixels, so the coordinates of every pixel. Then I want these pixels to be connected to a pitch. the jit.iter is almost what I want but I only get the last pixel (ok, the rest to, but I can't put them in a list).
In short, my matrix is connected to jit.iter and that is connected to the unpacks. However, how can I make a decent list of the active pixels that is easy to read?

Rob Ramirez's icon

one possible way...

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

Thinksamuel's icon

Almost, but I have 1200 pixels to unravel (a matrix of 40X30) and the unpack doesnt take that much outlets. What should I do?

Wesley Smith's icon

What are you trying to do with this list. I would strongly advise
against using lists. You should keep everything in the matrix domain
if possible. If you're going to audio, you could use jit.buffer~,
jit.peek~ etc.

wes

On Sat, Mar 1, 2008 at 3:27 PM, Samuel Van Ransbeeck
wrote:
>
> Almost, but I have 1200 pixels to unravel (a matrix of 40X30) and the unpack doesnt take that much outlets. What should I do?
>
>
>

Rob Ramirez's icon

entirely depends on what you're trying to do.
if you need to keep the cell coord info, i would use jit.iter, otherwise, you can stick a normal iter after the jit.spill.
each cell value comes through, sel 255 will send a bang if it's "active" and you can send that bang wherever you want.

or if you need to process the whole list in some way, look at the zl object or the listops objects.

if you just want to see the state of your matrix, hook it up to a jit.cellblock, couldn't be easier.

-rob

Thinksamuel's icon
yacine's icon

> Then I want these pixels to be connected to a pitch

what do you mean by "connected to a pitch"?

here's another way (when there are dozens)
-a coll to store
-jit.3m middle outlet to find the percentage.

next time you should start by posting a patch because your request is
really not clear... nobody here has the slightest idea about what you
finally want to achieve.
my guess is that the rest of your process contains the major problem.

one last advise, try to take it easy on the unpacks.

//yac

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

Thinksamuel's icon

Here goes the conway patch. I want to know which pixel is alive and from every pixel alive i want it to sent a bang (if then ...) to a makenoteobject. For that I need to output the coordinates of every pixel and its state. Most important is too know which cells are alive, and this in an automated way. I have written algorhitmic music once withdoing all the calculations and so by hand. I really want to avoid doing that again

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

Thinksamuel's icon

anyway, your solution seems to work good enough for now. I will be using this printed list to get my notes. Would it be possible to export the printed text in the max window to an excellsheet or so, then I can look easier which notes are common in every change of generation.

yacine's icon

the [print] was only there to illustrate.
if you don't know about the [coll] I strongly recommend you spend some
time reading its help file and especially the read, write & dump
messages.

anyways, I m out of this thread, good luck!

//yac

>
> anyway, your solution seems to work good enough for now. I will be
> using this printed list to get my notes. Would it be possible to
> export the printed text in the max window to an excellsheet or so,
> then I can look easier which notes are common in every change of
> generation.