                 AKLog("error sending midi : Failed to add packet to packet list.")
                 return
             }
-            
+
             for endpoint in endpoints.values {
                 let result = MIDISend(outputPort, endpoint, packetListPointer)
                 if result != noErr {
                     AKLog("error sending midi : \(result)")
                 }
             }
-            
+
             if virtualOutput != 0 {
                 MIDIReceived(virtualOutput, packetListPointer)
             }

    }
    /// Send Message with data
    public func sendMessage(_ data: [MIDIByte]) {
        
        // Create a buffer that is big enough to hold the data to be sent and
        // all the necessary headers.
        let bufferSize = data.count + sizeOfMIDICombinedHeaders
        
        // the discussion section of MIDIPacketListAdd states that "The maximum
        // size of a packet list is 65536 bytes." Checking for that limit here.
        if bufferSize > 65536 {

/// the former.
private let sizeOfMIDIPacketHeader = MemoryLayout<MIDITimeStamp>.size + MemoryLayout<UInt16>.size
private let sizeOfMIDICombinedHeaders = sizeOfMIDIPacketListHeader + sizeOfMIDIPacketHeader

internal extension Collection where Index == Int {
    var startIndex: Index {
