title: Confusion over CoreMIDI Destinations
body: <p>Given the following code if I use the first method in the <code>if</code> branch to obtain a <code>MIDIDestination</code> the code works correctly, and MIDI data is sent.  If I use the second method from the <code>else</code> branch, no data is sent.</p>
  
  <pre><code>var client = MIDIClientRef()
  var port = MIDIPortRef()
  var dest = MIDIEndpointRef()
  
  MIDIClientCreate("jveditor" as CFString, nil, nil, &amp;client)
  MIDIOutputPortCreate(client, "output" as CFString, &amp;port)
  
  if false {
      dest = MIDIGetDestination(1)
  } else {
      var device = MIDIGetExternalDevice(0)
      var entity = MIDIDeviceGetEntity(device, 0)
      dest = MIDIEntityGetDestination(entity, 0)
  }
  
  var name: Unmanaged&lt;CFString&gt;?
  MIDIObjectGetStringProperty(dest, kMIDIPropertyDisplayName, &amp;name)
  print(name?.takeUnretainedValue() as! String)
  
  var gmOn : [UInt8] = [ 0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7 ]
  
  var pktlist = MIDIPacketList()
  var current = MIDIPacketListInit(&amp;pktlist)
  current = MIDIPacketListAdd(&amp;pktlist, MemoryLayout&lt;MIDIPacketList&gt;.stride, current, 0, gmOn.count, &amp;gmOn)
  
  MIDISend(port, dest, &amp;pktlist)
  </code></pre>
  
  <p>In both cases the printed device name is correct, and the status of every call is <code>noErr</code>.</p>
  
  <p>I have noticed that if I ask for the <code>kMIDIManufacturerName</code> property that I get different results - specifically using the first method I get <code>Generic</code>, from the USB MIDI interface to which the MIDI device is connected, and with the second method I get the value of <code>Roland</code> configured via the Audio MIDI Setup app.</p>
  
  <p>The reason I want to use the second method is specifically so that I can filter out devices that don't have the desired manufacturer name, but as above I can't then get working output.</p>
  
  <p>Can anyone explain the difference between these two methods, and why the latter doesn't work, and ideally offer a suggestion as to how I can work around that?</p>