Forums > MaxMSP

Shrink jit.matrix based on cell contents?

October 21, 2013 | 5:21 am

Hey,

I’m looking for a way to shrink a jitter matrix based on cell contents. I have a very large matrix right now and I wold like to remove any cell that is equal to "0 0". That means that the matrix would go from being larger than 100 x 100 to a variable size that is based on the number of cells that contain a value. I’m obviously not interesting in maintaining cell position, but I’m only interested in a list of the data contained in the cells.

Thanks for your help!


October 21, 2013 | 8:33 am

On second thought, I just found the jit.spill object, which can only print out a pretty small list. Is there a way to restrict the matrix data before jit.spill so that jit.spill will only receive and output cells with a value != 0 ?


October 21, 2013 | 2:05 pm

This may work for you.

<code>

– Pasted Max Patch, click to expand. –

</code>


October 21, 2013 | 2:17 pm

If you want to get around the list length issue, you can use jit.iter

<code>

– Pasted Max Patch, click to expand. –

</code>


October 21, 2013 | 4:41 pm

Awesome! Great call on ‘jit.iter’, totally missed that. Thanks for the examples, this is exactly what I was looking for.


Viewing 5 posts - 1 through 5 (of 5 total)