/** * Returns the default input MIDI device. * * @return the default input MIDI device or {@code null} if not found. */ public static MidiDevice getDefaultInputDevice() { try { Transmitter transmitter = MidiSystem.getTransmitter(); if (transmitter != null && transmitter instanceof MidiDeviceTransmitter) { return ((MidiDeviceTransmitter) transmitter).getMidiDevice(); } return null; } catch (MidiUnavailableException e) { throw SpongeUtils.wrapException(e); } }