With the beta version of Pythonista it looks like it might now be possible to get CoreMIDI access going.
I know that there are several issues surrounding this like needing to have the audio key in their UIBackgroundModes in order to use CoreMIDI’s MIDISourceCreate and MIDIDestinationCreate functions. These functions return kMIDINotPermitted (-10844) if the key is not set according to Apple docs.
Pythonista seems to have the ability to play background audio now - but does that mean it has the audio key set?
In looking at CoreMIDI I see that it is more of a "C" API. It does not have many Objects - only Functions that can be called. Can you show an example of how to access a framework like this? I have just tried:
CoreMIDI = NSBundle.bundleWithPath_('/System/Library/Frameworks/CoreMIDI.framework')
CoreMIDI.load()
Which seems to work and does not throw any errors. I think I would like to do something like this C code next:
MIDIClientCreate(CFSTR("simple core midi client"), NULL, NULL, &(_midiClient));
... but since this is straight C code there is no obvious NSObject to create with methods to call to do this using objc_util.
Please feel free to waive me off, if this is going to be a dead end for any reason.