summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Shangreaux <grant@unabridgedsoftware.com>2021-10-31 00:06:25 -0500
committerGrant Shangreaux <grant@unabridgedsoftware.com>2021-10-31 00:06:25 -0500
commite598f10e17b317386ae8681e664a0c250c7f2dbe (patch)
tree87f4a51f09c7f44bc437f1d1849d7bfbf49bf06a
parent4565611763cbb041384230580f9c7de4fea7da6f (diff)
Clean: remove clear buffer calls,factor out check_waveform() [godot]
-rw-r--r--klangfarb/main.gd7
1 files changed, 4 insertions, 3 deletions
diff --git a/klangfarb/main.gd b/klangfarb/main.gd
index 8abf461..6552490 100644
--- a/klangfarb/main.gd
+++ b/klangfarb/main.gd
@@ -23,13 +23,14 @@ func _fill_buffer() -> void:
# playback stream buffer
playback.push_buffer(wave.frames(freq, to_fill))
-func _process(delta):
+func _check_waveform():
if waveform == "square":
wave.square()
- playback.clear_buffer()
else:
wave.sine()
- playback.clear_buffer()
+
+func _process(_delta):
+ _check_waveform()
_fill_buffer()
func _ready() -> void: