isNoteOn(bool returnTrueForVelocity0=false) - default param


#1

Hi Jules

I have this issue with this functions default value when I get notes with small velocity (0.00732…) and then isNoteOn() returns false
and then things get messy.

Now sure I can prevent it in my code or just use isNoteOn(true), but wouldn’t it be better to just change it to true by default?

Thanks


#2

Don’t really understand the problem…? Why would I change the default, rather than you just giving it a parameter of true if that’s what you want to happen?


#3

It just seems more natural: 0x90 = note on, 0x80 = note off


#4

Many (most?) synths treat a note-on with vel=0 as a note-off. But I provided the parameter to give you a choice of behaviour, so what’s the problem?


#5

No problem at all, it was more like a suggestion, I thought that considering velocity = 0 as note off is the less frequent case.


#6

Ok. If I was to change anything with that method, I think the correct thing to do would actually be to remove the default altogether, and force people to specify the behaviour they want.