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

import AudioKit
import AudioKitUI
import Cocoa

class ViewController: NSViewController {

    // Default controls
    
    @IBOutlet weak var button1: NSButton!
    @IBOutlet weak var sliderLabel1: NSTextField!
    @IBOutlet weak var slider1: NSSlider!
    @IBOutlet weak var sliderLabel2: NSTextField!
    @IBOutlet weak var slider2: NSSlider!
    @IBOutlet private var outputTextView: NSTextView!
    
    // Define components
    var oscillator = AKOscillator()
    var booster = AKBooster()

    override func viewDidLoad() {
        super.viewDidLoad()
        sliderLabel1.stringValue = "Gain"
        sliderLabel2.stringValue = "Ramp Time"
        button1.stringValue = "Start"
    }
    
    @IBAction func start(_ sender: NSButton) {
        
        oscillator >>> booster
        booster.gain = 0
        
        AudioKit.output = booster
        AudioKit.start()
        sender.isEnabled = false
        
    }
    
    
    @IBAction func button1(_ sender: NSButton) {
        if oscillator.isPlaying {
            oscillator.stop()
            button1.stringValue = "Start"
            updateText("Stopped")
        } else {
            oscillator.start()
            button1.stringValue = "Stop"
            updateText("Playing \(Int(oscillator.frequency))Hz")
        }
    }
    @IBAction func slid1(_ sender: NSSlider) {
        booster.gain = Double(slider1.floatValue)
        updateText("booster gain = \(booster.gain)")
    }
    
    @IBAction func slid2(_ sender: NSSlider) {
        booster.rampTime = Double(slider2.floatValue) * 1000
        updateText("booster ramp time = \(booster.rampTime)")
    }
    
    func updateText(_ input: String) {
        DispatchQueue.main.async(execute: {
            self.outputTextView.string = "\(input)\n\(self.outputTextView.string)"
        })<commit_msg>Removing the 1000 to convert ms<commit_after>//
//  ViewController.swift
//  macOSDevelopment
//
//  Created by <NAME> on 12/5/15.
//  Copyright © 2015 AudioKit. All rights reserved.
//

import AudioKit
import AudioKitUI
import Cocoa

class ViewController: NSViewController {

    // Default controls
    
    @IBOutlet weak var button1: NSButton!
    @IBOutlet weak var sliderLabel1: NSTextField!
    @IBOutlet weak var slider1: NSSlider!
    @IBOutlet weak var sliderLabel2: NSTextField!
    @IBOutlet weak var slider2: NSSlider!
    @IBOutlet private var outputTextView: NSTextView!
    
    // Define components
    var oscillator = AKOscillator()
    var booster = AKBooster()

    override func viewDidLoad() {
        super.viewDidLoad()
        sliderLabel1.stringValue = "Gain"
        sliderLabel2.stringValue = "Ramp Time"
        button1.stringValue = "Start"
    }
    
    @IBAction func start(_ sender: NSButton) {
        
        oscillator >>> booster
        booster.gain = 0
        
        AudioKit.output = booster
        AudioKit.start()
        sender.isEnabled = false
        
    }
    
    
    @IBAction func button1(_ sender: NSButton) {
        if oscillator.isPlaying {
            oscillator.stop()
            button1.stringValue = "Start"
            updateText("Stopped")
        } else {
            oscillator.start()
            button1.stringValue = "Stop"
            updateText("Playing \(Int(oscillator.frequency))Hz")
        }
    }
    @IBAction func slid1(_ sender: NSSlider) {
        booster.gain = Double(slider1.floatValue)
        updateText("booster gain = \(booster.gain)")
    }
    
    @IBAction func slid2(_ sender: NSSlider) {
        booster.rampTime = Double(slider2.floatValue)
        updateText("booster ramp time = \(booster.rampTime)")
    }
    
    func updateText(_ input: String) {
        DispatchQueue.main.async(execute: {
            self.outputTextView.string = "\(input)\n\(self.outputTextView.string)"
        })
{'fraction_non_alphanumeric': 0.09947116595316041, 'fraction_numerical': 0.014605892722236212, 'mean_word_length': 2.218800648298217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3748372', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1180, 'n_words': 274}