if join a score without non-generated clef at start via album, then add initial clef before appending

• Sep 7, 2015 - 00:11
Type
Functional
Severity
S4 - Minor
Status
closed
Project

As I wrote in https://musescore.org/en/node/76016:

>>If I make a score with default treble clef, for instance, then there is no actual treble clef in the score (according to object debugger, the treble clef is "generated"). If I use album feature to append this treble clef score after a bass clef score, then the resulting score is only in bass clef, because the "generated" treble clef is not an actual score element and so doesn't get copied.
>>My feature request is to go ahead and create a clef at start of score if no actual clef exists already before appending.

E.g. suppose want to create album of these two scores. First one created by going to "Create New Score" and selecting treble clef template score:

treble-score.png

and the second one created by going to "Create New Score" and selecting bass clef template score:

bass-score.png

After joining via album, the current behavior only copies initial clefs that user had manually inserted, but does not copy an initial clef that was "generated" by musescore. So if join the scores as album with order {bass clef score} first and then {treb clef score} second, then the resulting joined score looks like:

bass-first-then-treble-appended_.png

Likewise if join scores as album with order {treb clef score} first and then {bass clef score} second, then the resulting joined score looks like:

treb-first-then-bass-appended_.png

My desired behavior would always copy the initial clef even if it was "generated" by musescore.


Comments

Could you remove the : from the URL in the Initial Report? It renders the link broken...

FWIW: I support the proposed Change
Also I see this as a bug rather than a feature request ;-)

Status (old) patch (code needs review) fixed

Fixed in branch master, commit 10b4f7f9e3

fix #76101 join score w/ generated initial clef

If joining scores via album feature, previous behavior would only copy non-generated clefs. So if the user had manually dropped a different clef into the initial tick of the 2nd score, then that added clef would be appened to the first score when joining the scores. However, if joining a score that used a different default clef (e.g. from using a different template or instrument when creating score via wizard), then the combined score would not copy the 2nd score's initial generated clef when joining the two scores.

This fix copies any such generated clefs if the clef type changes from the final tick of the first score to the initial tick of the second score. It achieves this by converting the initial clef from generated to non-generated if necessary prior to copying the measures over in Score::appendScore.

The test album_76101-01.mscx is treble clef while album_76101-02.mscx has an initial bass clef that is generated. The test joines the two scores into an album and verifies that joined score has the bass clef copied over to the new score.

rebased over issue #78521 (PR #2229)

Fixed in branch 2.0.3, commit 5d46ba6e06

fix #76101 join score w/ generated initial clef

If joining scores via album feature, previous behavior would only copy non-generated clefs. So if the user had manually dropped a different clef into the initial tick of the 2nd score, then that added clef would be appened to the first score when joining the scores. However, if joining a score that used a different default clef (e.g. from using a different template or instrument when creating score via wizard), then the combined score would not copy the 2nd score's initial generated clef when joining the two scores.

This fix copies any such generated clefs if the clef type changes from the final tick of the first score to the initial tick of the second score. It achieves this by converting the initial clef from generated to non-generated if necessary prior to copying the measures over in Score::appendScore.

The test album_76101-01.mscx is treble clef while album_76101-02.mscx has an initial bass clef that is generated. The test joines the two scores into an album and verifies that joined score has the bass clef copied over to the new score.

rebased over issue #78521 (PR #2229)