         }
     }
     
+    public func addTempoEvent(bpm:Double, pos:Double){
+        if isAvSeq {
+            //not applicable
+        } else {
+            var newTempo = bpm;
+            if newTempo > 280 { newTempo = 280 } //bpm limits
+            if newTempo < 10  { newTempo = 10  }
+            
+            var tempoTrack = MusicTrack()
+            
+            MusicSequenceGetTempoTrack(sequence, &tempoTrack)
+            MusicTrackNewExtendedTempoEvent(tempoTrack, pos, Double(newTempo))
+        }
+
+    }
+    
     public func beatsForSeconds(seconds:Double)->Double{
         var outBeats:Double = MusicTimeStamp()
         MusicSequenceGetBeatsForSeconds(sequence, Float64(seconds), &outBeats)

    }
    
    /// Get a new track
    public func newTrack() {
        if(!isAvSeq){
            var newMusicTrack = MusicTrack()
            MusicSequenceNewTrack(sequence, &newMusicTrack)

            MusicSequenceGetTrackCount(sequence, &count)
            tracks.append(AKMusicTrack(musicTrack: newMusicTrack))
            initTracks()
            return tracks.last!
        }else{
            //cannot
            return nil
        }
    }
    
