Receiving raw midi data with Swift4

Hi all!


My app, a patch editor for Virus TI synthesizers, can send MIDI data to a synth to set its parameters, and let people design patches on the synth. It sends Sysex data to the synth using Audiokit.


I also use Audiokit to receive controllerChange, and polyPressure messges. All this works fine.


The most requested feature is to let people send a patch from the sunthesizer to my app. Now that can only be done with Sysex dumps.

My problem is that for some reason Audiokit messes up the incomming sysex messages badly. I asked some question about it, but never received any usable answer.


Anyhow, does anybody know some kind of Swift 4 example for receiving and parsing MIDI sysex messages ? It would be so helpfull, because I'm a front-end.webdevelopr from origin, this MIDI handling is really hard for me to start understanding. CoreMIDI documentation gives me the feeling writing this myself way beyond my skills.


Can anybody help?!


Thanks in advance!