diff options
author | Jacob Lee <jacob@unabridgedsoftware.com> | 2021-10-27 22:46:58 -0400 |
---|---|---|
committer | Jacob Lee <jacob@unabridgedsoftware.com> | 2021-10-27 22:46:58 -0400 |
commit | ffacb1c96b02507f1bdd612bd71b6bcc7d114505 (patch) | |
tree | b79a7b9f4a9afe4f1a9cf4d3e2f0d853bf14f5d9 /klangfarb | |
parent | 7bd9dd418ac6215094feb87087fcb59499c3aa69 (diff) |
Clean up
Diffstat (limited to 'klangfarb')
-rw-r--r-- | klangfarb/Main.tscn | 1 | ||||
-rwxr-xr-x | klangfarb/libklangfarbrs.so | bin | 20371304 -> 20147240 bytes | |||
-rw-r--r-- | klangfarb/main.gd | 12 |
3 files changed, 3 insertions, 10 deletions
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 Binary files differindex c7b448a..280cd61 100755 --- a/klangfarb/libklangfarbrs.so +++ b/klangfarb/libklangfarbrs.so 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() - |