diff options
Diffstat (limited to 'quantum/process_keycode/process_midi.c')
| -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) { |
