summaryrefslogtreecommitdiff
path: root/klangfarb
diff options
context:
space:
mode:
authorGrant Shangreaux <grant@unabridgedsoftware.com>2021-11-01 20:00:34 -0500
committerGrant Shangreaux <grant@unabridgedsoftware.com>2021-11-01 20:00:34 -0500
commita8fd8a74ec114fbde563bca62180a160c3cb8a88 (patch)
tree7bdf1dea3c70e501c6e5030aec1313192309666f /klangfarb
parentc2ef13956710352267ae1583c11efbc745fecfd7 (diff)
Add: mouse control of frequency based on x coord mouse position
Diffstat (limited to 'klangfarb')
-rw-r--r--klangfarb/main.gd8
1 files changed, 8 insertions, 0 deletions
diff --git a/klangfarb/main.gd b/klangfarb/main.gd
index 9735c5f..cf3d8c1 100644
--- a/klangfarb/main.gd
+++ b/klangfarb/main.gd
@@ -48,3 +48,11 @@ func _ready() -> void:
# prefill the stream's sample buffer (which feeds DAC)
_check_waveform()
_fill_buffer()
+
+func _input(event):
+ # Mouse in viewport coordinates.
+ if event is InputEventMouseButton:
+ print("Mouse Click/Unclick at: ", event.position)
+ elif event is InputEventMouseMotion:
+ freq = event.position.x
+ print("Mouse Motion at: ", event.position)