1

I am very new to Swift and struggling so please go easy. I am building a macOS project using Swift 4 in XCode 10.1

I am receiving a sysex message from a device using the following code which I got from the MIDIUtility example project supplied with AudioKit:

func receivedMIDISystemCommand(_ data: [MIDIByte]) {
    if let command = AKMIDISystemCommand(rawValue: data[0]) {
        var newString = "MIDI System Command: \(command) \n"
        var hexArray = [UInt8]()
        for bit in data {
            hexArray.append(bit)    //this requires 'public typealias MIDIByte = UInt8'
            newString.append(String("\(bit) "))
        }
        updateText("\(newString) \n")
        updateData(hexArray)
    }
    updateText("received \(data.count) bytes of data \n\n")
}

The sysex I am receiving is very different than what I get when using SysEx Librarian or MIDI Monitor to receive the same sysEx. Both of these apps receive 6 packets of 32,110,110,110,110, and 110 bytes. This is what I expect to get from my MIDI device. My code gets 6 packets of 520,1300,20,1538,1294 and 1544 bytes. It looks like the data I want is in these packets, but it is spit up by a bunch of 0's.

data as received in MIDI Monitor or SysEx Librarian: some of the data as received by my code

Why is my code receiving so much extra data? Is there a way to filter out the unwanted data or will I need to figure out how to use something other that AudioKit for my project?

Randy
  • 11
  • 3
  • Duplicate of [Receiving Sysex messages with audiokit](https://stackoverflow.com/questions/52676218/receiving-sysex-messages-with-audiokit). – CL. Dec 13 '18 at 07:22
  • Probable duplicate: [Audiokit seems to receive only the first three numbers of sysex MIDI messages](https://stackoverflow.com/questions/46680560/audiokit-seems-to-receive-only-the-first-three-numbers-of-sysex-midi-messages). – CL. Dec 13 '18 at 07:23
  • Check that you have the latest AK version, then [report a bug](https://github.com/AudioKit/AudioKit/issues). – CL. Dec 13 '18 at 07:26
  • those 2 other posts never got a helpful answer, that is why I asked it again. I considered reporting this as a bug, but wasn't sure if it was a bug or that there was something I was doing wrong. – Randy Dec 13 '18 at 10:50
  • Definitely seems like a bug, thanks for also raising an issue on Github. – Aurelius Prochazka Dec 13 '18 at 17:49

0 Answers0