From 53ed2bbc2ef35dc01932b83119b0df4862019c4b Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:56:13 +0900 Subject: [PATCH] input --- src/Home/Tracker/MusicTracker.ZC | 33 +++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/Home/Tracker/MusicTracker.ZC b/src/Home/Tracker/MusicTracker.ZC index 79aebd9e..c23b36ce 100755 --- a/src/Home/Tracker/MusicTracker.ZC +++ b/src/Home/Tracker/MusicTracker.ZC @@ -95,9 +95,36 @@ U0 EnterPattern(Pattern *pattern) { cell->velocity = KeyGet(&sc); "%d\n", cell->velocity; if (cell->velocity) { - Print("Enter instrument for note (0-4): "); - cell->instrument = KeyGet(&sc); - "%d\n", cell->instrument; + Print("Enter instrument for note (1-5): "); + switch (KeyGet(&sc)) { + case '1': + cell->instrument = PULSE1; + "PULSE1\n"; + break; + case '2': + cell->instrument = PULSE2; + "PULSE2\n"; + break; + case '3': + cell->instrument = TRIANGLE; + "TRIANGLE\n"; + break; + case '4': + cell->instrument = NOISE; + "NOISE\n"; + break; + case '5': + cell->instrument = SAMPLE; + "SAMPLE\n"; + break; + default: + Print("Invalid choice.\n"); + cell->instrument = INSTRUMENT_NONE; + "SINE\n"; + break; + // return; + } + AudioPlayNote(cell->note, cell->velocity, cell->instrument); } }