<commit_before>//
//  ViewController.swift
//  HelloWorld
//
//  Created by <NAME> on 12/5/15.
//  Copyright © 2015 AudioKit. All rights reserved.
//

import AudioKit
import AudioKitUI
import Cocoa

class ViewController: NSViewController {

    let conductor = Conductor.shared
    var playing = false

    @IBOutlet weak var fl_modFreqSlider: NSSlider!
    @IBOutlet weak var fl_modDepthSlider: NSSliderCell!
    @IBOutlet weak var fl_wetFractionSlider: NSSlider!
    @IBOutlet weak var fl_feedbackSlider: NSSlider!
    @IBOutlet weak var fl_modFreqReadout: NSTextField!
    @IBOutlet weak var fl_modDepthReadout: NSTextField!
    @IBOutlet weak var fl_wetFractionReadout: NSTextField!
    @IBOutlet weak var fl_feedbackReadout: NSTextField!
    
    @IBOutlet weak var ch_modFreqSlider: NSSlider!
    @IBOutlet weak var ch_modDepthSlider: NSSliderCell!
    @IBOutlet weak var ch_wetFractionSlider: NSSlider!
    @IBOutlet weak var ch_feedbackSlider: NSSlider!
    @IBOutlet weak var ch_modFreqReadout: NSTextField!
    @IBOutlet weak var ch_modDepthReadout: NSTextField!
    @IBOutlet weak var ch_wetFractionReadout: NSTextField!
    @IBOutlet weak var ch_feedbackReadout: NSTextField!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        conductor.midi.addListener(self)

        fl_modFreqSlider.minValue = AKFlanger.MIN_MODFREQ_HZ
        fl_modFreqSlider.maxValue = AKFlanger.MAX_MODFREQ_HZ
        fl_modDepthSlider.minValue = AKFlanger.MIN_FRACTION
        fl_modDepthSlider.maxValue = AKFlanger.MAX_FRACTION
        fl_wetFractionSlider.minValue = AKFlanger.MIN_FRACTION
        fl_wetFractionSlider.maxValue = AKFlanger.MAX_FRACTION
        fl_feedbackSlider.minValue = AKFlanger.MIN_FEEDBACK
        fl_feedbackSlider.maxValue = AKFlanger.MAX_FEEDBACK

        fl_modFreqSlider.doubleValue = conductor.flanger.modFreq
        fl_modDepthSlider.doubleValue = conductor.flanger.modDepth
        fl_wetFractionSlider.doubleValue = conductor.flanger.wetFraction
        fl_feedbackSlider.doubleValue = conductor.flanger.feedback
        
        fl_modFreqReadout.doubleValue = conductor.flanger.modFreq
        fl_modDepthReadout.doubleValue = conductor.flanger.modDepth
        fl_wetFractionReadout.doubleValue = conductor.flanger.wetFraction
        fl_feedbackReadout.doubleValue = conductor.flanger.feedback

        ch_modFreqSlider.minValue = AKChorus.MIN_MODFREQ_HZ
        ch_modFreqSlider.maxValue = AKChorus.MAX_MODFREQ_HZ
        ch_modDepthSlider.minValue = AKChorus.MIN_FRACTION
        ch_modDepthSlider.maxValue = AKChorus.MAX_FRACTION
        ch_wetFractionSlider.minValue = AKChorus.MIN_FRACTION
        ch_wetFractionSlider.maxValue = AKChorus.MAX_FRACTION
        ch_feedbackSlider.minValue = AKChorus.MIN_FEEDBACK
        ch_feedbackSlider.maxValue = AKChorus.MAX_FEEDBACK
        
        ch_modFreqSlider.doubleValue = conductor.chorus.modFreq
        ch_modDepthSlider.doubleValue = conductor.chorus.modDepth
        ch_wetFractionSlider.doubleValue = conductor.chorus.wetFraction
        ch_feedbackSlider.doubleValue = conductor.chorus.feedback
        
        ch_modFreqReadout.doubleValue = conductor.chorus.modFreq
        ch_modDepthReadout.doubleValue = conductor.chorus.modDepth
        ch_wetFractionReadout.doubleValue = conductor.chorus.wetFraction
        ch_feedbackReadout.doubleValue = conductor.chorus.feedback
    }
    
    @IBAction func toggleSound(_ sender: NSButton) {
        if (playing) {
            conductor.stopNote(note: 65, channel: 0)
            sender.title = "Play"
            playing = false
        } else {
            conductor.playNote(note: 65, velocity: 127, channel: 0)
            conductor.pitchBend(7210)
            sender.title = "Stop"
            playing = true
        }
        sender.setNeedsDisplay()
    }
    
    @IBAction func on_flModFreqSlider(_ sender: Any) {
        conductor.flanger.frequency = fl_modFreqSlider.doubleValue
        fl_modFreqReadout.doubleValue = fl_modFreqSlider.doubleValue
    }
    
    @IBAction func on_flModDepthSlider(_ sender: Any) {
        conductor.flanger.depth = fl_modDepthSlider.doubleValue
        fl_modDepthReadout.doubleValue = fl_modDepthSlider.doubleValue
    }
    
    @IBAction func on_flWetFractionSlider(_ sender: Any) {
        conductor.flanger.dryWetMix = fl_wetFractionSlider.doubleValue
        fl_wetFractionReadout.doubleValue = fl_wetFractionSlider.doubleValue
    }<commit_msg>Updated member names in Flanger/Chorus example<commit_after>//
