note busy status bit

seekyou's icon

Hi to everyone,
I want to create some variables to keep track of which notes are currently generated by a patch.
Let's say I take note in info up to a poly object (not poly~). Let's say my synth is for a guitar so it has a max polyphony of 6 notes. If I press one key, the corresponding bit of the string played should turn on (to 1) and reset (back to 0) when noteoff message is received.

In total I want to have six bit registers.

I tried to have this simple bit working but seems I can't find a way to route the noteoff message properly. I know it will be the same note (of the note on last message) with velocity 0.

Any ideas on making this working

m

spectro's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Roman Thilenius's icon

it might be easier to do that _outside_ the poly~.

a very basic version of counting the number of running notes would be to let
any note-on-event send 1 to accum, and any note-off-event send -1 to accum.

"60 127, 60 0"
[zl ecils 1]
[expr ($i1!=0) - ($i1==0)]
[t b i]
[accum]

Wetterberg's icon

don't forget [borax]

seekyou's icon

thank you everyone for examples/suggestions. spectro's solution is just the thing i needed.

m