Get track of actual MIDI Note-ons

playmodes's icon

I would like to have a list which includes notes which are actually ON.
These note-ons would be erased from the list as soon as a Note-OFF arrives.

Does anyone know of an object, external or code chunk that performs this task?

Source Audio's icon

That can be done in many ways, the best choice would depend
on what kind of list You need.
For example You could store Midi Note Numbers in the coll when Note On numbers is received,
and delete them when Note Off gets received using remove message.

playmodes's icon

Hey Source Audio, thanks for your advice!

Actually i could solve my problem thanks to some help from the forums!
I added my spicy touch of spaghetti coding, and i already have what i was looking for, which i share here, just in case someone finds a need like mine.

This is part of a larger patch that analizes a 64*35 pixels image, and generates a note-on for each pixel that goes from black to non-black, and stays ON until the pixel goes back to black.

Because 64*35=2240, which is far beyond the 127 notes possible in a MIDI channel, there are at least 17 (2240/127) repetitions of the same note pitch value in this 64*35 matrix, making it possible to have many simultaneous note-ons for the same pitch if enough pixels which share this pitch are lit.
Problem comes when just one of this pixels goes to black, because a single note-off is going to switch off all the notes off, but there are still the other pixels lit but with no sound. I could solve this by generating a note-off just if all the number of note-offs received equals the actual hanging note-ons.

On the other hand, if a note-on for a specifical pitch has been generated but still waiting for a note-off, new note-ons for the same pitch are ignored.

All this makes sense in my situation, as i am working with a real pipe organ which has its own specificities, limitations and of course, advantages!

Thanks everyone for your help!

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