If statements do not work when assigning matrix control cells to specific midi pad

D.S. al Coderrr's icon

I have been trying to assign the matrixctrl grid to my midi device pads and I have been trying to do this using two if statements. The first if statement is so that when a specific pad is pressed it outputs the desired cell onto the matrixctrl . The other is so that once the velocity of the pad pressed is 0, it should clear the cell it was assigned to on the matrixctrl.
However I am unable to get it to work how it should and would appreaciate some help in solving this problem

Thanks

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

Peter Ostry's icon

So far I understand you want [matrixctrl] buttons going on and off with certain notes.
If this is correct, the example below may help:

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

D.S. al Coderrr's icon

Thank you so Much !
That is exactly what I was trying to do. Is there a way in which I can do the same thing using the mouse as well ?

Peter Ostry's icon

What do you mean by "using the mouse as well"? You can click on the buttons with the mouse and operate the virtual keyboard (kslider). For this it must be set to polyphonic (it is, in the patch above).

What else should the mouse do?
Catch a cat?