Reputation: 23
I am playing around a bit with CoreMIDI in Swift on OSX, and got most of the things to work properly.
The only issue I have now is that my app is not seen by other software and apps and an available input/output. This is the case for in GarageBand, MIDIMonitor and the VVMidi test apps.
I tried multiple things, including this which seems to be the correct approach :
let clientCreateResult = MIDIClientCreate("MIDIApp", { (notification, _) -> Void in
print("Configuration Changed")
}, nil, &midiClient)
if (clientCreateResult != noErr) {
printError(clientCreateResult)
return;
}
let inputCreateResult = MIDIInputPortCreateWithBlock(midiClient, "MIDIApp In", &inputPort, MyMIDIReadBlock)
if (inputCreateResult != noErr) {
printError(inputCreateResult)
return;
}
let outputCreateResult = MIDIOutputPortCreate(midiClient, "MIDIAPP Out", &outputPort)
if (outputCreateResult != noErr) {
printError(inputCreateResult)
return;
}
Sadly no luck. I'm not sure what I'm doing wrong, I tried reproducing the exact same code as existing frameworks with no significant result.
I could really use some pointers as of why my app isn't listed in other ones.
Thanks!
Upvotes: 2
Views: 169
Reputation: 3838
Create a virtual destination. See the docs for MIDIDestinationCreateWithBlock
Upvotes: 3