Hi, I’d like to create a virtual midi port on my iPad to send message to some apps as Cubasis or AUM, but unfortunately with this code that woks on desktop app doesn’t work on iPad: the virtual port is not detected by any app and when I try to click a button that create a message to send to that port the app gives me the error: JUCE Message Thread (1): EXC_BAD_ACCESS (code=1, address=0x1c8).
Really Thank you! I suppose that virtual midi ports exist also in iOS because I noticed that when I open a synth app I could send midi message to it through a port that the synth creates at opening (for example I opened Kaspar, Igrand, iSynphonic, synthmaster one and after cubasis and from cubasis I have a list of output midi ports with the name of apps opened through I can send message from cubasis to these other apps).
I tried again creating new project, this time choosing audio plugin from wizard in Projucer enabling in setting only standalone and IAA, after I created a new midi output device and a new midi input device but nothing change. Here what I’ve done:
on Plugin Editor I put under private members those two variables:
MidiInput* mi;
MidiOutput* mo;
on init function I put this code:
mo = MidiOutput::createNewDevice("MyDeviceOut");
// PREVIOUS LINE PRINT IN CONSOLE: CoreMIDI error: 417 - ffffd5a4
if (mo != nullptr) {
MidiOutput::openDevice(mo->getDefaultDeviceIndex());
}
mi = MidiInput::createNewDevice("MyDeviceIn", this);
// PREVIOUS LINE PRINT IN CONSOLE; CoreMIDI error: 560 - ffffd5a4
if (mi != nullptr) {
mi->start();
}
Obviously I tried that code on a desktop version and it works!
In attachment a screenshot of how cubasis looks when before it I open another app that create his own midi ports (while if I launch my test it looks the same but without in this case “iGrand Piano”).
Have you enabled the “Audio Background Capability” setting in the iOS exporter in the Projucer? This is needed to create MIDI devices otherwise CoreMidi will throw a kMIDINotPermitted error (which is the ffffd5a4 error you’re seeing).