Reorganize

This commit is contained in:
Isaac Shoebottom 2024-06-26 23:49:24 -03:00
parent 1c3d8546bd
commit 736344e8ad
12 changed files with 462 additions and 403 deletions

View File

@ -1,3 +0,0 @@
extends Node
signal chord_changed(chord: String)

View File

@ -1,384 +0,0 @@
[gd_scene load_steps=4 format=3 uid="uid://b4fgp0mhbgkfw"]
[ext_resource type="Script" path="res://RhythmController.gd" id="1_judyc"]
[ext_resource type="Script" path="res://ChordController.gd" id="2_ha4gq"]
[ext_resource type="Script" path="res://NoteController.gd" id="2_w8g0m"]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
[node name="NotePlayer" type="AudioStreamPlayer" parent="."]
max_polyphony = 2
[node name="ChordPlayer" type="AudioStreamPlayer" parent="."]
[node name="RhythmPlayer" type="AudioStreamPlayer" parent="."]
[node name="Player" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -250.0
offset_top = -68.0
offset_right = 250.0
offset_bottom = 68.0
grow_horizontal = 2
grow_vertical = 2
[node name="Rhythm" type="GridContainer" parent="Player"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
columns = 2
[node name="rock" type="Button" parent="Player/Rhythm"]
layout_mode = 2
text = "Rock"
script = ExtResource("1_judyc")
[node name="waltz" type="Button" parent="Player/Rhythm"]
layout_mode = 2
text = "Waltz"
script = ExtResource("1_judyc")
[node name="slowrock" type="Button" parent="Player/Rhythm"]
layout_mode = 2
text = "Slow Rock"
script = ExtResource("1_judyc")
[node name="latin" type="Button" parent="Player/Rhythm"]
layout_mode = 2
text = "Latin"
script = ExtResource("1_judyc")
[node name="foxtrot" type="Button" parent="Player/Rhythm"]
layout_mode = 2
text = "Fox Trot"
script = ExtResource("1_judyc")
[node name="swing" type="Button" parent="Player/Rhythm"]
layout_mode = 2
text = "Swing"
script = ExtResource("1_judyc")
[node name="Chords" type="GridContainer" parent="Player"]
layout_mode = 2
columns = 10
[node name="Corner" type="Control" parent="Player/Chords"]
layout_mode = 2
[node name="Eb" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "Eb"
[node name="Bb" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "Bb"
[node name="F" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "F"
[node name="C" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "C"
[node name="G" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "G"
[node name="D" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "D"
[node name="A" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "A"
[node name="E" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "E"
[node name="B" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "B"
[node name="Major" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "Major"
[node name="eb" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "Q"
script = ExtResource("2_ha4gq")
[node name="bb" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "W"
script = ExtResource("2_ha4gq")
[node name="f" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "E"
script = ExtResource("2_ha4gq")
[node name="c" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "R "
script = ExtResource("2_ha4gq")
[node name="g" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "T"
script = ExtResource("2_ha4gq")
[node name="d" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "Y"
script = ExtResource("2_ha4gq")
[node name="a" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "U"
script = ExtResource("2_ha4gq")
[node name="e" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "I"
script = ExtResource("2_ha4gq")
[node name="b" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "O"
script = ExtResource("2_ha4gq")
[node name="Minor" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "Minor
"
[node name="ebm" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "A"
script = ExtResource("2_ha4gq")
[node name="bbm" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "S"
script = ExtResource("2_ha4gq")
[node name="fm" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "D"
script = ExtResource("2_ha4gq")
[node name="cm" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "F"
script = ExtResource("2_ha4gq")
[node name="gm" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "G"
script = ExtResource("2_ha4gq")
[node name="dm" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "H"
script = ExtResource("2_ha4gq")
[node name="am" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "J"
script = ExtResource("2_ha4gq")
[node name="em" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "K"
script = ExtResource("2_ha4gq")
[node name="bm" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "L"
script = ExtResource("2_ha4gq")
[node name="7th" type="Label" parent="Player/Chords"]
layout_mode = 2
text = "7th
"
[node name="eb7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "Z"
script = ExtResource("2_ha4gq")
[node name="bb7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "X"
script = ExtResource("2_ha4gq")
[node name="f7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "C"
script = ExtResource("2_ha4gq")
[node name="c7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "V"
script = ExtResource("2_ha4gq")
[node name="g7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "B"
script = ExtResource("2_ha4gq")
[node name="d7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "N"
script = ExtResource("2_ha4gq")
[node name="a7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "M"
script = ExtResource("2_ha4gq")
[node name="e7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = ","
script = ExtResource("2_ha4gq")
[node name="b7" type="Button" parent="Player/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "."
script = ExtResource("2_ha4gq")
[node name="Notes" type="GridContainer" parent="Player"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
columns = 3
[node name="11" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "/"
script = ExtResource("2_w8g0m")
[node name="10" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "*"
script = ExtResource("2_w8g0m")
[node name="9" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "-"
script = ExtResource("2_w8g0m")
[node name="6" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "7"
script = ExtResource("2_w8g0m")
[node name="7" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "8"
script = ExtResource("2_w8g0m")
[node name="8" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "9"
script = ExtResource("2_w8g0m")
[node name="3" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "4"
script = ExtResource("2_w8g0m")
[node name="4" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "5"
script = ExtResource("2_w8g0m")
[node name="5" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "6"
script = ExtResource("2_w8g0m")
[node name="0" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "1"
script = ExtResource("2_w8g0m")
[node name="1" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "2"
script = ExtResource("2_w8g0m")
[node name="2" type="Button" parent="Player/Notes"]
layout_mode = 2
text = "3"
script = ExtResource("2_w8g0m")

View File

Before

Width:  |  Height:  |  Size: 949 B

After

Width:  |  Height:  |  Size: 949 B

View File

@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://3g6eqt24vrvk" uid="uid://3g6eqt24vrvk"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" path="res://.godot/imported/icon.svg-3629612f1967f9e645af99eed2b8b758.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://icon.svg" source_file="res://icons/icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] dest_files=["res://.godot/imported/icon.svg-3629612f1967f9e645af99eed2b8b758.ctex"]
[params] [params]

View File

@ -11,19 +11,14 @@ config_version=5
[application] [application]
config/name="Omnichord Godot" config/name="Omnichord Godot"
run/main_scene="res://Omnichord.tscn" run/main_scene="res://scenes/Omnichord.tscn"
config/features=PackedStringArray("4.2", "GL Compatibility") config/features=PackedStringArray("4.2", "GL Compatibility")
config/icon="res://icon.svg" config/icon="res://icons/icon.svg"
[autoload] [autoload]
Global="*res://Global.gd" Global="*res://scripts/Global.gd"
[dotnet] [dotnet]
project/assembly_name="Omnichord Godot" project/assembly_name="Omnichord Godot"
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"

413
scenes/Omnichord.tscn Normal file
View File

@ -0,0 +1,413 @@
[gd_scene load_steps=6 format=3 uid="uid://b4fgp0mhbgkfw"]
[ext_resource type="Script" path="res://scripts/StopController.gd" id="1_5jtep"]
[ext_resource type="Script" path="res://scripts/RhythmController.gd" id="2_3cx1r"]
[ext_resource type="Script" path="res://scripts/LoopController.gd" id="3_5v5ci"]
[ext_resource type="Script" path="res://scripts/ChordController.gd" id="4_xrjq4"]
[ext_resource type="Script" path="res://scripts/NoteController.gd" id="5_x2vij"]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
[node name="NotePlayer" type="AudioStreamPlayer" parent="."]
max_polyphony = 2
[node name="ChordPlayer" type="AudioStreamPlayer" parent="."]
[node name="RhythmPlayer" type="AudioStreamPlayer" parent="."]
[node name="App" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -262.5
offset_top = -70.0
offset_right = 262.5
offset_bottom = 70.0
grow_horizontal = 2
grow_vertical = 2
[node name="Sliders" type="HBoxContainer" parent="App"]
layout_mode = 2
[node name="GridContainer" type="GridContainer" parent="App/Sliders"]
layout_mode = 2
[node name="HSlider" type="HSlider" parent="App/Sliders/GridContainer"]
layout_mode = 2
[node name="Buttons" type="HBoxContainer" parent="App"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
[node name="RhythmControls" type="VBoxContainer" parent="App/Buttons"]
layout_mode = 2
[node name="Stop" type="Button" parent="App/Buttons/RhythmControls"]
layout_mode = 2
text = "Stop"
script = ExtResource("1_5jtep")
[node name="Rhythm" type="GridContainer" parent="App/Buttons/RhythmControls"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
columns = 2
[node name="rock" type="Button" parent="App/Buttons/RhythmControls/Rhythm"]
layout_mode = 2
text = "Rock"
script = ExtResource("2_3cx1r")
[node name="waltz" type="Button" parent="App/Buttons/RhythmControls/Rhythm"]
layout_mode = 2
text = "Waltz"
script = ExtResource("2_3cx1r")
[node name="slowrock" type="Button" parent="App/Buttons/RhythmControls/Rhythm"]
layout_mode = 2
text = "Slow Rock"
script = ExtResource("2_3cx1r")
[node name="latin" type="Button" parent="App/Buttons/RhythmControls/Rhythm"]
layout_mode = 2
text = "Latin"
script = ExtResource("2_3cx1r")
[node name="foxtrot" type="Button" parent="App/Buttons/RhythmControls/Rhythm"]
layout_mode = 2
text = "Fox Trot"
script = ExtResource("2_3cx1r")
[node name="swing" type="Button" parent="App/Buttons/RhythmControls/Rhythm"]
layout_mode = 2
text = "Swing"
script = ExtResource("2_3cx1r")
[node name="Chords" type="GridContainer" parent="App/Buttons"]
layout_mode = 2
columns = 10
[node name="Loop" type="CheckButton" parent="App/Buttons/Chords"]
layout_mode = 2
text = "Loop"
script = ExtResource("3_5v5ci")
[node name="Eb" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "Eb"
[node name="Bb" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "Bb"
[node name="F" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "F"
[node name="C" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "C"
[node name="G" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "G"
[node name="D" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "D"
[node name="A" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "A"
[node name="E" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "E"
[node name="B" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
text = "B"
[node name="Major" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 4
text = "Major"
[node name="eb" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "Q"
script = ExtResource("4_xrjq4")
[node name="bb" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "W"
script = ExtResource("4_xrjq4")
[node name="f" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "E"
script = ExtResource("4_xrjq4")
[node name="c" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "R "
script = ExtResource("4_xrjq4")
[node name="g" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "T"
script = ExtResource("4_xrjq4")
[node name="d" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "Y"
script = ExtResource("4_xrjq4")
[node name="a" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "U"
script = ExtResource("4_xrjq4")
[node name="e" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "I"
script = ExtResource("4_xrjq4")
[node name="b" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "O"
script = ExtResource("4_xrjq4")
[node name="Minor" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 4
text = "Minor
"
[node name="ebm" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "A"
script = ExtResource("4_xrjq4")
[node name="bbm" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "S"
script = ExtResource("4_xrjq4")
[node name="fm" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "D"
script = ExtResource("4_xrjq4")
[node name="cm" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "F"
script = ExtResource("4_xrjq4")
[node name="gm" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "G"
script = ExtResource("4_xrjq4")
[node name="dm" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "H"
script = ExtResource("4_xrjq4")
[node name="am" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "J"
script = ExtResource("4_xrjq4")
[node name="em" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "K"
script = ExtResource("4_xrjq4")
[node name="bm" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "L"
script = ExtResource("4_xrjq4")
[node name="7th" type="Label" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 4
text = "7th
"
[node name="eb7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "Z"
script = ExtResource("4_xrjq4")
[node name="bb7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "X"
script = ExtResource("4_xrjq4")
[node name="f7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "C"
script = ExtResource("4_xrjq4")
[node name="c7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "V"
script = ExtResource("4_xrjq4")
[node name="g7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "B"
script = ExtResource("4_xrjq4")
[node name="d7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "N"
script = ExtResource("4_xrjq4")
[node name="a7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "M"
script = ExtResource("4_xrjq4")
[node name="e7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = ","
script = ExtResource("4_xrjq4")
[node name="b7" type="Button" parent="App/Buttons/Chords"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
text = "."
script = ExtResource("4_xrjq4")
[node name="Notes" type="GridContainer" parent="App/Buttons"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
columns = 3
[node name="11" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "/"
script = ExtResource("5_x2vij")
[node name="10" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "*"
script = ExtResource("5_x2vij")
[node name="9" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "-"
script = ExtResource("5_x2vij")
[node name="6" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "7"
script = ExtResource("5_x2vij")
[node name="7" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "8"
script = ExtResource("5_x2vij")
[node name="8" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "9"
script = ExtResource("5_x2vij")
[node name="3" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "4"
script = ExtResource("5_x2vij")
[node name="4" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "5"
script = ExtResource("5_x2vij")
[node name="5" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "6"
script = ExtResource("5_x2vij")
[node name="0" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "1"
script = ExtResource("5_x2vij")
[node name="1" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "2"
script = ExtResource("5_x2vij")
[node name="2" type="Button" parent="App/Buttons/Notes"]
layout_mode = 2
text = "3"
script = ExtResource("5_x2vij")

View File

@ -7,13 +7,19 @@ var ChordAudio: AudioStreamOggVorbis
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
ChordPlayer = get_node("/root/Control/ChordPlayer") ChordPlayer = get_node("/root/Control/ChordPlayer")
var resource_string = "res://audio/%s/%s-chord.wav" % [self.name, self.name] var resource_string = "res://audio/%s/%s-chord.ogg" % [self.name, self.name]
var resource = load(resource_string) var resource = load(resource_string)
ChordAudio = resource ChordAudio = resource
self.connect("pressed", self.button_pressed) self.pressed.connect(button_pressed)
Global.loop_changed.connect(loop_changed)
func button_pressed(): func button_pressed():
# Play chord # Play chord
ChordPlayer.stream = ChordAudio ChordPlayer.stream = ChordAudio
ChordPlayer.play() ChordPlayer.play()
Global.chord_changed.emit(self.name) Global.chord_changed.emit(self.name)
func loop_changed(state: bool):
ChordAudio.loop = state
if (!state):
ChordPlayer.stop()

10
scripts/Global.gd Normal file
View File

@ -0,0 +1,10 @@
extends Node
signal chord_changed(chord: String)
signal loop_changed(state: bool)
signal note_volume(vol: float)
signal chord_volume(vol: float)
signal rhythm_volume(vol: float)
signal rhythm_tempo(tempo: float)

View File

@ -0,0 +1,8 @@
extends Node
# Called when the node enters the scene tree for the first time.
func _ready():
self.toggled.connect(on_toggle)
func on_toggle(state: bool):
Global.loop_changed.emit(state)

View File

@ -7,7 +7,7 @@ var NoteAudio: AudioStreamOggVorbis
func _ready(): func _ready():
NotePlayer = get_node("/root/Control/NotePlayer") NotePlayer = get_node("/root/Control/NotePlayer")
Global.chord_changed.connect(chord_changed) Global.chord_changed.connect(chord_changed)
self.connect("pressed", self.button_pressed) self.pressed.connect(button_pressed)
func button_pressed(): func button_pressed():
# Play chord # Play chord
@ -15,6 +15,6 @@ func button_pressed():
NotePlayer.play() NotePlayer.play()
func chord_changed(chord): func chord_changed(chord):
var resource_string = "res://audio/%s/%s%s.wav" % [chord, chord, self.name] var resource_string = "res://audio/%s/%s%s.ogg" % [chord, chord, self.name]
var resource = load(resource_string) var resource = load(resource_string)
NoteAudio = resource NoteAudio = resource

View File

@ -10,9 +10,10 @@ func _ready():
var resource_string = "res://audio/rhythm/%s.ogg" % self.name var resource_string = "res://audio/rhythm/%s.ogg" % self.name
var resource = load(resource_string) var resource = load(resource_string)
RhythmAudio = resource RhythmAudio = resource
self.connect("pressed", self.button_pressed) self.pressed.connect(button_pressed)
func button_pressed(): func button_pressed():
# Play chord # Play chord
RhythmPlayer.stream = RhythmAudio RhythmPlayer.stream = RhythmAudio
RhythmAudio.loop = true
RhythmPlayer.play() RhythmPlayer.play()

13
scripts/StopController.gd Normal file
View File

@ -0,0 +1,13 @@
extends Node
# Add asset here
var RhythmPlayer: AudioStreamPlayer
# Called when the node enters the scene tree for the first time.
func _ready():
RhythmPlayer = get_node("/root/Control/RhythmPlayer")
self.pressed.connect(button_pressed)
func button_pressed():
# Play chord
RhythmPlayer.stop()