         initTracks()
     }
     
-    func initTracks(){
+    /// Initialize all tracks
+    func initTracks() {
         tracks.removeAll()
-        for( var i = 0; i < self.numTracks; ++i){
+        for( var i = 0; i < self.numberOfTracks; ++i){
             var musicTrack = MusicTrack()
             MusicSequenceGetIndTrack(sequence, UInt32(i), &musicTrack)
             tracks.append(AKMusicTrack(musicTrack: musicTrack))

            print("could not start avSeq")
        }
    }
    public func stop(){
//        MusicPlayerStop(musicPlayer)
        avSeq.stop()
    }
    public func rewind(){
//        MusicPlayerSetTime(musicPlayer, 0)
        avSeq.currentPositionInBeats = 0
    }
    
    public func setGlobalMidiOutput(midiEndpoint:MIDIEndpointRef){
//        for trackInd in tracks{
//            MusicTrackSetDestMIDIEndpoint(trackInd.internalMusicTrack, midiEndpoint)
//        }

        return Double(length)
    }
    
    /// Play the sequence
    public func play() {
//        MusicPlayerStart(musicPlayer)
        do{
            try avSeq.start()
