Browse Source

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.
pull/11019/head 0.11.52
Takeshi Nishio 3 years ago
committed by GitHub
parent
commit
71f067a60e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      quantum/process_keycode/process_music.c

+ 1
- 1
quantum/process_keycode/process_music.c View File

@ -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)


Loading…
Cancel
Save