Update Audio demos to Godot 4

This commit is contained in:
Aaron Franke
2022-03-26 20:15:00 -05:00
parent 27e4e36e03
commit 0e2c5ad182
31 changed files with 241 additions and 234 deletions

View File

@@ -33,7 +33,7 @@ func _process(_delta):
var time = 0.0
if sync_source == SyncSource.SYSTEM_CLOCK:
# Obtain from ticks.
time = (OS.get_ticks_usec() - time_begin) / 1000000.0
time = (Time.get_ticks_usec() - time_begin) / 1000000.0
# Compensate.
time -= time_delay
elif sync_source == SyncSource.SOUND_CLOCK:
@@ -42,12 +42,13 @@ func _process(_delta):
var beat = int(time * BPM / 60.0)
var seconds = int(time)
var seconds_total = int($Player.stream.get_length())
@warning_ignore(integer_division)
$Label.text = str("BEAT: ", beat % BARS + 1, "/", BARS, " TIME: ", seconds / 60, ":", strsec(seconds % 60), " / ", seconds_total / 60, ":", strsec(seconds_total % 60))
func _on_PlaySystem_pressed():
sync_source = SyncSource.SYSTEM_CLOCK
time_begin = OS.get_ticks_usec()
time_begin = Time.get_ticks_usec()
time_delay = AudioServer.get_time_to_next_mix() + AudioServer.get_output_latency()
playing = true
$Player.play()

View File

