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

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

        }
    }
    
    /// Sert the Audio Unit output for all tracks
    public func setGlobalAVAudioUnitOutput(audioUnit: AVAudioUnit) {
        for track in avSeq.tracks{
            track.destinationAudioUnit = audioUnit
        }
    }
    
    /// Track count
    public var numberOfTracks: Int {
        var count:UInt32 = 0
        MusicSequenceGetTrackCount(sequence, &count)
        return Int(count)
    }
    
    /// Load a MIDI file
    public func loadMidiFile(filename:String) {
        let bundle = NSBundle.mainBundle()
        let file = bundle.pathForResource(filename, ofType: "mid")
        let fileURL = NSURL.fileURLWithPath(file!)
