     static public func midiEventsFrom(packetListPointer: UnsafePointer< MIDIPacketList>) -> [AKMIDIEvent] {
         return packetListPointer.pointee.map { AKMIDIEvent(packet: $0) }
     }
+    
+    private mutating func setLength(_ newLength:Int){
+        setLength(MIDIByte(newLength))
+    }
+    private mutating func setLength(_ newLength:MIDIByte){
+        length = newLength
+        internalData = Array(internalData[0..<Int(length!)])
+    }
 }

        internalData[1] = byte1.lower7bits()
        internalData[2] = byte2.lower7bits()

        length = 3
        internalData = Array(internalData[0..<3])

    }


                        break
                    }
                }
                setLength(computedLength)

            } else {
                if let cmd = packet.command {
