I am working on an application where i generate note on/note off and put those events in a MIDI Buffer seperated by a time interval (250ms for example).
I then want to feed the buffer to a MidiKeyboardState which is hooked up to a MidiKeyboardComponent. The MidiKeyboardComponent is a listener of the MidiKeyboardState.
I am calling MidiKeyboardState::processNextMidiBuffer with my buffer in the audio callback. This calls processNextMidiEvent for the note on and note off which calls noteOnInternal/noteOffInternal. This in turn updates noteStates twice, once when processing the note on and once for the note off. The result is that in the MidiKeyboardComponent nothing gets drawn.
This is because MidiKeyboardState/MidiKeyboardComponent don't seem to care about the timing of these events. Am I correct or am I missing something?
What's the proper way to visualize this and to make sure MidiKeyboardComponent displays the key going down briefly?
I could of course put the note on/off in 2 seperate buffers and then somehow pass these at the right time to processNextMidiBuffer (??????) but this seems like a hack and I can't believe there isn't a better way in JUCE.
Thanks for helping!