diff options
| author | 3araht <69518343+3araht@users.noreply.github.com> | 2020-10-05 06:32:24 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-04 14:32:24 -0700 |
| commit | 2bcac45650563822f20a2336a9fc4d95b2cc4e3e (patch) | |
| tree | bf99edc3e02b8deb76b019b7c790c7ee99eb6302 | |
| parent | c8cff1489a82bb61266ce32750895c6935b256a3 (diff) | |
| download | qmk_firmware-2bcac45650563822f20a2336a9fc4d95b2cc4e3e.tar.gz qmk_firmware-2bcac45650563822f20a2336a9fc4d95b2cc4e3e.zip | |
Fix for MIDI sustain effect issue (#10361)
| -rw-r--r-- | quantum/process_keycode/process_midi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index b2fb902eb..e52577014 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c | |||
| @@ -68,10 +68,12 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { | |||
| 68 | uint8_t tone = keycode - MIDI_TONE_MIN; | 68 | uint8_t tone = keycode - MIDI_TONE_MIN; |
| 69 | uint8_t velocity = compute_velocity(midi_config.velocity); | 69 | uint8_t velocity = compute_velocity(midi_config.velocity); |
| 70 | if (record->event.pressed) { | 70 | if (record->event.pressed) { |
| 71 | uint8_t note = midi_compute_note(keycode); | 71 | if (tone_status[tone] == MIDI_INVALID_NOTE) { |
| 72 | midi_send_noteon(&midi_device, channel, note, velocity); | 72 | uint8_t note = midi_compute_note(keycode); |
| 73 | dprintf("midi noteon channel:%d note:%d velocity:%d\n", channel, note, velocity); | 73 | midi_send_noteon(&midi_device, channel, note, velocity); |
| 74 | tone_status[tone] = note; | 74 | dprintf("midi noteon channel:%d note:%d velocity:%d\n", channel, note, velocity); |
| 75 | tone_status[tone] = note; | ||
| 76 | } | ||
| 75 | } else { | 77 | } else { |
| 76 | uint8_t note = tone_status[tone]; | 78 | uint8_t note = tone_status[tone]; |
| 77 | if (note != MIDI_INVALID_NOTE) { | 79 | if (note != MIDI_INVALID_NOTE) { |
