i’m using the MidiKeyboardComponent for two purposes
- to represent icoming MIDI events, those events are coming from a MIDI device
- to send MIDI evens based on mouse/keyboard input from the user
When an event arrives on the MIDI device it’s added to the MidiKeyboardState by processNextMidiEventCall(), this state is linked to the MidiKeyboardComponent and the GUI updates. But since my class is also the MidiKeyboardStateListener, the handleNoteOn/Off calls get called and my class transmits MIDI data, the same way it transmits data when the mouse or keyboard is used to “press” the onscreen keys. So i get two noteOn/noteOffs instead of one: one comes from my code that is the listener of the state, the other comes from the MidiKeyboardComponent that is also the listener of the same state.
What’s the way out of this ? I thought i could maybe tell the MidiKeyboardComponent explicitly when to paint some noteOn events, but there is no interface to that (or at least i don’t see any other then injecting noteOn events to the MidiKeyboardState), i could do that since my callbacks on incoming MIDI data is async and i can safely interact with the GUI. Is there some other way i could do this ?