proper key input

This commit is contained in:
y4my4my4m 2023-09-04 22:05:16 +09:00
parent c92f7db428
commit a2444fc172

View file

@ -101,15 +101,11 @@ U0 EnterPattern(Pattern *pattern) {
NoteCell *cell;
for (row = 0; row < TRACK_LENGTH; row++) {
cell = &pattern->cells[row];
Print("Enter note for row $$LTGREEN$$%d$$FG$$ (0-127, 0 for none): ", row);
cell->note = KeyGet(&sc);
"%d\n", cell->note;
cell->note = I64Get("Enter note for row $$LTGREEN$$%d$$FG$$ (0-127, 0 for none): ", row);
if (cell->note) {
Print("Enter velocity for note (1-127): ");
cell->velocity = KeyGet(&sc);
"%d\n", cell->velocity;
cell->velocity = I64Get("Enter velocity for note (1-127): ");
if (cell->velocity) {
Print("Enter instrument for note (1-5): ");
 Print("Enter instrument for note (1-5): ");
switch (KeyGet(&sc)) {
case '1':
cell->instrument = PULSE1;
@ -133,9 +129,8 @@ U0 EnterPattern(Pattern *pattern) {
break;
default:
cell->instrument = INSTRUMENT_NONE;
"SINE\n";
"SINE\n";
break;
// return;
}
AudioPlayNote(cell->note, cell->velocity, cell->instrument);
@ -229,5 +224,5 @@ U0 MusicTracker() {
}
}
CleanupWaveformGen(); // Free the sample buffer
Kill("Oscilloscope");
//Kill("Oscilloscope");
}