MidiKeyboardState::allNotesOff()


#1

I’ve noticed that calling allNotesOff() actually calls noteOff() for all pressed keys (after finding those that are on)

I just want to stop all notes quickly and reset the keyboard, without calling any noteOff() listeners of such,
Will you consider adding a method that calls reset() and adds a all-notes-off MidiMessage to the processNextMidiBuffer()?

Thanks


#2

You can change reset() to reset(bool alsoSendAllNotesOffMessage = false)


#3

No, I don’t think that belongs in that class… Why don’t you just send an all-notes-off message yourself if that’s what you want to do?


#4

Cause then I’ll have to periodically add objects to the processBlock() function
while I already have this flow going on with the keyboardState.processNextMidiBuffer() in the processBock() using the injectIndirectEvents.

It’s not that I’m too lazy to do it, my sequencer moves its notes to the processBlock() using the MidiKeyboard, and creating another flow just for the allNotesOff message does not feel right.


#5

Sorry, I really don’t see why it’d make sense to complicate the class like that.