<commit_before>//
//  main.swift
//  AudioKit
//
//  Created by <NAME> and <NAME> on 12/26/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

class Instrument : AKInstrument {

    var auxilliaryOutput = AKAudio()

    override init() {
        super.init()
        let filename = "CsoundLib64.framework/Sounds/PianoBassDrumLoop.wav"

        let audio = AKFileInput(filename: filename)
        connect(audio)

        let mono = AKMixedAudio(signal1: audio.leftOutput, signal2: audio.rightOutput, balance: 0.5.ak)
        connect(mono)

        auxilliaryOutput = AKAudio.globalParameter()
        assignOutput(auxilliaryOutput, to:mono)
    }
}

class Processor : AKInstrument {

    init(audioSource: AKAudio) {
        super.init()

        let cutoffFrequency = AKLine(firstPoint: 1000.ak, secondPoint: 0.ak, durationBetweenPoints: 11.ak)
        connect(cutoffFrequency)

        let operation = AKLowPassButterworthFilter(input: audioSource)
        operation.cutoffFrequency = cutoffFrequency
        connect(operation)

        connect(AKAudioOutput(audioSource:operation))
    }
}

let instrument = Instrument()
let processor = Processor(audioSource: instrument.auxilliaryOutput)
AKOrchestra.addInstrument(instrument)
AKOrchestra.addInstrument(processor)

AKOrchestra.testForDuration(10)

processor.play()
instrument.play()

while(AKManager.sharedManager().isRunning) {} //do nothing
println("Test complete!")<commit_msg>Updated AKLowPassButterworthFilter test to add logging<commit_after>//
//  main.swift
//  AudioKit
//
//  Created by <NAME> and <NAME> on 12/26/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

let testDuration: Float = 10.0

class Instrument : AKInstrument {

    var auxilliaryOutput = AKAudio()

    override init() {
        super.init()
        let filename = "CsoundLib64.framework/Sounds/PianoBassDrumLoop.wav"

        let audio = AKFileInput(filename: filename)
        connect(audio)

        let mono = AKMixedAudio(signal1: audio.leftOutput, signal2: audio.rightOutput, balance: 0.5.ak)
        connect(mono)

        auxilliaryOutput = AKAudio.globalParameter()
        assignOutput(auxilliaryOutput, to:mono)
    }
}

class Processor : AKInstrument {

    init(audioSource: AKAudio) {
        super.init()

        let cutoffFrequency = AKLine(firstPoint: 1000.ak, secondPoint: 0.ak, durationBetweenPoints: testDuration.ak)
        connect(cutoffFrequency)

        let lowPassButterworthFilter = AKLowPassButterworthFilter(input: audioSource)
        lowPassButterworthFilter.cutoffFrequency = cutoffFrequency
        connect(lowPassButterworthFilter)
        
        enableParameterLog(
            "Cutoff Frequency = ",
            parameter: lowPassButterworthFilter.cutoffFrequency,
            frequency:0.1
        )

        connect(AKAudioOutput(audioSource:lowPassButterworthFilter))
    }
}

let instrument = Instrument()
let processor = Processor(audioSource: instrument.auxilliaryOutput)
AKOrchestra.addInstrument(instrument)
AKOrchestra.addInstrument(processor)

AKOrchestra.testForDuration(10)

processor.play()
instrument.play()

while(AKManager.sharedManager().isRunning) {} //do nothing
println("Test complete!")
{'fraction_non_alphanumeric': 0.09956709956709957, 'fraction_numerical': 0.016388373531230675, 'mean_word_length': 3.462068965517241, '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': '5108183', 'n_tokens_mistral': 1044, 'n_tokens_neox': 941, 'n_words': 192}