Hairpin changes length if a dynamic is added

• Jul 5, 2021 - 07:26
Reported version
S3 - Major

1) in a new score, add a whole note and ensure the measure is reasonably wide
2) add a < hairpin and re-size it to end half-way through the measure
3) add a > hairpin after this to indicate a cresc./dim. on the same note
4) add any dynamic to the first note/rest in the measure following the whole note
5) carefully sized < hairpin now extends over the > hairpin, creating an unreadable mess


FWIW, it's correct that the hairpin autoadjusts to meet and align with the dynamic in most cases. This is just a special case ehere you are tryiing to workaround a design limitation preventing you from creating the combined crescendo-diminuendo hairpin, so you needed to manually shorten the crescendo and add a second manually-adjusted hairpin at the same tick. what we really need to fix is the basic design limitation - it needs to be possible to specify the end point of the crescendo, and the start point of the diminuendo, independently of the existance of notes on that tick.

Once that is designed and implemented, you won't need the workaround you are resorting to, and the current automatic behavior will be correct.

In reply to by Marc Sabatella

But what's the use case for ever having the hairpin adjust its length if I've manually resized it, especially when it's not even the closest hairpin to that dynamic?
And I'm not sure what you mean about it being a workaround, a single note can usefully have multiple hairpins on it in various configurations. Though it would be better if on adding a subsequent hairpin it automatically started after any existing ones ended. I can see it might be an improvement if hidden segments were created to attach the starts/ ends to as can happen with chord symbols, I'm pretty sure this might even already work if you edit the mscx file. But it's hard to imagine what a UI for this might look like (I'm not sure what the preferred method for chord symbols/ figured bass e.t.c is either).

It is the closest hairpin to the dynamic as far as we know from comparing ticks, that's the whole point. Your second hairpin has the same ticks so we don't "know" it's meant to be the second one. Sure, we could comparing offsets, but that's a hack, what we really need is a true solution to the basic problem - the inability to specify arbitrary stand and end points for hairpins.

What I mean about it being a workaround is just what I said. You don't really want a four-beat crescendo and and four-beat diminuendo both of which start on beat one of the measure and end on beat on of the next measure. You want a two-beat crescendo followed by a two-beat diminuendo. You are using manual adjustments to fake this when it comes to appearance, but of course, it's just a visual hack. The playback, the MusicXML export, everything about it is two overlapping hairpins. That's what I'm saying is a design limitation in dire need of a solution. And as I mentioned elsewhere, Martin has been working on alternative designs for this. If you haven't reached out to him already on this, I encourage you to do so - this would be an extremely valuable addition.

As for why the automatic adjustment happens even though a manual adjustment is present, consider the normal use case where you have the hairpin and the dynamic already, it's automatically adjusted correctly, then you decide to make a small adjustment to the length of the hairpin for whatever reason. You don't want the automatic adjustment to suddenly reverse itself and have it snap back to some earlier default - you want your manual adjustment to apply to the current (automatically-adjusted) length of the hairpin. Earlier versions of MsueScore were much less good about this, manual adjustments to autoplaced items would undo the autoplace and the element would appear to "jump" while trying to adjust it. This was very popular and we worked hard to eliminate that behavior. Something kind of similar is still there for slurs, though, and it's annoying.

BTW I played around with whether you can attach dynamics to "invisible" segments like you can with chord symbols etc., and unfortunately no, it doesn't seem to work for some reason. I'm not quite sure why.
On that basis though the better "hack" is to create invisible rests in a secondary voice and attach the dynamics to those, and that works as expected (except playback obviously, though that can be achieved using invisible notes and turning off playback for the visible one).
I can't see an obvious reason why it should be necessary to have an invisible rest though (especially when you look at what's saved in the mscx file).
However solving the problem of internal representation is much easier than coming up with a good UI/UX for it - like I said, I don't know what the recommended procedure is now for adding a chord symbol etc. at a time position where there's no note/rest (there are various ways of achieving it but none are particularly obvious).

