From d667339e57280926b2897e704d93ef3fee57f1a3 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Mon, 29 Apr 2024 13:32:37 +0200 Subject: [PATCH] Fix generation of the MIDI note to key code conversion table --- src/processor/siopm_ref_table.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/processor/siopm_ref_table.cpp b/src/processor/siopm_ref_table.cpp index f529e5d..653de7a 100644 --- a/src/processor/siopm_ref_table.cpp +++ b/src/processor/siopm_ref_table.cpp @@ -271,9 +271,7 @@ void SiOPMRefTable::_create_eg_tables() { void SiOPMRefTable::_create_pg_tables() { // MIDI Note Number -> Key Code table - for (int i = 0; i < NOTE_TABLE_SIZE; i++) { - int j = i - (i >> 2); - + for (int i = 0, j = 0; j < NOTE_TABLE_SIZE; i++, j = i - (i >> 2)) { if (i < 16) { note_number_to_key_code[j] = i; } else if (i < KEY_CODE_TABLE_SIZE) {