title: Java MIDI Device List Duplicates
body: <p>I'm listing all MIDI devices in a combobox, but for the loopback drivers I get duplicate entries. </p>
  
  <ul>
  <li>The first entries don't work and contain no description (
  getDescription() returns "No details available" )</li>
  <li>The others, which are the working ones, return "External MIDI Port"
  description.</li>
  </ul>
  
  <p>Now, I would like to know why rtpMidi, LoopBE, LoopMidi and all loopback drivers cause these duplicate entries, so that I can exclude them from the list in a secure way. 
  I could simply avoid the entries without a valid description, but I don't like acting without knowing the reason why those entries are reported in the first place.
  Another thing that puzzles me is that if I try filtering the results via "if(dev instanceof Receiver)" I get a  blank list, the same with instanceof Transmitter, Synthesizer and Sequencer. So it seems like none of the midi devices are instance of one of those classes, but only instance of MidiDevice class, which doesn't help me with filtering the list...
  Could someone please suggest a different solution?</p>
  
  <pre><code>// Get MIDI device list
  info = MidiSystem.getMidiDeviceInfo();
  device = new ArrayList&lt;MidiDevice&gt;();
  deviceDetails = new ArrayList&lt;String&gt;();
  int j=0;
  for (int i = 0; i &lt; info.length; i++) {
      MidiDevice dev = MidiSystem.getMidiDevice(info[i]);
  
      //if ( dev instanceof Receiver ) { // tried Receiver, Transmitter, Synthesizer and Sequencer
  
          // Detailed List
          deviceDetails.add("Device ID: " + j);
          deviceDetails.set(j, deviceDetails.get(j) + "\nName: " + info[i].getName());
          deviceDetails.set(j, deviceDetails.get(j) + "\nDescription: " + info[i].getDescription());
          device.add(dev);
          deviceDetails.set(j, deviceDetails.get(j) + "\nDevice: " + device.get(j));
          //Combo Box (Dev names only)
          MidiOutCombo.add(info[i].getName());
          j++;
      //}
  }
  </code></pre>
  
  <p>Here's the temporary solution I found, it works but it's string-based and I don't know if it works crossplatform...</p>
  
  <pre><code>if (info[i].getDescription().compareTo("External MIDI Port") == 0 ) {
  </code></pre>