Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staff visibility #19679

Merged
merged 4 commits into from
Nov 14, 2023
Merged

Conversation

Jojo-Schmitz
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz commented Oct 11, 2023

  • Port of [MU3 Backend] ENG-54: Staff Visibility #8430, part 1, "Default HideMode::INSTRUMENT XML import":
    Since HideMode::AUTO behaves in uncommon ways for most scores (hiding empty staves in a grand staff), this changes the hideWhenEmpty to INSTRUMENT when creating the Staffs upon import. In the case that a score part has a variable number of staves, it uses this to infer that we do truly want HideMode::AUTO.

  • Port of [MU3 Backend] ENG-54: Staff Visibility #8430, part 2, "Check spanners when assessing emptiness":
    Previously, a staff's emptiness was calculated based on its note and annotation content. Since this is evaluated before the system was laid out, the system did not have pointers to its SpannerSegments. This commit adds a way to include whether a staff has any spanners (particularly pedal markings and hanging slurs) in assessing emptiness, creating more consistent/expected hiding behavior in HideMode::AUTO.

  • Port of [MU3 Backend] Tweak staff hiding conditions for spanners #8527:
    This commit tweaks the changes from commit 54ebee4 (which checks for spanners when assessing staff emptiness) and ignores spanners that are "system" spanners (such as voltas or system text). This prevents a false-positive unhiding in the case of such system spanners. Also, it prevents another false positive that occurred when a spanner started on the first tick of the next system.

  • Hide staff with subsequent empty measures after (de-)crescendo line (or hairpin) in measure before:
    A regression from the above 2 commits, apparently needed as a hairpin (that ends at a measure (and system) boundary) has its end being recorded in the next measure (and system) and, should it really go into the next system, 'harmless' to get ignored there (i.e. still getting hidden), as harpins on otherwise empty measures are pretty meaningless.

VTEST failure expected and demonstrating the need:
staffEmptiness-1 diff

@Jojo-Schmitz Jojo-Schmitz force-pushed the hide-empty-staves branch 2 times, most recently from 859a7f8 to 52bd1fa Compare October 11, 2023 09:25
@Jojo-Schmitz Jojo-Schmitz changed the title Check spanners when assessing emptiness Staff visibility Oct 11, 2023
@Jojo-Schmitz Jojo-Schmitz force-pushed the hide-empty-staves branch 3 times, most recently from ebe5698 to 2b205a4 Compare October 11, 2023 14:15
@Jojo-Schmitz
Copy link
Contributor Author

Jojo-Schmitz commented Oct 11, 2023

As this is an engraving issue/fix, I'd like to summon @oktophonie for a review ;-)
He also approved the PRs I'm porting here, together with @vpereverzev

@Jojo-Schmitz Jojo-Schmitz force-pushed the hide-empty-staves branch 3 times, most recently from bd366e4 to e7f51f3 Compare October 12, 2023 10:10
iveshenry18 and others added 4 commits October 12, 2023 13:39
Since HideMode::AUTO behaves in uncommon ways for most scores (hiding empty staves in a grand staff), this changes the hideWhenEmpty to INSTRUMENT when creating the Staffs upon import. In the case that a score part has a variable number of staves, it uses this to infer that we do truly want HideMode::AUTO.
Previously, a staff's emptiness was calculated based on its note and annotation content. Since this is evaluated before the system was laid out, the system did not have pointers to its SpannerSegments. This commit adds a way to include whether a staff has any spanners
(particularly pedal markings and hanging slurs) in assessing emptiness, creating more consistent/expected hiding behavior in HideMode::AUTO.

Port of musescore#8430, part 2
This commit tweaks the changes from commit 54ebee4 (which checks for spanners when assessing staff
 emptiness) and ignores spanners that are "system" spanners (such as voltas or system text). This prevents a false-positive unhiding in the case of such system spanners.

Also, it prevents another false positive that occurred when a spanner started on the first tick of the next system.

Backport of musescore#8527
@musescore musescore deleted a comment from Jojo-Schmitz Oct 26, 2023
@RomanPudashkin RomanPudashkin merged commit b2a42fc into musescore:master Nov 14, 2023
@Jojo-Schmitz Jojo-Schmitz deleted the hide-empty-staves branch November 14, 2023 17:09
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 15, 2023
@Jojo-Schmitz Jojo-Schmitz mentioned this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants