From a78f43d5a79e0bbe0d41d60b3527da3cfec7f117 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Thu, 11 Nov 2021 13:05:20 -0500 Subject: Implement White/Brown noise. Refactor needed --- klangfarb/Main.tscn | 2 ++ klangfarb/main.gd | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'klangfarb') 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(): -- cgit v1.2.3