Coll performance for getting MIDI held notes

Valentin Leroux's icon

Hi,
A few topics about getting a list of currently held notes on a MIDI keyboard already exist, but I was curious to make my own.
For some reason, my version appears to be very slow compared to @Leafcutter's one : (store) and (remove) messages are sent in real time to my [coll] object (as seen with a print) but they populate [coll] with about 200/300 ms of latency.
Do you have an idea of what I'm doing wrong ?
Thanks !

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

Source Audio's icon

both examples in your patch are not the highlight of efficiency,
but your problem is the jit.cellblock.
Delete the left one and replace it with the right one.

I have no time to look at it and tell you why it is so slow.
and try this simplified way :

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


double_UG's icon
Valentin Leroux's icon

Thanks Source Audio for your help, using [if] is really efficient !

And thanks too, Double_UG ! Shame on me, I had never noticed this parameter, now everything works perfectly :)