From 736344e8ad1abc65472fa6858d3c0f6cf6641a8d Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Wed, 26 Jun 2024 23:49:24 -0300 Subject: [PATCH] Reorganize --- Global.gd | 3 - Omnichord.tscn | 384 ---------------- icon.svg => icons/icon.svg | 0 icon.svg.import => icons/icon.svg.import | 6 +- project.godot | 11 +- scenes/Omnichord.tscn | 413 ++++++++++++++++++ .../ChordController.gd | 10 +- scripts/Global.gd | 10 + scripts/LoopController.gd | 8 + .../NoteController.gd | 4 +- .../RhythmController.gd | 3 +- scripts/StopController.gd | 13 + 12 files changed, 462 insertions(+), 403 deletions(-) delete mode 100644 Global.gd delete mode 100644 Omnichord.tscn rename icon.svg => icons/icon.svg (100%) rename icon.svg.import => icons/icon.svg.import (77%) create mode 100644 scenes/Omnichord.tscn rename ChordController.gd => scripts/ChordController.gd (64%) create mode 100644 scripts/Global.gd create mode 100644 scripts/LoopController.gd rename NoteController.gd => scripts/NoteController.gd (80%) rename RhythmController.gd => scripts/RhythmController.gd (87%) create mode 100644 scripts/StopController.gd diff --git a/Global.gd b/Global.gd deleted file mode 100644 index 5f76514..0000000 --- a/Global.gd +++ /dev/null @@ -1,3 +0,0 @@ -extends Node - -signal chord_changed(chord: String) diff --git a/Omnichord.tscn b/Omnichord.tscn deleted file mode 100644 index fc88ff7..0000000 --- a/Omnichord.tscn +++ /dev/null @@ -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") diff --git a/icon.svg b/icons/icon.svg similarity index 100% rename from icon.svg rename to icons/icon.svg diff --git a/icon.svg.import b/icons/icon.svg.import similarity index 77% rename from icon.svg.import rename to icons/icon.svg.import index c3de436..fbc8c1a 100644 --- a/icon.svg.import +++ b/icons/icon.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://3g6eqt24vrvk" -path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +path="res://.godot/imported/icon.svg-3629612f1967f9e645af99eed2b8b758.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://icon.svg" -dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] +source_file="res://icons/icon.svg" +dest_files=["res://.godot/imported/icon.svg-3629612f1967f9e645af99eed2b8b758.ctex"] [params] diff --git a/project.godot b/project.godot index 60b0e16..2c375ec 100644 --- a/project.godot +++ b/project.godot @@ -11,19 +11,14 @@ config_version=5 [application] 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/icon="res://icon.svg" +config/icon="res://icons/icon.svg" [autoload] -Global="*res://Global.gd" +Global="*res://scripts/Global.gd" [dotnet] project/assembly_name="Omnichord Godot" - -[rendering] - -renderer/rendering_method="gl_compatibility" -renderer/rendering_method.mobile="gl_compatibility" diff --git a/scenes/Omnichord.tscn b/scenes/Omnichord.tscn new file mode 100644 index 0000000..6f4030f --- /dev/null +++ b/scenes/Omnichord.tscn @@ -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") diff --git a/ChordController.gd b/scripts/ChordController.gd similarity index 64% rename from ChordController.gd rename to scripts/ChordController.gd index b5357d9..9152cf3 100644 --- a/ChordController.gd +++ b/scripts/ChordController.gd @@ -7,13 +7,19 @@ var ChordAudio: AudioStreamOggVorbis # Called when the node enters the scene tree for the first time. func _ready(): 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) ChordAudio = resource - self.connect("pressed", self.button_pressed) + self.pressed.connect(button_pressed) + Global.loop_changed.connect(loop_changed) func button_pressed(): # Play chord ChordPlayer.stream = ChordAudio ChordPlayer.play() Global.chord_changed.emit(self.name) + +func loop_changed(state: bool): + ChordAudio.loop = state + if (!state): + ChordPlayer.stop() diff --git a/scripts/Global.gd b/scripts/Global.gd new file mode 100644 index 0000000..d686d60 --- /dev/null +++ b/scripts/Global.gd @@ -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) diff --git a/scripts/LoopController.gd b/scripts/LoopController.gd new file mode 100644 index 0000000..564277a --- /dev/null +++ b/scripts/LoopController.gd @@ -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) diff --git a/NoteController.gd b/scripts/NoteController.gd similarity index 80% rename from NoteController.gd rename to scripts/NoteController.gd index 866aaae..80785e9 100644 --- a/NoteController.gd +++ b/scripts/NoteController.gd @@ -7,7 +7,7 @@ var NoteAudio: AudioStreamOggVorbis func _ready(): NotePlayer = get_node("/root/Control/NotePlayer") Global.chord_changed.connect(chord_changed) - self.connect("pressed", self.button_pressed) + self.pressed.connect(button_pressed) func button_pressed(): # Play chord @@ -15,6 +15,6 @@ func button_pressed(): NotePlayer.play() 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) NoteAudio = resource diff --git a/RhythmController.gd b/scripts/RhythmController.gd similarity index 87% rename from RhythmController.gd rename to scripts/RhythmController.gd index 4d73aba..3db9c73 100644 --- a/RhythmController.gd +++ b/scripts/RhythmController.gd @@ -10,9 +10,10 @@ func _ready(): var resource_string = "res://audio/rhythm/%s.ogg" % self.name var resource = load(resource_string) RhythmAudio = resource - self.connect("pressed", self.button_pressed) + self.pressed.connect(button_pressed) func button_pressed(): # Play chord RhythmPlayer.stream = RhythmAudio + RhythmAudio.loop = true RhythmPlayer.play() diff --git a/scripts/StopController.gd b/scripts/StopController.gd new file mode 100644 index 0000000..e22f620 --- /dev/null +++ b/scripts/StopController.gd @@ -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()