Fading matrix to black

freeze's icon

Hi!

I would like to fade a matrix with a dynamicly created content slowly to black. I've made an example maxpatch attached at the end of this post that shows how it should work.

Every click on the button "create square" creates a white square in the pwindow. The matrix should fade by and by to black, so the white squares can have different grey values whenever the user clicked on the button.

I'm trying since hours how this could be made. I thought about recursively methods but you can't make
recursively loops in Max without creating an error. I've also tried to use jit.op somehow, but with no success. Perhaps there's an easy way to do this. But unfortunately I have no idea.

It would be great if anyone can give me a tip. Many thanks in advance.

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

freeze

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

you need to use feedback with jit.op. take a look:

freeze's icon

Hi Robert!

Thank you very much. Exactly what I needed.

freeze

tep's icon

HI,
I need to achieve something quite similar to this.

I have a 10x10 video that i use to drive a 10x10 led matrix. All i need to do is : each time you have a pixel that goes to "ON" (let's say, value = 100, or 255 if you prefer), i'd like it to fade out to black just after it goes to 255, or also have the possibility of doing 0>fade to 255>fade to 0, at a specific (fixed) speed.

I don't really understand how to use jit.op ....

tep's icon

Ok, a friend helped me to find out that jit.slide @slide_down [ms value] does the trick. Thanks to you Adrien.