Mapping MIDI button executes command twice - on both press and release

• May 12, 2023 - 02:26

(Musescore 4)
Assigning a MIDI button to the following commands (and possibly others)
- Note input
- Undo
- Rest
- Toggle duration dot
- Add tied note
executes the command both on press and release. This means for the toggle commands they are toggled on and immediately back off again. For commands that perform an action - e.g. "Undo", "Add tied note" - the command is executed twice: once on press and again on release.


In reply to by Marc Sabatella

Thanks for the suggestion. I did take a look with MIDI monitor and it's sending two messages:

  • Control (number) 127 on button down (eg. B0 66 7F)
  • Control (number) 0 on button up (e.g. B0 66 00)

I think this is pretty normal default behaviour for a MIDI button.

I can see for toggle commands (e.g note input) responding to both of these messages makes sense. But for actions (e.g. tie, undo) it doesn't seem to make sense to respond to the off/up message.

Following your suggestion, I did find that it is possible to change the MIDI keyboard to produce toggle behaviour -- i.e. send a different value (0) on the second press to the first one (127). For 'sticky' commands it's also possible to use this to always send the same value by setting the second and first one to the same value (127).

I think this does allow me to control nearly everything from the MIDI keyboard.

There is still one thing though: it would be good to be able to assign a button or key to the "enter rest" command (equivalent to pressing 0). Right now, the MIDI Rest command toggles the "rest note input" which still requires you to click on the score.

In reply to by brettrp

That sounds like a big; same thing happens in "rhythm" note input mode, although there is a pending fix for that. I suggest opening an issue on GitHub so this can be looked at as well -

Wouldn't hurt to open a separate issue requesting a way to give more control over how the MIDI mapping is handled in terms of the button down/up. Seems especially important for pedal events.

Do you still have an unanswered question? Please log in first to post your question.