Kyz
Kyz

Reputation: 141

Send midi with AKSequencer over virtual output

I’m trying to send a midi data from a .mid file with AKSequencer(), on a virtual output to use it outside the app (more detail below). My problem is my AKSequencer doesn't send midi outside my app like I would like to do with the virtualOuput port.

// My midiOutput is set like this: 
    let midiOut = AKMIDI()
    midiOut.createVirtualOutputPort()
    midiOut.openOutput() 

//And my AKSequencer connect to the midiOuput like this: 
     sequencer.setGlobalMIDIOutput(midiOut.virtualOutput)

To enter into details, I’m trying to send MIDI over Bluetooth from an iOS app to a DAW. Thank the CABTMIDILocalPeripheralViewController. it’s very easy to set up a connection to send midi when two devices are connected established. I achieve to send midi with AKMIDI().sendNoteOnMessage() so I’m sure the connection is not the problem.

Upvotes: 3

Views: 400

Answers (1)

cem olcay
cem olcay

Reputation: 357

Sending MIDI outside with AKSequencer a bit tricky. You need to either use AKMIDICallbackInstrument or your own AKMIDIListener to get MIDI from the sequencer and reroute outside of your app by AKMIDI output.

There is a discussion on this thread: https://groups.google.com/forum/#!topic/audiokit/6VkayJMpMvY

Also, you may want to check out my MIDISequencer library built top on AKSequencer with iOS and Mac examples: https://github.com/cemolcay/MIDISequencer

Upvotes: 3

Related Questions