diff options
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() - |