<commit_before>//
//  DemoInstrument.swift
//  SwiftOSXProofOfConcept
//
//  Created by <NAME> on 9/7/15.
//  Copyright (c) 2015 AudioKit. All rights reserved.
//

import Foundation

class DemoInstrument: AKInstrument {

    var phasingResonance: AKPhasor
    var oscillatingFrequency: AKOscillator
    var fmOscillator: AKFMOscillator
    var moog: AKMoogLadder
    var jitter: AKJitter
    var filter: AKEqualizerFilter
    var delay: AKVariableDelay
    var panner: AKPanner
    
    override init() {
        
        // Method 1: Full Initializer
        oscillatingFrequency = AKOscillator(
            frequency: akp(1),
            amplitude: akp(440),
            phase: 0.0
        )
        
        // Method 2: Default Initializer plus property setting
        oscillatingFrequency = AKOscillator()
        oscillatingFrequency.frequency = akp(1)
        oscillatingFrequency.amplitude = akp(440)
        
        // Method 1: Full Initializer
        fmOscillator = AKFMOscillator(
            baseFrequency: oscillatingFrequency,
            carrierMultiplier: akp(3),
            modulatingMultiplier: akp(5),
            modulationIndex: akp(11),
            amplitude: akp(0.1)
        )
        
        // Method 2: Default Initializer plus property setting
        fmOscillator = AKFMOscillator()
        fmOscillator.baseFrequency        = oscillatingFrequency
        fmOscillator.carrierMultiplier    = 3.ak
        fmOscillator.modulatingMultiplier = 5.ak
        fmOscillator.modulationIndex      = 11.ak
        fmOscillator.amplitude            = 0.5.ak
        
        // Method 3: Default initializer and resetting values
        fmOscillator = AKFMOscillator()
        fmOscillator.baseFrequency = oscillatingFrequency
        fmOscillator.carrierMultiplier.value    = 3
        fmOscillator.modulatingMultiplier.value = 5
        fmOscillator.modulationIndex.value      = 11
        fmOscillator.amplitude.value            = 0.5
        
        phasingResonance = AKPhasor()
        
        moog = AKMoogLadder(input: fmOscillator)
        //moog.resonance = phasingResonance

        filter = AKEqualizerFilter(input: fmOscillator)
        
        jitter = AKJitter()
    
//        fmOscillator.amplitude = jitter;

        delay = AKVariableDelay(input: fmOscillator)
        
        let simple = AKOscillator()
        simple.frequency.value = 880
        simple.amplitude.value = 1.0
        
        
        panner = AKPanner(input: simple)

        
        super.init()
        operations.append(oscillatingFrequency)
        operations.append(fmOscillator)
//        operations.append(phasingResonance)
//        operations.append(jitter)
        operations.append(moog)
//      operations.append(filter)
      
        let reverb = AKReverb(input: fmOscillator)
        operations.append(reverb)
        
        operations.append(simple)

        operations.append(panner)
        
        let output = AKAudioOutput(input:reverb)
        operations.append(output)
    }
    
}<commit_msg>Cleaned up the demo instrument<commit_after>//
//  DemoInstrument.swift
//  SwiftOSXProofOfConcept
//
//  Created by <NAME> on 9/7/15.
//  Copyright (c) 2015 AudioKit. All rights reserved.
//

import Foundation

class DemoInstrument: AKInstrument {

    var oscillatingFrequency: AKOscillator
    var fmOscillator: AKFMOscillator
    var panner: AKPanner
    
    override init() {
        
        // Method 1: Full Initializer
        oscillatingFrequency = AKOscillator(
            frequency: akp(1),
            amplitude: akp(440),
            phase: 0.0
        )
        
        // Method 2: Default Initializer plus property setting
        oscillatingFrequency = AKOscillator()
        oscillatingFrequency.frequency = akp(1)
        oscillatingFrequency.amplitude = akp(440)
        
        // Method 1: Full Initializer
        fmOscillator = AKFMOscillator(
            baseFrequency: oscillatingFrequency,
            carrierMultiplier: akp(3),
            modulatingMultiplier: akp(5),
            modulationIndex: akp(11),
            amplitude: akp(0.1)
        )
        
        // Method 2: Default Initializer plus property setting
        fmOscillator = AKFMOscillator()
        fmOscillator.baseFrequency        = oscillatingFrequency
        fmOscillator.carrierMultiplier    = 3.ak
        fmOscillator.modulatingMultiplier = 5.ak
        fmOscillator.modulationIndex      = 11.ak
        fmOscillator.amplitude            = 0.5.ak
        
        // Method 3: Default initializer and resetting values
        fmOscillator = AKFMOscillator()
        fmOscillator.baseFrequency = oscillatingFrequency
        fmOscillator.carrierMultiplier.value    = 3
        fmOscillator.modulatingMultiplier.value = 5
        fmOscillator.modulationIndex.value      = 11
        fmOscillator.amplitude.value            = 0.5
        
        let simple = AKOscillator()
        simple.frequency.value = 880
        simple.amplitude.value = 1.0
        
        panner = AKPanner(input: fmOscillator)
        let reverb = AKReverb(input: panner)

        let output = AKAudioOutput(input:reverb)
        
        super.init()
        
        operations.append(oscillatingFrequency)
        operations.append(fmOscillator)
        operations.append(simple)
        operations.append(panner)
        operations.append(reverb)
        operations.append(output)
        
    }
    
}
{'fraction_non_alphanumeric': 0.07401951758423864, 'fraction_numerical': 0.01693979009390536, 'mean_word_length': 1.9699289229086934, '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': '3402708', 'n_tokens_mistral': 1766, 'n_tokens_neox': 1543, 'n_words': 308}