     }
 
     func clearMetaEvents() {
+        clearHelper(kMusicEventType_Meta, from: "clearMetaEvents")
+    }
+    
+    func clearSysexEvents() {
+        clearHelper(kMusicEventType_MIDIRawData, from: "clearSysexEvents")
+    }
+    
+    private func clearHelper(_ eventType: UInt32, from functionName: String) {
         guard let track = internalMusicTrack else {
             AKLog("internalMusicTrack does not exist")
             return

        while hasNextEvent.boolValue {
            MusicEventIteratorGetEventInfo(iterator, &eventTime, &eventType, &eventData, &eventDataSize)

            if eventType == kMusicEventType_Meta {
                MusicEventIteratorDeleteEvent(iterator)
            }
            MusicEventIteratorNextEvent(iterator)

        var tempIterator: MusicEventIterator?
        NewMusicEventIterator(track, &tempIterator)
        guard let iterator = tempIterator else {
            AKLog("Unable to create iterator in \(functionName)")
            return
        }
        var eventTime = MusicTimeStamp(0)
