I do this with the AKCallbackInstrument
. For each sequence track that I write MIDI events to, I have a sister sequencer track sending to AKCallbackInstrument
. When I write a MIDI event for the audio track, I also write a GUI event to the sister callback track.
Because you can only send MIDIStatus, MIDINote, and MIDIVelocity data to the callback instrument, you have to arbitrarily encode information into these formats. For example, a MIDINote of 0 might signify one type of GUI event, MIDINote 1 something else. Creating some enums makes this easy.
Of course the callback functions are called on a background thread, so don't forget to specify that your GUI updates should happen on the main thread.
This approach has worked quite well for me.
edit: I suspect you've already seen this sample code that illustrates something very similar, but this link might be useful for anyone else coming across this question.