musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.31k stars 2.66k forks source link

[MU4 Issue] Tablature: missing methods of entering rests #11736

Closed MarcSabatella closed 1 year ago

MarcSabatella commented 2 years ago

The usual shortcut to enter a rest is 0, but in tablature, this enters fret 0 instead. So in MU3, an alternate shortcut of ";" was provided for rests in tablature input mode. Either the command is not implemented or the shortcut is missing in MU4.

BTW, right-click is also supposed to enter a rest. This doesn't work either on tab staves. This much is not a regression - it was broken in MU3 also. The lack of the keyboard method is the much more serious issue, since tab is almost always entered by keyboard anyhow.

Workaround is to first enter a note then delete it.

rgreen5 commented 2 years ago

You can't enter rests from the toolbar either:

  1. Create a tablature score. Make sure that "Show rests" is checked (A setting of Tab 6-str common/Full will also do the trick).
  2. Enter note input, click on the rest in the note toolbar and apply it to the tab RESULT: Nothing happens.

Expected result

A rest of duration 1/4 should appear in the tab.

IN fact the only way to get rests to appear is indirectly by linking it to a treble 8vb staff and creating the rest in the staff instead.

MarcSabatella commented 2 years ago

Well, the workaround I gave originally (add note then immediately delete) still works

MarcSabatella commented 1 year ago

I have to admit to being completely shocked we haven't been overrun with reports of this; I'd have assumed this would be one of the top two or three complaints we'd be seeing. Still, it's an embarrassing omission I'd love to see us fix before people do notice :-).

I have to imagine it's a simple fix, but I'm not exactly sure where the breakdown is. It seems there is no handler for the "rest-TAB" action, and that's presumably part of the problem, but I'm not sure that explains anything beyond the broken keyboard shortcut, not the broken right-click or broken toolbar button.

HemantAntony commented 1 year ago

@MarcSabatella This is no longer reproducible. Pressing 0 now creates a rest. Can you check again? Do you think its still necessary to implement ','?

MarcSabatella commented 1 year ago

Pressing 0 definitely does not create a rest on a tablature staff - and if it did, that would be an even more serious bug, because pressing 0 needs to enter a 0 :-). Luckily, 0 works correctly in both 4.0.1 and in a current nightly. Only the rest-TAB command is broken, as far as keyboard entry goes.

So yes, the rest-TAB command (shortcut semicolon) needs to work in tablature, and so should right-click and also click while in “rest mode” (after pressing the rest button on the toolbar).

I see rest-TAB is listed in the shortcut file but there is no handler for it that I can see. So that much might be just a one line change. But I’m not sure where the click handling happens these days.

cbjeukendrup commented 1 year ago

@MarcSabatella indeed, currently, there is no handler for "rest-TAB". It would need to be added in notationuiactions.cpp (similar to "rest"; note that for the action title, we could make use of the X_TAB translatable string, like we do for "pad-note-1-TAB"). And then a handler needs to be added in NotationActionsController; afaics, this can be just the same as for "rest".

MarcSabatella commented 1 year ago

That much I can handle :-). But I'd really love to fix the click methods too. I am the one who added right-click for rest a few years back, in https://github.com/musescore/MuseScore/pull/4704. I think maybe the corresponding code in MU4 might be: https://github.com/musescore/MuseScore/blob/6cd6ee136c0c3fe09cb58000e967986c0f36c28f/src/notation/view/notationviewinputcontroller.cpp#L509-L513

And it seems from the console log that remove-note is getting called on right click, and put-note on left click in rest mode. So whatever is going wrong seems to somewhere further down the chain.

MarcSabatella commented 1 year ago

I decided to tackle this, and I have the keyboard part working - just a matter of hooking up the missing function calls indeed. There were also issues with "pad-rest" and I addressed those here as well.

I also have the mouse entry of rests on tab staves working, but that part I'd like more review of. It's a small enough change - just removing a single line in noteValForPosition() that returns an error if asked to operate on a rest on a tab staff. That code has been there "forever", and it's why mouse entry of rests on tab staves has never worked as far as I know. And yet, that same function is happy to just return success for rests on percussion or tab staves. Letting it do so for tab fixes the problem and seems likely to be harmless.