Count the number of different notes down

chapelier fou's icon

Hi, i am struggling trying to do this :

i want to count how much "different" midi notes are held down. By "different" i mean ignore the octaves. So if i hold C1 and C2, my count should be 1, not 2.
Putting %12 before a borax is not ok, because if i hold C1, then press C2, then release C1, my count will be 0 instead of 1.

A smart combination of stripnote and borax should do the trick, but for some reason i cannot find a solution.

Any idea ?

dhjdhjdhj's icon

Calculate the mod of the number [% 12] to fold all values into a single octave then just increment or decrement an index in a [table] or other array as you detect notes being played or released using stripnote

chapelier fou's icon

Thanks, i'm not used to deal with [table] but will investigate in this direction !

Stephane Morisse's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Well, kind of...

mzed's icon

Here's a pitch-class accumulator to get you started.

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

chapelier fou's icon

Thank you for the examples.
It gives me good hints !

ak's icon

A variation of Stephane's idea with smaller number of objects:

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

Stephane Morisse's icon

Nice one AK. Love when others strip down ideas !

chapelier fou's icon

Super nice !
Thank you very much !