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

[MU4] Fix staccato and tenuto appearing below notes when they shouldn't #10665

Merged

Conversation

asattely
Copy link
Contributor

Before:
image

After:
image

There was just some non-direction-agnostic code in the laying out of certain articulations, so that's been fixed.

@asattely
Copy link
Contributor Author

asattely commented Feb 24, 2022

Added a bit of logic for ignoring manual adjustments to stem length, so things like this are possible:
image

(this was fixed in #4711 -- I don't know why this broke somewhere along the way but this PR returns to the functionality 4711 added)

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Feb 24, 2022

Are these vtests differences wanted? Before:
layout-sequence-2-1 ref staff-1-1 ref
After:
layout-sequence-2-1 staff-1-1
I guess they are... so a vtests lable is in order ;-)

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Feb 24, 2022

But what about this? Before:
slurs-3-1 ref
After:
slurs-3-1
Esp. in measure 1 in bass clef that doesn't look good, and different from measure 2 in bass clef, without good reason?
Measure 3 in bass clef looks bad in either case.

@oktophonie
Copy link
Contributor

Yes, these are all exactly as expected. Here's this test in 3.6:

image

The articulations have their anchor set differently from bar to bar, which is the reason for the differences.

@oktophonie oktophonie added the vtests This PR produces approved changes to vtest results label Feb 24, 2022
@asattely
Copy link
Contributor Author

Yeah, the differences are due to the anchor point not being respected, which this PR fixes

@Jojo-Schmitz
Copy link
Contributor

OK, so it seems 3.x is not affected by th at all is seems, Even if I backport this PR to 3.x I can't spot any difference, not in those 3 vtests at least.

@oktophonie
Copy link
Contributor

Yes, this was a regression introduced in 4.0 development (likely connected with the new beam code somewhere).

@Jojo-Schmitz
Copy link
Contributor

I see, thanks

if (_up) {
y = downPos() - stem()->length() - userLen;
if (beam()) {
y -= score()->styleS(Sid::beamWidth).val() * _spatium * .5;
Copy link
Contributor

Choose a reason for hiding this comment

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

This line

score()->styleS(Sid::beamWidth).val() * _spatium * .5;

is present in 4 places. It is better to add a temporary variable for it and reuse the variable 4 times

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay!

@asattely asattely force-pushed the vertical-displace-articulation branch from 6a28552 to 65c683e Compare February 26, 2022 00:17
@@ -3746,18 +3746,19 @@ void Chord::layoutArticulations()
bool headSide = bottom == up();
qreal x = centerX();
qreal y = 0.0;

const qreal halfBeamSp = score()->styleS(Sid::beamWidth).val() * _spatium() * 0.5;
Copy link
Contributor

Choose a reason for hiding this comment

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

_spatium() should rather be _spatium

if (beam()) {
y -= score()->styleS(Sid::beamWidth).val() * _spatium * .5;
y -= halfBeamSp * beam()->mag();
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz Feb 26, 2022

Choose a reason for hiding this comment

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

Doesn't _spatium (as part ot halfBeamSp) already contain mag? How is beam->mag() different from mag?
If really needed, should it not get added just once up where halfBeamSpis defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

beam->mag() can be different from mag (which is based on the magnitude of the chord) in situations like this
image
... as far as I can tell. So instead of using _spatium for that one I'll use score()->spatium() so that the chord magnitude isn't included in the calculation

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, still my last question: why not doing this only once?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i guess we could, but beam() is not guaranteed to be non-null until the check, so we'd need to add another check where the definition is. I don't see it as too big of a deal though

Copy link
Contributor

Choose a reason for hiding this comment

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

const qreal halfBeamSp = score()->styleS(Sid::beamWidth).val() * score()->spatium() * 0.5 * (beam() ? beam()-> mag() : 1) ;

@asattely asattely force-pushed the vertical-displace-articulation branch from 65c683e to 11701a2 Compare February 28, 2022 16:40
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.

4 participants