Dynamics are positioned differently depending on stem direction, and horizontal offset is added on copy and paste
This is definitely headed for a bug report, but I need to figure a few things out first.
Open dynamics offset problem.mscz in 2.0.3. Everything is in its automatic position. Notice that the two dynamics in the first measure are not aligned vertically.
Click the note in the bass clef and press [X] a few times. Notice that as the stem direction changes, the dynamic jumps left and right.
In the Inspector, reset the note's stem direction to "Auto."
Now, select the dynamic in the bass clef measure and decrease its vertical offset in the Inspector to -1sp.
Select that measure, copy, and paste into measure 2 in the top staff.
At this point, the dynamic suddenly has a horizontal offset of -.33sp. (Just for fun, flip the stem direction again, and the combined negative offset and changed stem direction start to push the dynamic across the barline.)
In 3.0 nightlies, the same thing happens, but there's the additional factor of the dynamic refusing to approach the barline on the left, no matter the negative offset.
As stated, there's definitely a bug in here. The question is how much of this behavior is problematic, and how much is by design. Help appreciated.
Comments
I can't say anything about 3.0; I'm still wrapping my head around those changes.
For 2.0.3, it looks like this is by design. According to the code, for upstem chords, the dynamic is centered on the stem (with a small optical correction), but for downstem chords, it is centered on the notehead (see Dynamic::layout() in libmscore/dynamic.cpp). And it looks like this is exactly what is happening. I don't see any specific recommendation in Gould to justify this, so I'm not sure what this decision was based on, but that is the current state of things.
In reply to I can't say anything about by Marc Sabatella
So the only actual buggy behavior is the -.33 horizontal offset after the copy-and-paste to a different clef?
In reply to So the only actual buggy by Isaac Weiss
I don't think that is a bug either. Once you manually position an element, MuseScore tries to preserve that manual positioning, and since the default position is slightly different now because of the different stem stem direction, an additional offset needs to be applied to keep the absolute position (well, relative to the measure) the same. So this too seems by design.
Of course, one could question whether *either* of these design choice are the right ones, and they can certainly be revisited.
In reply to I don't think that is a bug by Marc Sabatella
For the "second design choice," I don't think that can be right—if the Inspector specifies that the horizontal offset should be 0.00sp, or the default horizontal position, that should not turn into -0.33sp without the user's control.
Maybe the first design choice isn't a good one, either, as in multi-instrument scores it can lead to raggedy vertical alignment. But the second one is problematic for sure.
In reply to For the "second design by Isaac Weiss
It doesn't *turn into 0.33sp" - this is a new piece of music, and it might require different offsets to achieve the same physical position. The original is of course left unchanged. The question is whether you want the text in the copy to *look* the same on the page, or to *have the same numbers visible when viewed in the Inspector*. museScore chooses the former in this case, and I'd argue that's what most people would usually expect. If there weren't an Inspectoer, it wouldn't even occur to you there was any other possible result to expect.
In reply to It doesn't *turn into 0.33sp" by Marc Sabatella
The more I'm studying this, the less I like it. I don't think it's even right that the dynamic should be positioned more to the left if the note is stem down.
Should I file a feature request or task to do away with that behavior?
In reply to The more I'm studying this, by Isaac Weiss
Not sure how to classify it, but yes, I suggest filing an issue anout the posiotining somehow, as I agree it seems unnecessary and in some cases at least undesirable. I guess some reference must recommend it, but Gould doesn't.
In reply to Not sure how to classify it, by Marc Sabatella
I just went with bug report: #113811: Dynamics are positioned differently depending on stem direction, and horizontal offset is added on copy and paste
In reply to I just went with bug report: by Isaac Weiss
I opened a pull request to position dynamics the same regardless of stem direction: https://github.com/musescore/MuseScore/pull/2659
In reply to I can't say anything about by Marc Sabatella
Just saw this.
Indeed, Gould recommends the opposite. On page 102, "Centre the dynamic on the notehead."