//  ViewController.swift
//  HelloWorld
//
//  Created by <NAME> on 12/5/15.
//  Copyright © 2015 AudioKit. All rights reserved.
//

import AudioKit
import AudioKitUI
import Cocoa

class ViewController: NSViewController {

    let conductor = Conductor.shared
    var playing = false

    @IBOutlet weak var fl_modFreqSlider: NSSlider!
    @IBOutlet weak var fl_modDepthSlider: NSSliderCell!
    @IBOutlet weak var fl_wetFractionSlider: NSSlider!
    @IBOutlet weak var fl_feedbackSlider: NSSlider!
    @IBOutlet weak var fl_modFreqReadout: NSTextField!
    @IBOutlet weak var fl_modDepthReadout: NSTextField!
    @IBOutlet weak var fl_wetFractionReadout: NSTextField!
    @IBOutlet weak var fl_feedbackReadout: NSTextField!
    
    @IBOutlet weak var ch_modFreqSlider: NSSlider!
    @IBOutlet weak var ch_modDepthSlider: NSSliderCell!
    @IBOutlet weak var ch_wetFractionSlider: NSSlider!
    @IBOutlet weak var ch_feedbackSlider: NSSlider!
    @IBOutlet weak var ch_modFreqReadout: NSTextField!
    @IBOutlet weak var ch_modDepthReadout: NSTextField!
    @IBOutlet weak var ch_wetFractionReadout: NSTextField!
    @IBOutlet weak var ch_feedbackReadout: NSTextField!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        conductor.midi.addListener(self)

        fl_modFreqSlider.minValue = AKFlanger.MIN_FREQUENCY_HZ
        fl_modFreqSlider.maxValue = AKFlanger.MAX_FREQUENCY_HZ
        fl_modDepthSlider.minValue = AKFlanger.MIN_FRACTION
        fl_modDepthSlider.maxValue = AKFlanger.MAX_FRACTION
        fl_wetFractionSlider.minValue = AKFlanger.MIN_FRACTION
        fl_wetFractionSlider.maxValue = AKFlanger.MAX_FRACTION
        fl_feedbackSlider.minValue = AKFlanger.MIN_FEEDBACK
        fl_feedbackSlider.maxValue = AKFlanger.MAX_FEEDBACK

        fl_modFreqSlider.doubleValue = conductor.flanger.frequency
        fl_modDepthSlider.doubleValue = conductor.flanger.depth
        fl_wetFractionSlider.doubleValue = conductor.flanger.dryWetMix
        fl_feedbackSlider.doubleValue = conductor.flanger.feedback
        
        fl_modFreqReadout.doubleValue = conductor.flanger.frequency
        fl_modDepthReadout.doubleValue = conductor.flanger.depth
        fl_wetFractionReadout.doubleValue = conductor.flanger.dryWetMix
        fl_feedbackReadout.doubleValue = conductor.flanger.feedback

        ch_modFreqSlider.minValue = AKChorus.MIN_FREQUENCY_HZ
        ch_modFreqSlider.maxValue = AKChorus.MAX_FREQUENCY_HZ
        ch_modDepthSlider.minValue = AKChorus.MIN_FRACTION
        ch_modDepthSlider.maxValue = AKChorus.MAX_FRACTION
        ch_wetFractionSlider.minValue = AKChorus.MIN_FRACTION
        ch_wetFractionSlider.maxValue = AKChorus.MAX_FRACTION
        ch_feedbackSlider.minValue = AKChorus.MIN_FEEDBACK
        ch_feedbackSlider.maxValue = AKChorus.MAX_FEEDBACK
        
        ch_modFreqSlider.doubleValue = conductor.chorus.frequency
        ch_modDepthSlider.doubleValue = conductor.chorus.depth
        ch_wetFractionSlider.doubleValue = conductor.chorus.dryWetMix
        ch_feedbackSlider.doubleValue = conductor.chorus.feedback
        
        ch_modFreqReadout.doubleValue = conductor.chorus.frequency
        ch_modDepthReadout.doubleValue = conductor.chorus.depth
        ch_wetFractionReadout.doubleValue = conductor.chorus.dryWetMix
        ch_feedbackReadout.doubleValue = conductor.chorus.feedback
    }
    
    @IBAction func toggleSound(_ sender: NSButton) {
        if (playing) {
            conductor.stopNote(note: 65, channel: 0)
            sender.title = "Play"
            playing = false
        } else {
            conductor.playNote(note: 65, velocity: 127, channel: 0)
            conductor.pitchBend(7210)
            sender.title = "Stop"
            playing = true
        }
        sender.setNeedsDisplay()
    }
    
    @IBAction func on_flModFreqSlider(_ sender: Any) {
        conductor.flanger.frequency = fl_modFreqSlider.doubleValue
        fl_modFreqReadout.doubleValue = fl_modFreqSlider.doubleValue
    }
    
    @IBAction func on_flModDepthSlider(_ sender: Any) {
        conductor.flanger.depth = fl_modDepthSlider.doubleValue
        fl_modDepthReadout.doubleValue = fl_modDepthSlider.doubleValue
    }
    
    @IBAction func on_flWetFractionSlider(_ sender: Any) {
        conductor.flanger.dryWetMix = fl_wetFractionSlider.doubleValue
        fl_wetFractionReadout.doubleValue = fl_wetFractionSlider.doubleValue
    }
{'fraction_non_alphanumeric': 0.06348673160900235, 'fraction_numerical': 0.00492665994849401, 'mean_word_length': 3.2798275035936753, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2770261', 'n_tokens_mistral': 3006, 'n_tokens_neox': 2939, 'n_words': 473}