The inability to change the Voices in Tabs leads to a crash

• Feb 9, 2015 - 14:47
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Nigthtly, February 9 b9875a6/ Windows7

1) Create a score with tab staff, or, open this file: tab voices.mscz

2) Add a fourth quarter note, in the first measure and in Voice1, on the top (first) string

3) Select Voice2

4) Select all: Ctrl + A

Result: crash

Note: If you avoid the step #4, whatever you do, you can not "really" change the voice. You may fill notes only in Voice1.

With a "funny" variation: if you complete the second string with the keyboard, you hear a B (second string) by typing 0, and then you hear a E (first string) by pressing the right arrow (forward therefore to have entered another B)

- This issue appears on January 17.

The result is as expected on this Nightly on January 16:03dc014
expected result.jpg

- This one, on January 17, leads to failure and a crash: 7b1f049

Upon review, this could be a side effect of this commit (same as second nigthly mentionned). A very good feature, but which does not work with Tabs (if the relationship is proven?)
https://github.com/musescore/MuseScore/commit/63fbf06e576f3a2753f3faf0a…
This commit is slightly previous than the second mentionned Nightly. It seems to be the same content, and I don't understand why it comes back just after. No matter, I guess :)


Comments

Apologies; sometimes I forget about testing changes with tab. Will look into it, and if nothing else works, just disable that change for tab staves.

Well, after further investigation, I noted that the crash (with the same four steps, so: after changing to voice 2, and Ctrl + A) occurs also in Beta2. Maybe before. So, this issue is deeper possibly or/and elsewhere also? I look at.

Are sure it didn't crash with any earlier commits? If I undo my change, it still crashes:

1) note entry mode
2) press 0 to enter a single note onto the top string
3) press Ctrl+Alt+2 to change to voice 2
4) press Ctrl+A to select all

I could see how my my change might be related, but actually, I am pretty sure it should have been possible to get Ctrl+A to crash in tab input mode for some time now, perhaps just with slightly different steps.

I'm curious what you were trying to accomplish via Ctrl+A. Normally, in note input mode, only one element is ever selected - the "current" note. The easy fix would be to simply disable Ctrl+A while in note input mode, as I suspect there might be other issues that would likely result from having mutliple items selected while in note input mode. But maybe there is a good use case for this I am not thinking of.

I have a fix for the crash that doesn't in itself disable Ctrl+A for note input mode. However, Ctrl+A still won't actually *work* in a tab staff. The problem is related to the fact that it is impossible to change to voice 2 if the cursor is on a note in voice 1. The code for tab note input is trying to always select the "current" note, and as long as the cursor sees a note on that string, it gets selected, thus disabling both "select all" and the ability to change voice.

This is the result of the following change from last summer:

https://github.com/musescore/MuseScore/commit/d2ac685d148ed2ea2dfd07f9d…

I believe the idea behind this change is good - I think I was one of the ones pushing for it. As you use the cursor to move through a tab staff in note input mode, if a note is found at the current position, it should be selected so the commands that work on the "current" note will work. However, I believe this should only happen if the note found is in the current voice.

I have this coded up and it fixes the issue with not being able to change voices. Still testing. Ctrl+A still doesn't work if the cursor is on a note, but that doesn't concern me.

Status (old) active patch (code needs review)

https://github.com/musescore/MuseScore/pull/1748

Fixes the crash, also fixes the inability to change voices if the cursor is over another in another voice, also allows Ctrl+A to actually work while in note input mode on a tab staff.

I'm still not so sure we really *should* allow Ctrl+A to function at all while in note input mode, but it works for standard staves, so why not for tab too. If we decide to disable it later, we can always do so directly in cmdSelectAll() or by removing STATE_NOTE_ENTRY from the definition of the command in shortcut.cpp.