I wanted to make an app that communicates with MIDI interface accessories for iOS. I bought an MFI licensed device (iConnectMidi), plugged in, and created a simple project that calls [[EAAccessoryManager sharedAccessoryManager] connectedAccessories]
after app launch, but was not able to get accessories read in. I was wondering if anyone that has similar experience can shed some light on this?
Asked
Active
Viewed 955 times
2

Sterling
- 161
- 9
-
I don't think you can communicate with MFI devices unless you are the license holder. Otherwise anyone could write code to talk to any device, which would clearly be a security hole. – par Oct 16 '16 at 19:45
-
But some accessories (like the one I bought) can work with many apps, how is that possible then? – Sterling Oct 16 '16 at 19:48
-
Ok then, did you add the protocol specifier to your Info.plist (via `UISupportedExternalAccessoryProtocols`)? – par Oct 16 '16 at 19:49
-
Well, I don't have it...It seems the only way to obtain it is to get it from the manufacturer, but do I have to have it? I tried using other apps with this device and it works. I don't think other developers all have this manufacturer's protocol string. Unless there is a common one for midi interface? – Sterling Oct 16 '16 at 19:54
-
You'll have to talk to the manufacturer. I've only ever worked with MFi devices where the company I was working for was the license holder, but you have to specify the protocols you support in your Info.plist or your app won't be able to see the device. – par Oct 16 '16 at 19:55
-
I haven't worked with midi devices either, but maybe there's a way to get to it through AVFoundation or similar. Going through the accessory protocol is basically for raw access to the device and is pretty low level (for power management, configuration, etc.). There may be a higher-level audio interface API that will connect generically to any midi device but I'm sorry I don't know what it is. – par Oct 16 '16 at 19:58
-
1As I suspected, Apple has a MIDI framework, see https://developer.apple.com/reference/coremidi – par Oct 16 '16 at 20:04
-
Oh I see. Thanks. I might have gone the wrong route... – Sterling Oct 16 '16 at 20:06
-
So you are right par, I tried a core midi sample code and was able to detect my device. Thanks a lot! – Sterling Oct 16 '16 at 20:31
1 Answers
2
As par mentioned in the comments above, if you don't specify the protocol string in the plist, the app won't recognize the device. In my case I am using a MFI midi interface, the EAAccessoryManager won't read the device because I don't have any protocol setup for the UISupportedExternalAccessoryProtocols
field in the plist file. However, I was able to detect the device using the CoreMidi framework. There's a little sample code I found https://github.com/petegoodliffe/PGMidi, if anyone ever comes to the same confusion I had.

Sterling
- 161
- 9