This is just an updated version of Gene De Lisa's SwiftMIDI example.
I basically just made a fork and updated things to work with Swift 5 and XCode 11 out of the box, for my own sanity.
Very little has changed, other that fixing minor syntax changes.
Remember you have to download the Fluid SoundFont, to big to add to the depot.
Stan
Gene's Orginal ReadMe Follows.
An example using Core MIDI with Swift 3.
There are also two hacky Playgrounds. One works. The other one tries to create an input port and fails. (makes sense actually)
Meta text events are a mess with that tuple nonsense. That will be another blog post.
I'm using the Fluid R3 GM Sounfont in this example. Use whatever Soundfont you like. (GeneralUser GS 1.442 has many problems)
If you find one, please add it to issues
Please read the LICENSE for details.