 //  AudioKit
 //
 //  Autogenerated by scripts by Aurelius Prochazka. Do not edit directly.
-//  Copyright (c) 2015 Aurelius Prochazka. All rights reserved.
+//  Copyright (c) 2016 Aurelius Prochazka. All rights reserved.
 //
 
 import AVFoundation

            self.centerFrequency = centerFrequency
            self.bandwidth = bandwidth
            
            internalEffect = AVAudioUnitEffect(audioComponentDescription: cd)
            self.avAudioNode = internalEffect
            AKManager.sharedInstance.engine.attachNode(self.avAudioNode)
            input.addConnectionPoint(self)
            internalAU = internalEffect.audioUnit
            
            AudioUnitSetParameter(internalAU, kBandpassParam_CenterFrequency, kAudioUnitScope_Global, 0, Float(centerFrequency), 0)
            AudioUnitSetParameter(internalAU, kBandpassParam_Bandwidth, kAudioUnitScope_Global, 0, Float(bandwidth), 0)
    }
    
    /// Function to start, play, or activate the node, all do the same thing
    public func start() {
        if isStopped {
            self.avAudioNode = internalEffect
            isStarted = true
        }
    }
    
    /// Function to start, play, or activate the node, all do the same thing
    public func play() {
        start()
    }
    
    /// Function to stop or bypass the node, both are equivalent
    public func stop() {
        if isPlaying {
            self.avAudioNode = self.input!.avAudioNode
            isStarted = false
        }
    }
    
    /// Function to stop or bypass the node, both are equivalent
    public func bypass() {
        stop()

/// - parameter bandwidth: Bandwidth (Cents) ranges from 100 to 12000 (Default: 600)
///
public class AKBandPassFilter: AKNode {

    private let cd = AudioComponentDescription(
        componentType: kAudioUnitType_Effect,
        componentSubType: kAudioUnitSubType_BandPassFilter,
        componentManufacturer: kAudioUnitManufacturer_Apple,
        componentFlags: 0,
        componentFlagsMask: 0)

    internal var internalEffect = AVAudioUnitEffect()
    internal var internalAU = AudioUnit()

    /// Required property for AKNode containing the output node
    public var avAudioNode: AVAudioNode

    /// Required property for AKNode containing all the node's connections
    public var connectionPoints = [AVAudioConnectionPoint]()

    private var input: AKNode?
    private var mixer: AKMixer
    
    /// Center Frequency (Hz) ranges from 20 to 22050 (Default: 5000)
    public var centerFrequency: Double = 5000 {
        didSet {
            if centerFrequency < 20 {
                centerFrequency = 20
            }            
            if centerFrequency > 22050 {
                centerFrequency = 22050
            }
