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

Fix #281639: Cutaway staves - better handling of clefs, barlines... #6409

Closed
wants to merge 1 commit into from

Conversation

elerouxx
Copy link
Contributor

@elerouxx elerouxx commented Aug 3, 2020

Resolves: https://musescore.org/en/node/281639

Better handling of clefs and barlines for cutaway engraving and ossias.

Barlines:

  • Begin Bar Lines now can be added to a measure by adding to the first chordRest of the measure
  • A measure Begin bar line will overlap previous measure's end bar line so there is no visual change if both barlines are visible
  • The span handles of the Begin bar line are slightly at right of the barline
  • the span of this or other custom (added) bar lines don't set the global span anymore.

image
(ossias with added start barlines)

Clefs:

  • A clef present on a measure makes the measure visible
  • As usual, clefs added to the whole measure show before the bar line, thus making the previous measure visible.
  • Hidden clefs can be used as a workaround to force unhide a measure in cutaway staff (or a whole staff when staves set to hide when empty).

Clefs (Update):

  • In cutaway staves, clefs added before barlines on an empty measure (as in adding a clef to the the the next measure) turns the measure visible but showing only portion of its staff lines lines, as a clef "trailer" (or "leader").
  • (if desired, rests need to be hidden manually).

*A workaround to force measures to be non-empty (and force visible) is to use a staff text, set to white or transparent, since the measure containing the text can be easily copied and pasted around.

image
*(Clefs added to measures partially reveal previous measures as courtesy/trailer for clefs. )

Brackets: will be left out of the scope of this PR.
Any feedback is appreciated.

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

@elerouxx elerouxx force-pushed the 3x-bracket-rev branch 3 times, most recently from 4bc4039 to 02158e3 Compare August 4, 2020 19:49
@elerouxx elerouxx changed the title [Experimental] Allow inserting free barlines at beginning of measures [Experimental] Allow inserting barlines at first chordrest of measures Aug 4, 2020
@elerouxx elerouxx force-pushed the 3x-bracket-rev branch 2 times, most recently from 12ca396 to 58ed2ab Compare August 5, 2020 03:10
@elerouxx elerouxx changed the title [Experimental] Allow inserting barlines at first chordrest of measures [WIP] Fix #281639: Cutaway staves - better handling of clefs, barlines... Aug 5, 2020
@elerouxx elerouxx force-pushed the 3x-bracket-rev branch 2 times, most recently from df21d9a to d6de6ee Compare August 5, 2020 21:05
@elerouxx elerouxx changed the title [WIP] Fix #281639: Cutaway staves - better handling of clefs, barlines... Fix #281639: Cutaway staves - better handling of clefs, barlines... Aug 5, 2020
else
ms->lines()->layout();
staffIdx += 1;
}
}

Copy link
Contributor Author

@elerouxx elerouxx Aug 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this function lines()->layoutPartial() (maybe need a better name) that draws only a certain width of the lines and aligns them to the left or right of a measure. In this specific case I needed just enough lines width to fit any Clef.

On a related topic, I have been looking for a way to overcome MuseScore's limitation of having a staff change in the middle of a measure, since the staff lines are drawn per measure. But I believe this function might give a clue of how that could be done.
The code above would:

  • Loop thru the staffTypes in the measure
  • Keep appending lines to ms->lines, calculating their widths (and yOffsets, etc)
  • Example: if there is a staff change from 5 to 1 line in the middle of the measure:, 6 lines will be added to mslines: 5 from the beginning of the measure to the tick of the stchange, and one from there to the end of the measure width.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Aug 16, 2020

Please check the mtest failures at https://travis-ci.org/github/musescore/MuseScore/jobs/717104942#L4705-L4769

@elerouxx
Copy link
Contributor Author

I found a better solution, with a far less messy workflow from the user side.
#6461

(Closing this PR)

@elerouxx elerouxx closed this Aug 17, 2020
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.

None yet

2 participants