set cell in jit.matrix

Kim's icon

Hello
I have a problem with my work.
When the volume is more than 50 , I want to fill the cell in red.
Otherwise, I want to make the red dot move continuously and sequentially.
To sum up, I would like to fill the cell on the spot only if the volume is above 50, and let it pass if it is smaller than 50.
But It doesn't work... What should I do? :(

Thank you.

02_matrix_final_31.maxpat
Max Patch
Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

instead of "erasing" all the cells in the matrix (setall 0 0 0), just delay the count and then set only the previous cell (stored in zl reg) to 0 0 0. Then you gate that delayed erase message so it _doesn't_ erase when the sound goes above the threshold:

Kim's icon

Thanks a lot for your explanation. It works very well. You helped me a lot ! :)
great, thank you