Block MIDI input from only several notes

Andrew Shershnev's icon

Hi guys!

I'm trying to build a Max for Live MIDI effect that acts as a note filter based on user selection in an 8x8 live.grid (Novation Launchpad Pro). I'm an absolute beginner in Max, so I don't know much.

The grid should be a fixed range of 64 MIDI notes, starting from C1 like a Novation Launchpad layout (User mode, image attached).

Novation Launchpad User Layout

If pitch of an incoming MIDI signal corresponds to a cell that is "ON" in the live.grid, the note should pass through.

If pitch of an incoming MIDI signal corresponds to a cell that is "OFF" in the live.grid the note should be blocked (i.e., not sent to the noteout).

What I've Figured Out:

I can use notein to get pitch, velocity and channel. Then pass a pitch to the sel with some value (e.q. 60 (C3)) and then pass right outlet of sel to the noteout pitch inlet. It blocks only one manually specified note, but I want to set notes via live.grid.

I know that I can make a rack and specify its note range, but if the same following chain should be triggered by different non-adjacent notes it requires me to copy it and specify another note range over and over again.

Thanks for any guidance or examples you can share!

UPD: TIL that I can use zl.filter to filter several notes, but now can I connect a 8x8 live.grid to it to represent a Launchad layout?

This is what I came up with

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

Source Audio's icon

midiselect object could be handy for that.

your filter has a problem because you only filter note on messages.