Handling null-velocity NoteOn as NoteOff (with setting), inlined some methods.