private MidiDevice getReceivingDevice() throws MidiUnavailableException {
        for (MidiDevice.Info mdi: MidiSystem.getMidiDeviceInfo()) {
            MidiDevice dev = MidiSystem.getMidiDevice(mdi);
            if (dev.getMaxReceivers() != 0) {
                //String lcName = StringUtils.defaultString(mdi.getName()).toLowerCase(Locale.ENGLISH);
                //if (lcName.contains(useExternalSynth? "usb": "java")) {
                //    return dev;
                //}
            }
        }
        return null;
    }