From ffacb1c96b02507f1bdd612bd71b6bcc7d114505 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Wed, 27 Oct 2021 22:46:58 -0400 Subject: Clean up --- klangfarb/Main.tscn | 1 + klangfarb/libklangfarbrs.so | Bin 20371304 -> 20147240 bytes klangfarb/main.gd | 12 ++---------- 3 files changed, 3 insertions(+), 10 deletions(-) (limited to 'klangfarb') diff --git a/klangfarb/Main.tscn b/klangfarb/Main.tscn index 1a32577..da55d83 100644 --- a/klangfarb/Main.tscn +++ b/klangfarb/Main.tscn @@ -6,4 +6,5 @@ [node name="Audio" type="AudioStreamPlayer"] stream = SubResource( 1 ) +volume_db = -27.262 script = ExtResource( 2 ) diff --git a/klangfarb/libklangfarbrs.so b/klangfarb/libklangfarbrs.so index c7b448a..280cd61 100755 Binary files a/klangfarb/libklangfarbrs.so and b/klangfarb/libklangfarbrs.so differ diff --git a/klangfarb/main.gd b/klangfarb/main.gd index d88d431..806850d 100644 --- a/klangfarb/main.gd +++ b/klangfarb/main.gd @@ -3,23 +3,17 @@ var playback: AudioStreamPlayback = null var MonoBuffer = preload("res://MonoBuffer.gdns") var buffer = MonoBuffer.new() -var samples = buffer.frames +var duration = 3 +var samples = buffer.frames(440.0, 44100.0, duration) var sample_count = samples.size() var current_count = 0 -#func _create_generator() -> void: -# stream = AudioStreamGenerator.new() -# stream.mix_rate = 44100.0 # Setting mix rate is only possible before play(). -# playback = get_stream_playback() - func _fill_buffer() -> void: var to_fill = playback.get_frames_available() while to_fill > 0 && current_count != sample_count: var sample_index = current_count playback.push_frame(Vector2.ONE * samples[sample_index]) # Audio frames are stereo. -# _phase = fmod(_phase + frequency() / GDawConfig.sample_rate, 1.0) -# _update_state() to_fill -= 1 current_count += 1 @@ -34,5 +28,3 @@ func _ready() -> void: playback = self.get_stream_playback() _fill_buffer() self.play() -# _update_envelope() - -- cgit v1.2.3