Skip to content

Commit af42d07

Browse files
hounds
1 parent 7781cb0 commit af42d07

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Cookbook/CookbookCommon/Sources/CookbookCommon/Recipes/Effects/Talkbox.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@ class TalkboxConductor: ObservableObject, ProcessesPlayerInput {
1111
let player = AudioPlayer()
1212
let talkbox: Talkbox
1313
let buffer: AVAudioPCMBuffer
14-
1514
var osc = DynamicOscillator()
16-
15+
1716
func noteOn(pitch: Pitch, point _: CGPoint) {
1817
isPlaying = true
1918
osc.frequency = AUValue(pitch.midiNoteNumber).midiNoteToFrequency()
2019
}
21-
20+
2221
func noteOff(pitch _: Pitch) {
2322
isPlaying = false
2423
}
25-
24+
2625
@Published var isPlaying: Bool = false {
2726
didSet { isPlaying ? osc.start() : osc.stop() }
2827
}
29-
28+
3029
init() {
3130
buffer = Cookbook.sourceBuffer
3231
player.buffer = buffer

Cookbook/CookbookCommon/Sources/CookbookCommon/Recipes/Effects/Vocoder.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@ class VocoderConductor: ObservableObject, ProcessesPlayerInput {
1111
let player = AudioPlayer()
1212
let vocoder: Vocoder
1313
let buffer: AVAudioPCMBuffer
14-
1514
var osc = MorphingOscillator(index: 2.5)
1615

1716
func noteOn(pitch: Pitch, point _: CGPoint) {
1817
isPlaying = true
1918
osc.frequency = AUValue(pitch.midiNoteNumber).midiNoteToFrequency()
2019
}
21-
20+
2221
func noteOff(pitch _: Pitch) {
2322
isPlaying = false
2423
}
25-
24+
2625
@Published var isPlaying: Bool = false {
2726
didSet { isPlaying ? osc.start() : osc.stop() }
2827
}
29-
28+
3029
init() {
3130
buffer = Cookbook.sourceBuffer
3231
player.buffer = buffer
@@ -35,7 +34,7 @@ class VocoderConductor: ObservableObject, ProcessesPlayerInput {
3534

3635
vocoder = Vocoder(player, excitation: osc)
3736
engine.output = vocoder
38-
37+
3938
vocoder.attackTime = 0.001
4039
vocoder.releaseTime = 0.02
4140
vocoder.bandwidthRatio = 0.1

0 commit comments

Comments
 (0)