As for having manual-adjustments apply relative to auto-calculated positions/lengths - sure, but when I first created the < hairpin the automatic length was the full length of the note, I then halved it to make room for the > hairpin. So if adding a dynamic re-calculates the automatic length of the < hairpin (for a reason I still don't quite get), I'd expect it to then reapply my manual adjustment (halving the length), even if I never intended to add a > hairpin (maybe I really did just want the hairpin to be for half the length of the note, then suddenly switch to a new dynamic on the next note!).

Yes, the use of voice 2 is the "approved" workaround for the inability to set start/end of hairpins where there is no note. BTW, a similar issue exists for pedal lines, and presumably the design for the hairpin should also accommodate this.

For chord symbols, attaching to a time position where there is no note is very simple - when you hit Space to move to the next note, it will stop at every beat even if there is no note. You can also use semicolon to move beat by beat only without stopping at different notes, and there are other shortcuts to advance by specific durations. But these work because it's expected you're using the keyboard to enter chord symbols anyhow, and Space is pretty much the universal "move to next note" shortcut when entering things whether in MuseScore or other programs. For hairpins, it would be possible for Space to move the start/end point, but a whole lot less intuitive.

Regarding the last paragraph, I'm having trouble following what you mean, an actual score and precise steps to reproduce would help.

I can say the reason a dynamic affects the length of a hairpin is that this is what standard notation demands. Consider, if the dynamic is especially long - like "sffffz" - then the hairpin needs to end shorter than if the dynamic is just "f". Also, if the dynamic is in the next measure and separately from the barline by a new key and time signature, it's normally necessary to extend the hairpin past the barline to meet it. So yes, the presence of a dynamic absolutely is supposed to affect the length of a preceding hairpin.

In reply to by Marc Sabatella

Didn't know about using the space key, though I wonder what the process would be if you wanted multiple chord symbols or figured bass annotations per it happens there's fair argument that using symbols that are intended to occur at specific time positions but not having those time positions explicitly shown in the score (vs being approximated by their horizontal position) isn't too good an idea anyway. I remember reading from a jazz chart that had 3 chord symbols above a whole note with no clear idea as to what the rhythm should be, I'd assumed it was 1/2, 1/4, 1/4 but then on hearing a recording realised it was supposed to be dotted 1/4, dotted 1/4, 1/4. For multiple hairpins on a single note obviously the exact duration of each hairpin comes down to musical sense - though I'd assume if you had multiple instruments all performing the same hairpins, you'd want to ensure they all crescendo-ed and diminuendo-ed at the same time. At any rate, probably the most typical case would be to cresc. for half the duration and dim. for the second half, so as long as there's an easy way of creating that I'd think that'd be a good start.

Understand that hairpins may need to adjust when a dynamic is added afterward, but I just wouldn't expect it to happen if I'd already made an adjustment to the hairpin length. I suppose there might be cases this would be desirable, but it's not obvious to me when.

Actually on a semi-related note (more related to the work I'm doing on improving copy/paste support), why is Figured bass treated completely differently to chord symbols? When entering figured bass it seems you can specify each indication to have any duration you like (though I'm not sure how to do dotted or tuplet durations), but when you copy and paste a list of symbols that includes figured bass it only supports them either being "on" the beat or "off" the beat (starting half-way through the note you paste on to). I say that, and that's in fact what the code does when you step through it, but the end result often isn't that at all, instead the pasted "off-note" indications often end up shuffled along to the next note/rest, I'm not quite sure why.

See the Handbook under Chord Symbols and under figured Bass to learn more about how these work. For both, you can use Ctrl plus a duration shortcut to advance by any amount you like, so yes, you can have two or more chords per beat if you like. The reason figured bass is a bit different is because the duration of the figure can actually shown in the score and needs to be specified explicitly - it's not always assumed to be until the next figure. To be honest I can't really explain it fully, but it was a point the Renaissance/Baroque specialist who implemented the figured bass facility was quite insistent upon, and he managed to explain it back then just well enough for me to understand, not to remember the details ten years later, I'm afraid.

BTW, one thing about the "approved" workaround for cresc/dim on a single note - it does work for playback, no need for invisible notes at all. As long as the hairpins are attached to the correct ticks via the invisible rests, they affect the visible notes in all voices. So you can totally have a swell on a whole note with "only" the invisible-rests-in-voice-two trick.

As I said, I am pretty sure Martin does have a design - or at least a draft of one - for how this sort of hairpin adjustment should work. Worth checking with him if you haven't already.

In reply to by Marc Sabatella

Some earlier discussion on paired hairpins on a single note is here:

My suggestion still stands: Make paired hairpins addable as a single item - i.e. the pallet would contain an up and down hairpin pair ( < > ) and a down and up pair ( > < ). that could be attached to a single note and with the central gap provided with handle that can be adjusted left or right to allow the gap to be offset from the centre. An useful extra feature would be to allow a dynamic marking to be added to the central gap.

In reply to by SteveBlower

That might be convenient but having the palette support adding multiple items or a single hairpin element to be <> or >< would be lot of special case logic for a solution that has limited flexibility.
Using ctrl+n to set the duration makes more sense to me, you could add a < to a whole note, then ctrl+5 to make it 1/4 note duration then add a > and it would automatically position itself after < and take up the remaining 3/4 by default. Just not sure how you'd explicitly set 3/4 notes as the duration if you wanted it the other way around ("." to make it dotted is one option obviously, not sure that doesn't work for chord symbols e.t.c ).
Internally that will require some significant changes to allow spanners to have segments as parents but it's a logically useful and sensible change that would work for pedal marks and vibrato lines etc (admittedly it's rare you need to specify a those starting part way through a note).
And the mscx format already supports it (it just doesn't work when you load the score).