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

Create tuplet bracket when on notehead side #19438

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

miiizen
Copy link
Contributor

@miiizen miiizen commented Sep 18, 2023

Resolves: #17852

When a tuplet's bracket type is set to auto, display a bracket if on the notehead side of beamed notes.

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@oktophonie oktophonie added the vtests This PR produces approved changes to vtest results label Sep 25, 2023
@cbjeukendrup
Copy link
Contributor

I found an edge case that seems not to be covered, namely when all notes of the tuplet are moved to the staff below (or above):
Scherm­afbeelding 2023-09-26 om 01 05 27
I would expect a bracket for the last tuplet.

Is that indeed an issue, or should we ignore it because there is no good reason to notate it like this?

@@ -194,7 +194,9 @@ bool Tuplet::calcHasBracket(const DurationElement* cr1, const DurationElement* c
}
bool tupletStartsBeam = beamStart->elements().front() == c1;
bool tupletEndsBeam = beamEnd->elements().back() == c2;
if (tupletStartsBeam && tupletEndsBeam) {
bool headSide = isUp() != (c1->up() || c2->up());
bool isCross = c1->staffMove() || c2->staffMove();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it would be fixed by changing this to c1->vStaffIdx() != c2->vStaffIdx(). That way, all these cases would be handled the same:
Scherm­afbeelding 2023-09-26 om 01 13 28

@cbjeukendrup
Copy link
Contributor

The VTests were unwilling, so I've rebased the branch, hoping that will help.

@cbjeukendrup cbjeukendrup merged commit b005132 into musescore:master Sep 29, 2023
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vtests This PR produces approved changes to vtest results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Smarter tuplet bracketing
3 participants