@@ -1,60 +1,43 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=7 format=3 uid="uid://qfdnp4pliele"]
[ext_resource path="res://play_system_button_hl.png" type="Texture2D" id=1]
[ext_resource path="res://play_sound_button.png" type="Texture2D" id=2]
[ext_resource path="res://the_comeback2.ogg" type="AudioStream" id=3]
[ext_resource path="res://play_sound_button_hl.png" type="Texture2D" id=4]
[ext_resource path="res://play_system_button.png" type="Texture2D" id=5]
[ext_resource path="res://lcd.ttf" type="FontData" id=6]
[ext_resource path="res://bpm_sync.gd" type="Script" id=7]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color(0, 0, 0, 1)
[sub_resource type="Font" id=2]
size = 40
outline_size = 2
outline_color = Color(0.588235, 0.886275, 0.435294, 0.239216)
font_data = ExtResource( 6 )
[ext_resource type="Texture2D" uid="uid://b1m28vixtwkx0" path="res://play_system_button_hl.png" id="1"]
[ext_resource type="Texture2D" uid="uid://bvcb3q4c3414p" path="res://play_sound_button.png" id="2"]
[ext_resource type="AudioStream" uid="uid://dumjxbamq37fe" path="res://the_comeback2.ogg" id="3"]
[ext_resource type="Texture2D" uid="uid://y41g3g5d88f3" path="res://play_sound_button_hl.png" id="4"]
[ext_resource type="Texture2D" uid="uid://cdpaolglwepko" path="res://play_system_button.png" id="5"]
[ext_resource type="Script" path="res://bpm_sync.gd" id="7"]
[node name="BPMSync" type="Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
custom_styles/panel = SubResource( 1 )
script = ExtResource( 7 )
__meta__ = {
"_edit_use_anchors_": false
}
script = ExtResource( "7" )
[node name="Label" type="Label" parent="."]
offset_left = 106.895
offset_top = 427.158
offset_right = 914.895
offset_bottom = 488.158
custom_colors/font_color = Color(0.552941, 0.984314, 0.501961, 1)
custom_fonts/font = SubResource( 2 )
align = 1
[node name="Player" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
stream = ExtResource( "3" )
[node name="PlaySystem" type="TextureButton" parent="."]
offset_left = 214.737
offset_top = 187.368
offset_right = 342.737
offset_bottom = 315.368
texture_normal = ExtResource( 5 )
texture_pressed = ExtResource( 5 )
texture_hover = ExtResource( 1 )
texture_normal = ExtResource( "5" )
texture_pressed = ExtResource( "5" )
texture_hover = ExtResource( "1" )
[node name="PlaySound" type="TextureButton" parent="."]
offset_left = 622.105
offset_top = 183.158
offset_right = 750.105
offset_bottom = 311.158
texture_normal = ExtResource( 2 )
texture_pressed = ExtResource( 2 )
texture_hover = ExtResource( 4 )
texture_normal = ExtResource( "2" )
texture_pressed = ExtResource( "2" )
texture_hover = ExtResource( "4" )
[connection signal="pressed" from="PlaySystem" to="." method="_on_PlaySystem_pressed"]
[connection signal="pressed" from="PlaySound" to="." method="_on_PlaySound_pressed"]

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="CompressedTexture2D"
uid="uid://c4abea2a1rfa7"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontData"
uid="uid://dh3iuml41q2uq"
path="res://.godot/imported/lcd.ttf-94000d26745ba06b3dc55e650290dad3.fontdata"
[deps]
source_file="res://lcd.ttf"
dest_files=["res://.godot/imported/lcd.ttf-94000d26745ba06b3dc55e650290dad3.fontdata"]
[params]
antialiased=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}
preload/char_ranges=PackedStringArray()
preload/glyph_ranges=PackedStringArray()
preload/configurations=PackedStringArray()
support_overrides/language_enabled=PackedStringArray()
support_overrides/language_disabled=PackedStringArray()
support_overrides/script_enabled=PackedStringArray()
support_overrides/script_disabled=PackedStringArray()

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.stex"
type="CompressedTexture2D"
uid="uid://bvcb3q4c3414p"
path="res://.godot/imported/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://play_sound_button.png"
dest_files=["res://.godot/imported/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.stex"]
dest_files=["res://.godot/imported/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.stex"
type="CompressedTexture2D"
uid="uid://y41g3g5d88f3"
path="res://.godot/imported/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://play_sound_button_hl.png"
dest_files=["res://.godot/imported/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.stex"]
dest_files=["res://.godot/imported/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.stex"
type="CompressedTexture2D"
uid="uid://cdpaolglwepko"
path="res://.godot/imported/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://play_system_button.png"
dest_files=["res://.godot/imported/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.stex"]
dest_files=["res://.godot/imported/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.stex"
type="CompressedTexture2D"
uid="uid://b1m28vixtwkx0"
path="res://.godot/imported/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://play_system_button_hl.png"
dest_files=["res://.godot/imported/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.stex"]
dest_files=["res://.godot/imported/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -6,7 +6,7 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
config_version=5
[application]
@@ -14,6 +14,7 @@ config/name="BPM Sync Demo"
config/description="A demo of how to sync the audio playback with the time for a consistent BPM."
run/main_scene="res://bpm_sync.tscn"
config/icon="res://icon.png"
config/features=PackedStringArray("4.0")
[rendering]

View File

@@ -1,13 +1,14 @@
[remap]
importer="ogg_vorbis"
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
path="res://.godot/imported/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggstr"
uid="uid://dumjxbamq37fe"
path="res://.godot/imported/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggvorbisstr"
[deps]
source_file="res://the_comeback2.ogg"
dest_files=["res://.godot/imported/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggstr"]
dest_files=["res://.godot/imported/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggvorbisstr"]
[params]

View File

@@ -1,12 +1,12 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=3 format=3 uid="uid://co1ys4ggr68mk"]
[ext_resource path="res://Changer.gd" type="Script" id=1]
[ext_resource path="res://Intro.ogg" type="AudioStream" id=2]
[ext_resource type="Script" path="res://Changer.gd" id="1"]
[ext_resource type="AudioStream" uid="uid://k0y5fyud50c1" path="res://Intro.ogg" id="2"]
[node name="Changer" type="Control"]
offset_right = 1023.0
offset_bottom = 598.0
script = ExtResource( 1 )
script = ExtResource( "1" )
__meta__ = {
"_edit_use_anchors_": false
}
@@ -25,7 +25,6 @@ offset_left = 321.0
offset_top = 248.0
offset_right = 660.0
offset_bottom = 284.0
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -45,7 +44,7 @@ offset_bottom = 414.0
text = "Play Audio"
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 2 )
stream = ExtResource( "2" )
volume_db = -6.0
[connection signal="button_down" from="SetDevice" to="." method="_on_Button_button_down"]

View File

@@ -1,13 +1,14 @@
[remap]
importer="ogg_vorbis"
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
path="res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"
uid="uid://k0y5fyud50c1"
path="res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggvorbisstr"
[deps]
source_file="res://Intro.ogg"
dest_files=["res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"]
dest_files=["res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggvorbisstr"]
[params]

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="CompressedTexture2D"
uid="uid://b2c5h4v8srxqh"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -6,7 +6,7 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
config_version=5
[application]
@@ -14,6 +14,7 @@ config/name="Audio Device Changer Demo"
config/description="This is a demo showing how the audio output device can be changed from Godot."
run/main_scene="res://Changer.tscn"
config/icon="res://icon.png"
config/features=PackedStringArray("4.0")
[input]
@@ -44,7 +45,7 @@ ui_focus_next={
}
ui_focus_prev={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":0,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
ui_left={

View File

@@ -1,11 +1,12 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=3 format=3 uid="uid://deuhq8h4ymo7y"]
[ext_resource path="res://generator_demo.gd" type="Script" id=1]
[ext_resource type="Script" path="res://generator_demo.gd" id="1"]
[sub_resource type="AudioStreamGenerator" id=1]
[sub_resource type="AudioStreamGenerator" id="AudioStreamGenerator_8tsrq"]
[node name="Generator" type="Node"]
script = ExtResource( 1 )
script = ExtResource( "1" )
[node name="Player" type="AudioStreamPlayer" parent="."]
stream = SubResource( 1 )
stream = SubResource( "AudioStreamGenerator_8tsrq" )
autoplay = true

View File

@@ -6,7 +6,7 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
config_version=5
[application]
@@ -15,6 +15,7 @@ config/description="This is a demo showing how one can generate and
play audio samples from GDScript.
It plays a simple 440 Hz sine wave at 22050 Hz."
run/main_scene="res://generator.tscn"
config/features=PackedStringArray("4.0")
[rendering]

View File

@@ -1,13 +1,14 @@
[remap]
importer="ogg_vorbis"
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
path="res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"
uid="uid://c2re52petqrvx"
path="res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggvorbisstr"
[deps]
source_file="res://Intro.ogg"
dest_files=["res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"]
dest_files=["res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggvorbisstr"]
[params]

View File

@@ -1,9 +1,9 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=4 format=3 uid="uid://dvjlkpjvjxn0h"]
[ext_resource path="res://MicRecord.gd" type="Script" id=1]
[ext_resource path="res://Intro.ogg" type="AudioStream" id=2]
[ext_resource type="Script" path="res://MicRecord.gd" id="1"]
[ext_resource type="AudioStream" uid="uid://c2re52petqrvx" path="res://Intro.ogg" id="2"]
[sub_resource type="AudioStreamMicrophone" id=1]
[sub_resource type="AudioStreamMicrophone" id="1"]
[node name="MicRecord" type="Control"]
anchor_left = 0.5
@@ -14,21 +14,21 @@ offset_left = -320.0
offset_top = -240.0
offset_right = 320.0
offset_bottom = 240.0
script = ExtResource( 1 )
script = ExtResource( "1" )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AudioStreamRecord" type="AudioStreamPlayer" parent="."]
stream = SubResource( 1 )
stream = SubResource( "1" )
autoplay = true
bus = "Record"
bus = &"Record"
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
autoplay = true
[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 2 )
stream = ExtResource( "2" )
volume_db = -6.0
[node name="RecordButton" type="Button" parent="."]

View File

@@ -1,14 +1,14 @@
[gd_resource type="AudioBusLayout" load_steps=2 format=2]
[gd_resource type="AudioBusLayout" load_steps=2 format=3 uid="uid://tuxl6tvrr2dv"]
[sub_resource type="AudioEffectRecord" id=1]
[sub_resource type="AudioEffectRecord" id="AudioEffectRecord_fo272"]
resource_name = "Record"
[resource]
bus/1/name = "Record"
bus/1/name = &"Record"
bus/1/solo = false
bus/1/mute = true
bus/1/bypass_fx = false
bus/1/volume_db = 0.0
bus/1/send = "Master"
bus/1/effect/0/effect = SubResource( 1 )
bus/1/send = &"Master"
bus/1/effect/0/effect = SubResource( "AudioEffectRecord_fo272" )
bus/1/effect/0/enabled = true

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="CompressedTexture2D"
uid="uid://bwvlicmcf68wr"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -6,7 +6,7 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
config_version=5
[application]
@@ -15,18 +15,19 @@ config/description="This is an example showing how one can record audio from
the microphone and later play it back or save it to a file."
run/main_scene="res://MicRecord.tscn"
config/icon="res://icon.png"
config/features=PackedStringArray("4.0")
[audio]
driver/enable_input=true
enable_audio_input=true
[display]
window/size/width=640
window/size/height=480
window/dpi/allow_hidpi=true
window/stretch/mode="2d"
window/stretch/aspect="expand"
window/size/width=640
window/size/height=480
[rendering]

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="CompressedTexture2D"
uid="uid://dvvb5jjvp5sgs"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,13 +1,12 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=2 format=3 uid="uid://dctcehelc4sv0"]
[ext_resource path="res://piano.gd" type="Script" id=1]
[ext_resource type="Script" path="res://piano.gd" id="1"]
[node name="Piano" type="ColorRect"]
anchor_right = 1.0
anchor_bottom = 1.0
rect_min_size = Vector2(200, 20)
color = Color(0, 0, 0, 1)
script = ExtResource( 1 )
script = ExtResource( "1" )
__meta__ = {
"_edit_use_anchors_": false
}
@@ -15,9 +14,7 @@ __meta__ = {
[node name="WhiteKeys" type="HBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
rect_min_size = Vector2(200, 0)
mouse_filter = 2
custom_constants/separation = 0
__meta__ = {
"_edit_use_anchors_": false
}
@@ -25,9 +22,7 @@ __meta__ = {
[node name="BlackKeys" type="HBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 0.6
rect_min_size = Vector2(100, 0)
mouse_filter = 2
custom_constants/separation = 0
__meta__ = {
"_edit_use_anchors_": false
}

View File

@@ -2,6 +2,7 @@
importer="wav"
type="AudioStreamSample"
uid="uid://bhrmpdp36ixuq"
path="res://.godot/imported/A440.wav-f6ecb7d5a329df710ac81894c403bbb6.sample"
[deps]
@@ -17,5 +18,7 @@ force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View File

@@ -6,7 +6,7 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
config_version=5
_global_script_classes=[{
"base": "Control",
@@ -23,6 +23,7 @@ _global_script_class_icons={
config/name="MIDI Piano Demo"
run/main_scene="res://piano.tscn"
config/icon="res://icon.png"
config/features=PackedStringArray("4.0")
[display]

View File

@@ -1,8 +1,8 @@
[gd_resource type="AudioBusLayout" load_steps=2 format=2]
[gd_resource type="AudioBusLayout" load_steps=2 format=3 uid="uid://byxtiup0hs2og"]
[sub_resource type="AudioEffectSpectrumAnalyzer" id=1]
[sub_resource type="AudioEffectSpectrumAnalyzer" id="AudioEffectSpectrumAnalyzer_m7e3v"]
resource_name = "SpectrumAnalyzer"
[resource]
bus/0/effect/0/effect = SubResource( 1 )
bus/0/effect/0/effect = SubResource( "AudioEffectSpectrumAnalyzer_m7e3v" )
bus/0/effect/0/enabled = true

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="CompressedTexture2D"
uid="uid://bfxidvaendq54"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,23 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,13 +1,14 @@
[remap]
importer="ogg_vorbis"
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
path="res://.godot/imported/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggstr"
uid="uid://dl3ppges2sw77"
path="res://.godot/imported/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggvorbisstr"
[deps]
source_file="res://maldita.ogg"
dest_files=["res://.godot/imported/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggstr"]
dest_files=["res://.godot/imported/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggvorbisstr"]
[params]

View File

@@ -6,7 +6,7 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
config_version=5
[application]
@@ -14,6 +14,7 @@ config/name="Audio Spectrum Demo"
config/description="This is a demo showing how a spectrum analyzer can be built using Godot."
run/main_scene="res://show_spectrum.tscn"
config/icon="res://icon.png"
config/features=PackedStringArray("4.0")
[rendering]

View File

@@ -11,7 +11,7 @@ const MIN_DB = 60
var spectrum
func _draw():
#warning-ignore:integer_division
@warning_ignore(integer_division)
var w = WIDTH / VU_COUNT
var prev_hz = 0
for i in range(1, VU_COUNT+1):
@@ -28,4 +28,4 @@ func _process(_delta):
func _ready():
spectrum = AudioServer.get_bus_effect_instance(0,0)
spectrum = AudioServer.get_bus_effect_instance(0, 0)

View File

@@ -1,11 +1,11 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=3 format=3 uid="uid://dfyeamw4sg2af"]
[ext_resource path="res://show_spectrum.gd" type="Script" id=1]
[ext_resource path="res://maldita.ogg" type="AudioStream" id=2]
[ext_resource type="Script" path="res://show_spectrum.gd" id="1"]
[ext_resource type="AudioStream" uid="uid://dl3ppges2sw77" path="res://maldita.ogg" id="2"]
[node name="ShowSpectrum" type="Node2D"]
script = ExtResource( 1 )
script = ExtResource( "1" )
[node name="Player" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 2 )
stream = ExtResource( "2" )
autoplay = true