diff options
author | Takeshi Nishio <kkeennnn+github@gmail.com> | 2021-01-20 11:08:06 +0900 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2021-02-02 09:45:24 -0800 |
commit | 5aac30a85afece3b6b7aade97f2760c94bd1a0d2 (patch) | |
tree | 18d8ca5af83a0ebc59d67fde03ba38bbc54aa51c | |
parent | 2a1bedec665b0521b7b16248218131f33b7d0056 (diff) |
Fix wrong key when "Music Map" is used with MAJOR_MODE. (#11234)
With MAJOR_MODE (= major scale), keys in one octave is not 12 but 7.
To solve this problem, change divisor number from 12 to 7 at %(Modulo) and /(Division).
NOTE:
The last 12 represents half step keys in one octave for pitch calculation.
-rw-r--r-- | quantum/process_keycode/process_music.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index b61a16e878..eb06be96c2 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -191,7 +191,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { 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; + note = music_starting_note + music_offset + 36 + SCALE[position % 7] + (position / 7) * 12; } # else if (music_mode == MUSIC_MODE_CHROMATIC) |