diff options
author | Jacob Lee <jacob@unabridgedsoftware.com> | 2021-12-03 14:24:36 -0500 |
---|---|---|
committer | Jacob Lee <jacob@unabridgedsoftware.com> | 2021-12-03 14:24:36 -0500 |
commit | bb833fe84ac4c3b89c8f8cc00f5fc4ac8c5b6d9f (patch) | |
tree | 12fda9b601b6aa7a2be6c03e48c074342e852fb3 /klangfarb | |
parent | a014949e2c7fa4c8bc02e3a54a74ae3727924076 (diff) |
Additive synthesis works! Clean up needed
Diffstat (limited to 'klangfarb')
-rw-r--r-- | klangfarb/.import/.gdignore | 1 | ||||
-rw-r--r-- | klangfarb/main.gd | 32 |
2 files changed, 17 insertions, 16 deletions
diff --git a/klangfarb/.import/.gdignore b/klangfarb/.import/.gdignore new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/klangfarb/.import/.gdignore @@ -0,0 +1 @@ + diff --git a/klangfarb/main.gd b/klangfarb/main.gd index 86ebc87..590d45b 100644 --- a/klangfarb/main.gd +++ b/klangfarb/main.gd @@ -41,19 +41,19 @@ func _fill_buffer() -> void: # playback stream buffer playback.push_buffer(synth.frames(to_fill)) -func _check_waveform(): - if waveform == "square": - synth.square() - elif waveform == "sine": - synth.sine() - elif waveform == "triangle": - synth.triangle() - elif waveform == "sawtooth": - synth.sawtooth() - elif waveform == "white_noise": - synth.white_noise() - elif waveform == "brown_noise": - synth.brown_noise() +#func _check_waveform(): + #if waveform == "square": + #synth.square() + #elif waveform == "sine": + #synth.sine() + #elif waveform == "triangle": + #synth.triangle() + #elif waveform == "sawtooth": + #synth.sawtooth() + #elif waveform == "white_noise": + #synth.white_noise() + #elif waveform == "brown_noise": + #synth.brown_noise() func _process(_delta): if self.is_playing(): @@ -68,7 +68,7 @@ func _process(_delta): synth.set_decay(decay) synth.set_sustain(sustain) synth.set_release(release) - _check_waveform() + # _check_waveform() _fill_buffer() func _ready() -> void: @@ -79,7 +79,7 @@ func _ready() -> void: # get our AudioStreamPlayback object playback = self.get_stream_playback() # prefill the stream's sample buffer (which feeds DAC) - _check_waveform() + #_check_waveform() _fill_buffer() func _input(event): @@ -89,7 +89,7 @@ func _input(event): synth.trigger() elif event is InputEventMouseMotion: freq = event.position.x - synth.frequency(freq) + # synth.frequency(freq) # phasor_bend.x = event.position.x / 1024 # phasor_bend.y = event.position.y / 600 fm_multiplier = 600 / (event.position.y + 1) |