-
-
Notifications
You must be signed in to change notification settings - Fork 39.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MIDI sustain effect issue #10361
Conversation
Would this not cause issues upon release?
Seems like it'd be safer to modify the state to be an integer -- increment on any keydown (and only transmit for a 0->1 transition), and decrement on any keyup (and only transmit on a 1->0 transition). |
The symptom you pointed out is already there with the current version if you use Abelton Live 10 (Lite). If your method requires a bit more time to realize, I'd like to make a baby step here to solve the sustain effect immediately and live with it for a while. What do you think? |
Apologies for that -- didn't see that there was an attached issue. |
No problem at all. Thank YOU for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weak approval; downsides are documented and are intended to be fixed up in a future PR.
Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__attribute__((weak))
✔️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
* 'master' of https://github.com/qmk/qmk_firmware: (178 commits) Docs: fix udev rules [CLI] Add c2json (qmk#8817) Improve LAYOUT macro searching (qmk#9530) CLI: update subcommands to use return instead of exit() (qmk#10323) Fixes small typo in docs (qmk#10515) Update personal keymap for Let's Split keyboard. (qmk#10536) [Keymap] Move my custom functions and keymaps to userspace (qmk#10502) [Keyboard] add support for ymd75 rev3 (qmk#10483) [Keyboard] Add soy20 PCB (qmk#10440) Fix for MIDI sustain effect issue (qmk#10361) format code according to conventions [skip ci] [Keyboard] Add Yugo-M Controller (qmk#10389) [Keymap] Add onekey keymap for OLED testing (qmk#10380) [Keymap] Add winterNebs keymaps (qmk#10328) [Keymap] Added 333fred 5x6_5 keymap (qmk#10272) [Keyboard] Add hannah60rgb rev.2 PCB (qmk#10287) Adding VIA support to katana60 rev2 (qmk#10442) OLED driver fixes (qmk#10377) IS31FL3741 driver fixup (qmk#10519) add info.json for XD75 keyboard (qmk#10523) ...
* upstream/master: (81 commits) [Keyboard] New keyboard - eiri (qmk#10529) [Keymap] Add niu mini dye sub keymap (qmk#10525) Clean ChibiOS platform files (qmk#10505) [Keyboard] LeftyNumpad Keyboard (qmk#10500) [Keyboard] add maja capslock indicator (qmk#10151) Fix issue introduced by PR#10404 (qmk#10559) Docs: fix udev rules [CLI] Add c2json (qmk#8817) Improve LAYOUT macro searching (qmk#9530) CLI: update subcommands to use return instead of exit() (qmk#10323) Fixes small typo in docs (qmk#10515) Update personal keymap for Let's Split keyboard. (qmk#10536) [Keymap] Move my custom functions and keymaps to userspace (qmk#10502) [Keyboard] add support for ymd75 rev3 (qmk#10483) [Keyboard] Add soy20 PCB (qmk#10440) Fix for MIDI sustain effect issue (qmk#10361) format code according to conventions [skip ci] [Keyboard] Add Yugo-M Controller (qmk#10389) [Keymap] Add onekey keymap for OLED testing (qmk#10380) [Keymap] Add winterNebs keymaps (qmk#10328) ...
Description
When duplicate notes are pressed, the duplicate notes keep ringing or make the sustain effect until you unplug the USB cable.
For example, "duplicate notes" here means C, E and G when C chord (C, E, and G) and C7 chord (C, E, G, and A#) are pressed at the same time.
This issue can be replicated with GarageBand, Logic Pro, Piano 10 (Windows), etc.
(Ableton Live 10 didn't have this problem.)
A quick fix was found as the modification shown in the process_midi.c code.
Assuming QMK Firmware is mainly based on the "common sense" that there are no duplicate keys on the single keyboard.
Number keys on the upper row and num-pad keys are individual keys.
Probably handling duplicate keys are not well-developed because of such reason.
I guess something irregular happens when the same keys are pressed before the first one being released.
The modification is to suppress the second or further midi_send_noteon() if the note is already turned on.
Types of Changes
Issues Fixed or Closed by This PR
Known Issues, which we define it is out of the scope of this push request
It should play the notes which are pressed all the time. However, in some sequences, the notes turn OFF even though the keys are remained pressed.
It happens when the same note(s) is/are played with multiple keys.
For example, when two keys are assigned for
MI_C
and when one of the keys is released after both were pressed,MI_C
should stay ON since another key is still pressed. However,MI_C
turns OFF when the first key is released.Thanks to jakobkg and tzarc, the details are described here and here.
First of all, we'd like to get rid of the problematic sustain effect immediately by this push request.
Checklist