Copy-paste in tab staves an instrument which the range of pitch and strings exceeds the second one causes a crash

• Feb 14, 2015 - 09:27
Type
Functional
Severity
S2 - Critical
Status
closed
Project

1. Open attached score (produced in 2.0 beta 2).
2. Click on stave.
3. 'Edit'>'Copy'.
4. 'Edit'>'Instruments…'.
5. Add '5-str. Electric Bass [Tablature]'.
6. 'OK'.
7. Click on newly-added stave.
8. 'Edit'>'Paste'.

Result: Crash.

Note: See attached log.

Using MuseScore 2.0 Nightly Build 620c997 - Mac 10.7.5.


Comments

The issue will be deeper than the title.

It could be about pasting to a stave with different tuning? I couldn't reproduce to another electric guitar, but can to electric bass with 4, 5 and 6 strings.

I think I created a 'Tab. full' staff. From there, I turned the full bar rest to a minim, then the minim to crotchet, and so on.

If that's what you mean?

Title Crash when pasting tablature to stave Copy-paste in tab staves an instrument which the range of pitch and strings exceeds the second one causes a crash

I think I understand the issue now. It appears as indicated in the title.

EDIT: Ok, I have it now :)
So:
The main point of this issue is not the number of lines per se of the two staves as showed in the two last files. The first fourth files sum the situation.

The key for understanding is that the staff/instrument "pasted" must contains at least the same number of lines / strings to which must necessarily be assigned to a pitch.

The other necessary condition is that this line/string must be filled by a note or a number, of course. Example: on the first file, if you replace the 0 on the bottom string (6th) and you place it on the 5th, there is no crash (as in the second file)

Otherwise, we receive a crash.
Better than words, open these files to test this issue.

- test Eg 6-str banjo 5-str.mscz
- first test bis Eg 6-str banjo 5-str.mscz
- 2 test Eg 6-str banjo 6str.mscz
- 3 test Eg 6-str banjo 6str and pitch.mscz

- example 4.mscz
- example 4 bis.mscz

I try from now to investigate to know if this issue as an origine localizable or not.

Yep, I caught it! :)

At least I can say that this issue appears there is 6 months! On August 17.

- Between this Nightly : 01b6a81
With this result, as expected:
result on 01b6a81 August 17.jpg

- And this one: 9e7bed5
Result, with crash.
crash result in 9e7bed5 August  17.jpg

The second mentionned Nightly does not seem concerned. There are only two other interspersed commits.

This one also does not concern? : https://github.com/musescore/MuseScore/pull/1139/files

This one maybe more likely ? : https://github.com/musescore/MuseScore/pull/1146/files

Without being at all sure, more precisely in: "input.h" (visual string, Tab staves) or "ambitus.cpp"? I leave it to the experts the care to deepen.

There was also this commit. But I can not locate it precisely in the time this day of August 17, and does not seem concerned either? https://github.com/musescore/MuseScore/commit/1886d6d9114bfc31c1e162123…

Edit: Ah, more likely in "chord.cpp"?

Thanks, armed with this information, and running under the debugger to see the exact location of the crash, it should be easy to find and fix the problem!

In looking at this, it occurs to me there is a very fundamental issue to resolve regarding the expected behavior when copying and pasting tablature - potentially between staves of different instruments. That is, when copying tablature, are we copying specific fret/string information and recalculating pitch as we go, or are we copying pitch information and recalculating fret/string information as we go. Right now it seems to be a carefully considered combination of the two, so fret/string info is preserved where possible, recalculated where necessary. I know there were lots of changes and compromises made regarding how this all works, and my sense is, people are basically satisfied that the best answer was found given all the possibily complexities.

So I am submitting a fix that doesn't change anything about how this is done in any cases other than the specific case that is crashing - copying a note on a string that doesn't exist on the destination instrument (eg, a note on string 6 copied to a 5-string bass). Everything else should work the same, and as far as I can tell, that's a good thing.