 
     /// Enable looping for all tracks - loops entire sequence
     public func enableLooping() {
-        for track in sequencer.tracks {
+        for track in tracks {
             track.isLoopingEnabled = true
             track.loopRange = AVMakeBeatRange(0, self.length.beats)
         }


    /// Set the midi output for all tracks
    public func setGlobalMIDIOutput(_ midiEndpoint: MIDIEndpointRef) {
        for track in sequencer.tracks {
            track.destinationMIDIEndpoint = midiEndpoint
        }
    }

    /// - parameter loopLength: Loop length in beats
    ///
    public func enableLooping(_ loopLength: AKDuration) {
        for track in tracks {
            track.isLoopingEnabled = true
            track.loopRange = AVMakeBeatRange(0, loopLength.beats)
        }
