<commit_before>//
//  AKSequencer.swift
//  AudioKit
//
//  Created by <NAME>, revision history on Github.
//  Copyright © 2017 <NAME>. All rights reserved.
//

/// Basic sequencer
///
/// This  is currently in transistion from old C Core Audio APIs, to the more
/// modern AVAudioSequencer setup. However, the new system is not as advanced as the
/// old, so we will keep both and have them interact. In addition, some of the features
/// of the new AVAudioSequencer don't even work yet (MIDI sequencing).
/// Still, both have their strengths and weaknesses so I am keeping them both.
/// As such, there is some code hanging around while we iron it out.
///
open class AKSequencer {

    /// Music sequence
    open var sequence: MusicSequence?

    /// Pointer to Music Sequence
    open var sequencePointer: UnsafeMutablePointer<MusicSequence>?

    /// AVAudioSequencer - on hold while technology is still unstable
    open var avSequencer = AVAudioSequencer()

    /// Array of AudioKit Music Tracks
    open var tracks = [AKMusicTrack]()

    /// Array of AVMusicTracks
    open var avTracks: [AVMusicTrack] {
        if isAVSequencer {
            return avSequencer.tracks
        } else {
            //this won't do anything if not using an AVSeq
            AKLog("AKSequencer ERROR ! avTracks only work if isAVSequencer ")

            let tracks = [AVMusicTrack]()
            return tracks
        }
    }

    /// Music Player
    var musicPlayer: MusicPlayer?

    /// Loop control
    open var loopEnabled: Bool = false

    /// Are we using the AVAudioEngineSequencer?
    open var isAVSequencer: Bool = false

    /// Sequencer Initialization
    public init() {<commit_msg>make AKSequencer available in Objc<commit_after>//
//  AKSequencer.swift
//  AudioKit
//
//  Created by <NAME>, revision history on Github.
//  Copyright © 2017 <NAME>. All rights reserved.
//

/// Basic sequencer
///
/// This  is currently in transistion from old C Core Audio APIs, to the more
/// modern AVAudioSequencer setup. However, the new system is not as advanced as the
/// old, so we will keep both and have them interact. In addition, some of the features
/// of the new AVAudioSequencer don't even work yet (MIDI sequencing).
/// Still, both have their strengths and weaknesses so I am keeping them both.
/// As such, there is some code hanging around while we iron it out.
///
@objc open class AKSequencer: NSObject {

    /// Music sequence
    open var sequence: MusicSequence?

    /// Pointer to Music Sequence
    open var sequencePointer: UnsafeMutablePointer<MusicSequence>?

    /// AVAudioSequencer - on hold while technology is still unstable
    open var avSequencer = AVAudioSequencer()

    /// Array of AudioKit Music Tracks
    open var tracks = [AKMusicTrack]()

    /// Array of AVMusicTracks
    open var avTracks: [AVMusicTrack] {
        if isAVSequencer {
            return avSequencer.tracks
        } else {
            //this won't do anything if not using an AVSeq
            AKLog("AKSequencer ERROR ! avTracks only work if isAVSequencer ")

            let tracks = [AVMusicTrack]()
            return tracks
        }
    }

    /// Music Player
    var musicPlayer: MusicPlayer?

    /// Loop control
    open var loopEnabled: Bool = false

    /// Are we using the AVAudioEngineSequencer?
    open var isAVSequencer: Bool = false

    /// Sequencer Initialization
    public override init() {
        super.init()
{'fraction_non_alphanumeric': 0.08485375036200406, 'fraction_numerical': 0.0023168259484506225, 'mean_word_length': 2.454, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '927261', 'n_tokens_mistral': 971, 'n_tokens_neox': 905, 'n_words': 398}