From e598f10e17b317386ae8681e664a0c250c7f2dbe Mon Sep 17 00:00:00 2001 From: Grant Shangreaux Date: Sun, 31 Oct 2021 00:06:25 -0500 Subject: Clean: remove clear buffer calls,factor out check_waveform() [godot] --- klangfarb/main.gd | 7 ++++--- 1 file 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: -- cgit v1.2.3