Midi errors


#1

Working on a mixer controlled by a midi controller (bcf-2000) connected to a midi interface (midi man).  It works very well except if I loose connection to the controller, I must restart my mixer.  I can reproduce the problem by just unpluggin the usb cable and plugging it back in.

It seems I should be able to tell by sending to the controller, but the sendMessageNow return is void.  Is there a way to detect it is not working?

I would like to restablish the midi connection without stopping audio.  Can this be done?

I am using the AudioDeviceManager for audio and midi.  How do I get the AudioDeviceManager to reconnect to the midi device?  For output I use midiOut = MainContentComponent::getSharedAudioDeviceManager().getDefaultMidiOutput(); . 

For inputs I do this to setup my conntection:

const StringArray allMidiIns (MidiInput::getDevices());
    for (int x=0 ; x<allMidiIns.size() ; x++)
    {
        if (getSharedAudioDeviceManager().isMidiInputEnabled(allMidiIns[x])) m_MidiInputs.add(allMidiIns[x]);
        getSharedAudioDeviceManager().addMidiInputCallback(allMidiIns[x], MidiEngine);

    }

 

I assume a file descriptor to the port is opened somewhere and it needs to get closed and opened again.   How do I do that without stopping audio?  Does getDefaultMidiOutput do this?  Does call to addMididInputCallback do this?  If not, what call methods could do this?

 

Thanks.

Mark

 


#2

You'd have to re-scan for midi devices, and re-open the same one again. Bit messy, but midi devices are unfortunately a bit of a pain to work with.


#3

Thanks Jules.

 

Mark.