X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fprocess_keycode%2Fprocess_music.c;h=697aa237facdb8dd383a396966d82706b2efffa3;hb=ade22f8e2c272044ea2f80ff6fe5ca9576858939;hp=742bb08b126a557f3484f0eaa6bda12e2a8d6d0c;hpb=96cb9f4661faa80e795b1e6731b7a8e8a50bd0cb;p=qmk_firmware.git diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index 742bb08b1..697aa237f 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -197,17 +197,26 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { } } - uint8_t note; - if (music_mode == MUSIC_MODE_CHROMATIC) - note = (music_starting_note + record->event.key.col + music_offset - 3)+12*(MATRIX_ROWS - record->event.key.row); - else if (music_mode == MUSIC_MODE_GUITAR) - note = (music_starting_note + record->event.key.col + music_offset + 32)+5*(MATRIX_ROWS - record->event.key.row); - else if (music_mode == MUSIC_MODE_VIOLIN) - note = (music_starting_note + record->event.key.col + music_offset + 32)+7*(MATRIX_ROWS - record->event.key.row); - else if (music_mode == MUSIC_MODE_MAJOR) - note = (music_starting_note + SCALE[record->event.key.col + music_offset] - 3)+12*(MATRIX_ROWS - record->event.key.row); - else - note = music_starting_note; + uint8_t note = 36; + #ifdef MUSIC_MAP + if (music_mode == MUSIC_MODE_CHROMATIC) { + note = music_starting_note + music_offset + 36 + music_map[record->event.key.row][record->event.key.col]; + } else { + uint8_t position = music_map[record->event.key.row][record->event.key.col]; + note = music_starting_note + music_offset + 36 + SCALE[position % 12] + (position / 12)*12; + } + #else + if (music_mode == MUSIC_MODE_CHROMATIC) + note = (music_starting_note + record->event.key.col + music_offset - 3)+12*(MATRIX_ROWS - record->event.key.row); + else if (music_mode == MUSIC_MODE_GUITAR) + note = (music_starting_note + record->event.key.col + music_offset + 32)+5*(MATRIX_ROWS - record->event.key.row); + else if (music_mode == MUSIC_MODE_VIOLIN) + note = (music_starting_note + record->event.key.col + music_offset + 32)+7*(MATRIX_ROWS - record->event.key.row); + else if (music_mode == MUSIC_MODE_MAJOR) + note = (music_starting_note + SCALE[record->event.key.col + music_offset] - 3)+12*(MATRIX_ROWS - record->event.key.row); + else + note = music_starting_note; + #endif if (record->event.pressed) { music_noteon(note);