Add hairpin (and dynamics) to elements that trigger space increase to avoid collision in certain cases

• Jul 15, 2019 - 02:30
Reported version
P2 - Medium
S5 - Suggestion

When adding dynamics requiring much space such as pp and ppp to notes which are very close to each other, as the dynamics are by default centered relative to notes, they tend to overlap.
Adding a hairpin between the notes bearing the dynamics is even worse, since the hairpin badly overlaps with both dynamics (See attached example). This doesn't seem to be the spirit of autoplacement, and many times it cannot be easily worked around by disabling autoplacement and manually moving the dynamics because there may be just not enough room to do so.
The only easy workaround is to stretch the measure by a large factor until the overlapp is cleared (see example), but this affects proportionally all parts of the measure, such as rests, creating unnecessary waste of space.
The proposed solution is to include both dynamics and hairpins in the list of elements that trigger an increase of horizontal space between notes, such as when adding new notes in between (e.g., replacing a quarter note by 4 sixteenth notes) or lyrics with long sylables.

Attachment Size
Test_hairpin_collision.mscz 6.3 KB


Priority P2 - Medium

If we did the same thing we do for chord symbols and lyrics, then it is largely the same as a leading space adjustment, which is not as easy as double-clicking then dragging the note. So if you don't mind the irregular spacing (some would consider it problematic, and would instead want the whole measure stretched), that's another workaround. Another is to do what probably most professional engravers would do and simply move the dynamics. BTW, no need to disable autoplace when doing so, in fact that's counterproductive. If there's no room, that's a good sign the whole measure probably should be stretched. Which is one reason I'm not entirely convinced an automatic scheme would produce good results. With chord symbols and lyrics, the desired behavior is pretty clear from studying the literature, but here it's much more subjective and situation-dependent.

None of which is to say would couldn't consider such an option some day.

In reply to by Marc Sabatella

Find attached a new version of the test sample.
Both workarounds have serious pitfalls. The use of leading space seemed promising, since at least one could manually reposition elements to get a satisfactory layout. But the problem, as with many manual changes, is that it is too sensitive to automatic stretching or shrinking as a consequence of new notes being added within the same system. So after having carefully relocated things, the inclusion of new notes elsewhere on the system may mess things up.
The measure-stretching strategy may end with quite a sparse presentation of a particular measure and a lot of wasted space, and has the same problem as the other workaround, since the stretching is not absolute but relative to the standard horizontal length under given conditions.
Besides, any future edit such as adding a few notes now and then may completely jeopardize all the work done to reposition dynamics. The worst part is that it takes a painstaking revision to find the problems that a single edit may produce, since it could trigger one measure going to the next system causing a complete relayout .
That's why the requested feature is important.
By the way, the way to do things right is not so subjective. Elaine Gould explains on pge 103 of her book how to place dynamics in cases like this one.

Attachment Size
Test_hairpin_collision.mscz 8.6 KB

Well, Gould says the move the dynamic left, but doesn't say what to do if that creates a collision. That approach fails if there are more than two such dynamics (eg, ppp fff ppp on three consecutive notes) - moving the first to the left solves the first collision, but then apply the same approahc to the second just recreates it. That's what I mean about things being subjective. Sometimes it may make the most sense to increase the overall stretch, other times to allow unequal spacing - that's a judgement call MuseScoeew is in no position to make. So sure, we could detect the collision and move the dynamics around, but you're still going to be on your own a lot. And I kind of suspect the necessary manual adjustments would go better if MuseScore weren't readjusting your adjustments - just sticking with a default is often better (see what happens, for instance, if you try to adjust curvature of a too-steep slur).

In reply to by Marc Sabatella

I'll try to ask her if there is a standard solution to this kind of problem. In case there isn't, I think MuseScore is sufficiently mature and widespread to set a standard of its own on this (as in other gray areas) , which would of course require some debate and examination of cases from the literature.

In reply to by Marc Sabatella

I don't have Sibelius nor Dorico, but this is the output of Denemo/LilyPond:
Somehow It solves automaticaly the dynamics placement , but I don't like it very much. It is difficult to read and takes much vertical space, which in a large score is more at a premium than horizontal space.
This is what happens if hairpins are added between 1st and 2nd note and between 2nd and 3rd:
This is completely useless, so it would need to tweak quite a bit.
They follow the rule of locating dynamics on the same line but the hairpins reduce to a vertical line. They don't seem to have any policy to handle horizontal space automatically to make room for the hairpins, and probably it would be worse in the case of pppp. I didn't try further.

In reply to by Marc Sabatella

... or just happens that the situation didn't come about so far. I'm pretty sure that if somebody in the LilyPond team had noticed this it would have triggered some consideration.
I don't think it is so difficult as long as one or both aternative solutions are considered acceptable (full measure stretch until no overlap occurs or local increase of the horizontal space to make room for hairpins). One could choose one or the other according to the result.

In reply to by Marc Sabatella

I have an answer from Elaine Gould. I've presented her the two alternatives: To stretch the whole measure by a factor that ensures enough room for dynamics, and to make room locally so that each dynamic is correctly aligned with the corresponding note with no overlapping. She prefers the second one, but warns about the situation in which, for instance, 16th notes in a beat are much more spaced than a half note in the same measure so some change should be done to prevent confusion for the player. She mentions the spacing rules (she may be referring to keeping a larger figure represented by a larger space, not necessarily proportional). She also insists on keeping the dynamics on an horizontal line (this seems to rule out the method chosen by LilyPond).
In a couple of weeks or so I'll try to think of a rule proposal just in case some programmer wants and has the time to convert it in part of the code.