summaryrefslogtreecommitdiff
path: root/klangfarb
diff options
context:
space:
mode:
authorJacob Lee <jacob@unabridgedsoftware.com>2021-11-11 13:05:20 -0500
committerJacob Lee <jacob@unabridgedsoftware.com>2021-11-11 13:05:20 -0500
commita78f43d5a79e0bbe0d41d60b3527da3cfec7f117 (patch)
treeefb1610b2bb7606f41729add2f9d01c0e3894a4f /klangfarb
parenta17829f5412ee0757574b34e34ce78b2975df1fe (diff)
Implement White/Brown noise. Refactor needed
Diffstat (limited to 'klangfarb')
-rw-r--r--klangfarb/Main.tscn2
-rw-r--r--klangfarb/main.gd6
2 files changed, 7 insertions, 1 deletions
diff --git a/klangfarb/Main.tscn b/klangfarb/Main.tscn
index e7a1b90..0c2f046 100644
--- a/klangfarb/Main.tscn
+++ b/klangfarb/Main.tscn
@@ -8,3 +8,5 @@
stream = SubResource( 1 )
volume_db = -13.216
script = ExtResource( 2 )
+frequency_modulation = true
+fm_index = 100.0
diff --git a/klangfarb/main.gd b/klangfarb/main.gd
index c1cb6e8..268934f 100644
--- a/klangfarb/main.gd
+++ b/klangfarb/main.gd
@@ -1,7 +1,7 @@
extends AudioStreamPlayer
# control wave form
-export(String, "sine", "square", "triangle", "sawtooth") var waveform = "sine"
+export(String, "sine", "square", "triangle", "sawtooth", "white_noise", "brown_noise") var waveform = "sine"
# controllable frequency interface
export(float, 20, 8000, 5) var freq = 440.0
# bending the waveform
@@ -50,6 +50,10 @@ func _check_waveform():
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():