 AKOrchestra.addInstrument(instrument)
 AKOrchestra.addInstrument(processor)
 
-AKOrchestra.testForDuration(10)
+AKOrchestra.testForDuration(testDuration)
 
 processor.play()
 instrument.play()

//

import Foundation

class Instrument : AKInstrument {


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

        let delayTime = AKLine(firstPoint: 0.ak, secondPoint: 0.1.ak, durationBetweenPoints: testDuration.ak)
        connect(delayTime)

        let feedback = AKLine(firstPoint: 0.ak, secondPoint: 1.ak, durationBetweenPoints: testDuration.ak)
        connect(feedback)

        let flanger = AKFlanger(input: audioSource, delayTime:delayTime)
        flanger.feedback = feedback
        connect(flanger)

        let mix = AKMixedAudio(signal1: audioSource, signal2: flanger, balance: 0.5.ak)
        connect(mix)
        
        enableParameterLog(
            "Feedback = ",
            parameter: flanger.feedback,
            frequency:0.1
        )

        connect(AKAudioOutput(audioSource:mix))
    }
