Skip to content

Commit

Permalink
Oscillator->TestOscillator to avoid clash with SoundpipeAudioKit's Os…
Browse files Browse the repository at this point in the history
…cillator
  • Loading branch information
aure committed Jun 13, 2023
1 parent 62aaf7c commit a86183e
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Sources/Audio/Nodes/Generators/OscillatorAudioUnit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OscillatorAudioUnit: AUAudioUnit {

holder.initialize(to: waveVec)

let command: OscillatorCommand = .table(holder)
let command: TestOscillatorCommand = .table(holder)
let sysex = encodeSysex(command)

if cachedMIDIBlock == nil {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Audio/Nodes/Generators/OscillatorKernel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OscillatorKernel {
func processEvents(events: UnsafePointer<AURenderEvent>?) {
process(events: events,
sysex: { event in
var command: OscillatorCommand = .table(nil)
var command: TestOscillatorCommand = .table(nil)

decodeSysex(event, &command)
switch command {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import AudioUnit
import AVFoundation
import Utilities

enum OscillatorCommand {
enum TestOscillatorCommand {
case table(UnsafeMutablePointer<Vec<Float>>?)
}

public class Oscillator: Node {
public class TestOscillator: Node {
public let connections: [Node] = []

public let auAudioUnit: AUAudioUnit
Expand Down
22 changes: 11 additions & 11 deletions Tests/AudioKitTests/Engine Tests/EngineRealtimeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class EngineRealtimeTests: AKTestCase {
func testBasicRealtime() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()
osc.amplitude = 0.1

engine.output = osc
Expand All @@ -19,7 +19,7 @@ class EngineRealtimeTests: AKTestCase {
func testEffectRealtime() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()
let fx = Distortion(osc)

engine.output = fx
Expand All @@ -34,7 +34,7 @@ class EngineRealtimeTests: AKTestCase {
func testTwoEffectsRealtime() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()
let dist = Distortion(osc)
let rev = Distortion(dist)

Expand All @@ -51,7 +51,7 @@ class EngineRealtimeTests: AKTestCase {
func testDynamicChangeRealtime() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()
let dist = Distortion(osc)

engine.output = osc
Expand All @@ -69,8 +69,8 @@ class EngineRealtimeTests: AKTestCase {
func testMixerRealtime() throws {
let engine = AudioEngine()

let osc1 = Oscillator()
let osc2 = Oscillator()
let osc1 = TestOscillator()
let osc2 = TestOscillator()
osc2.frequency = 466.16 // dissonance, so we can really hear it

let mix = Mixer([osc1, osc2])
Expand All @@ -88,8 +88,8 @@ class EngineRealtimeTests: AKTestCase {
func testMixerDynamicRealtime() throws {
let engine = AudioEngine()

let osc1 = Oscillator()
let osc2 = Oscillator()
let osc1 = TestOscillator()
let osc2 = TestOscillator()
osc2.frequency = 466.16 // dissonance, so we can really hear it

let mix = Mixer([osc1])
Expand All @@ -111,8 +111,8 @@ class EngineRealtimeTests: AKTestCase {
func testMultipleChangesRealtime() throws {
let engine = AudioEngine()

let osc1 = Oscillator()
let osc2 = Oscillator()
let osc1 = TestOscillator()
let osc2 = TestOscillator()

osc1.frequency = 880

Expand Down Expand Up @@ -148,7 +148,7 @@ class EngineRealtimeTests: AKTestCase {
let mixer = Mixer()

for _ in 0 ..< 100 {
let osc = Oscillator()
let osc = TestOscillator()
mixer.addInput(osc)
}

Expand Down
34 changes: 17 additions & 17 deletions Tests/AudioKitTests/Engine Tests/EngineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class EngineTests: AKTestCase {
func testBasic() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()

engine.output = osc

Expand All @@ -20,7 +20,7 @@ class EngineTests: AKTestCase {
func testEffect() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()
let fx = Distortion(osc)

engine.output = fx
Expand All @@ -34,7 +34,7 @@ class EngineTests: AKTestCase {
func testTwoEffects() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()
let dist = Distortion(osc)
let dyn = PeakLimiter(dist)

Expand All @@ -50,7 +50,7 @@ class EngineTests: AKTestCase {
func testDynamicChange() throws {
let engine = AudioEngine()

let osc = Oscillator()
let osc = TestOscillator()
let dist = Distortion(osc)

engine.output = osc
Expand All @@ -69,8 +69,8 @@ class EngineTests: AKTestCase {
func testMixer() throws {
let engine = AudioEngine()

let osc1 = Oscillator()
let osc2 = Oscillator()
let osc1 = TestOscillator()
let osc2 = TestOscillator()
osc2.frequency = 466.16 // dissonance, so we can really hear it

let mix = Mixer([osc1, osc2])
Expand All @@ -86,8 +86,8 @@ class EngineTests: AKTestCase {
func testMixerVolume() throws {
let engine = AudioEngine()

let osc1 = Oscillator()
let osc2 = Oscillator()
let osc1 = TestOscillator()
let osc2 = TestOscillator()
osc2.frequency = 466.16 // dissonance, so we can really hear it

let mix = Mixer([osc1, osc2])
Expand All @@ -105,8 +105,8 @@ class EngineTests: AKTestCase {
func testMixerDynamic() throws {
let engine = AudioEngine()

let osc1 = Oscillator()
let osc2 = Oscillator()
let osc1 = TestOscillator()
let osc2 = TestOscillator()
osc2.frequency = 466.16 // dissonance, so we can really hear it

let mix = Mixer([osc1])
Expand Down Expand Up @@ -137,7 +137,7 @@ class EngineTests: AKTestCase {

for volume in [0.0, 0.1, 0.5, 0.8, 1.0, 2.0] {
let engine = AudioEngine()
let osc = Oscillator()
let osc = TestOscillator()
let mix = Mixer(osc)
mix.volume = AUValue(volume)
engine.output = mix
Expand All @@ -164,8 +164,8 @@ class EngineTests: AKTestCase {

for pan in [-0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75] {
let engine = AudioEngine()
let oscL = Oscillator()
let oscR = Oscillator()
let oscL = TestOscillator()
let oscR = TestOscillator()
oscR.frequency = 500
let mixL = Mixer(oscL)
let mixR = Mixer(oscR)
Expand All @@ -185,8 +185,8 @@ class EngineTests: AKTestCase {
func testMultipleChanges() throws {
let engine = AudioEngine()

let osc1 = Oscillator()
let osc2 = Oscillator()
let osc1 = TestOscillator()
let osc2 = TestOscillator()

osc1.frequency = 880

Expand Down Expand Up @@ -219,7 +219,7 @@ class EngineTests: AKTestCase {

func testOscillator() {
let engine = AudioEngine()
let osc = Oscillator()
let osc = TestOscillator()
engine.output = osc
let audio = engine.startTest(totalDuration: 2.0)
audio.append(engine.render(duration: 2.0))
Expand All @@ -244,7 +244,7 @@ class EngineTests: AKTestCase {
let mixer = Mixer()

for _ in 0 ..< 20 {
let osc = Oscillator()
let osc = TestOscillator()
mixer.addInput(osc)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BypassTests: AKTestCase {
return

let duration = 0.1
let source = Oscillator()
let source = TestOscillator()
let effects: [Node] = [
Distortion(source),
DynamicsProcessor(source),
Expand Down Expand Up @@ -40,7 +40,7 @@ class BypassTests: AKTestCase {

func testStartEffectPerformsTransformation() throws {
let duration = 0.1
let source = Oscillator()
let source = TestOscillator()
let effects: [Node] = [
Distortion(source),
DynamicsProcessor(source),
Expand Down Expand Up @@ -68,7 +68,7 @@ class BypassTests: AKTestCase {

func testStartStopEffectsChangesIsStarted() {
let duration = 0.1
let source = Oscillator()
let source = TestOscillator()
let effects: [Node] = [
Distortion(source),
DynamicsProcessor(source),
Expand Down
6 changes: 3 additions & 3 deletions Tests/AudioKitTests/Node Tests/GenericNodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ class GenericNodeTests: AKTestCase {

@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)
func testGenerators() {
nodeParameterTest(md5s: ["885d882c758552e08a214b661eb128e4"], factory: { _ in let osc = Oscillator(waveform: Table(.square)); return osc })
nodeParameterTest(md5s: ["569c8b32aa826ba22f62d8b682dc4ca4"], factory: { _ in let osc = Oscillator(waveform: Table(.triangle)); return osc })
nodeParameterTest(md5s: ["d0a155478e77465653beccb31d3d45b7"], factory: { _ in let osc = Oscillator(waveform: Table(.triangle), amplitude: 0.1); return osc })
nodeParameterTest(md5s: ["885d882c758552e08a214b661eb128e4"], factory: { _ in let osc = TestOscillator(waveform: Table(.square)); return osc })
nodeParameterTest(md5s: ["569c8b32aa826ba22f62d8b682dc4ca4"], factory: { _ in let osc = TestOscillator(waveform: Table(.triangle)); return osc })
nodeParameterTest(md5s: ["d0a155478e77465653beccb31d3d45b7"], factory: { _ in let osc = TestOscillator(waveform: Table(.triangle), amplitude: 0.1); return osc })
}

func testEffects() {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AudioKitTests/Node Tests/NodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class NodeTests: AKTestCase {
func testDynamicConnection() {
let engine = AudioEngine()

let osc1 = Oscillator(waveform: Table(.triangle), frequency: 440, amplitude: 0.1)
let osc1 = TestOscillator(waveform: Table(.triangle), frequency: 440, amplitude: 0.1)
let mixer = Mixer(osc1)

engine.output = mixer
Expand All @@ -71,7 +71,7 @@ class NodeTests: AKTestCase {

audio.append(engine.render(duration: 1.0))

let osc2 = Oscillator(waveform: Table(.triangle), frequency: 880, amplitude: 0.1)
let osc2 = TestOscillator(waveform: Table(.triangle), frequency: 880, amplitude: 0.1)
mixer.addInput(osc2)

audio.append(engine.render(duration: 1.0))
Expand Down
4 changes: 2 additions & 2 deletions Tests/AudioKitTests/Tap Tests/FFTTapTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FFTTapTests: AKTestCase {
func testFFT() {
let engine = AudioEngine()

let oscillator = Oscillator()
let oscillator = TestOscillator()
let mixer = Mixer(oscillator)

var fftData: [Int] = []
Expand Down Expand Up @@ -65,7 +65,7 @@ class FFTTapTests: AKTestCase {

let engine = AudioEngine()

let oscillator = Oscillator()
let oscillator = TestOscillator()

var fftData: [Int] = []

Expand Down

0 comments on commit a86183e

Please sign in to comment.