Hi,
I'm trying to place symmetrical hairpins under a bar, but it turns out that the left (crescendo) hairpin is longer than the right (descrescendo) hairpin.
MWE:
\version "2.24.1"
\new Voice \relative <<
{ c'2 c2 }
{ s2\< s2\> <>\! }
>>
Tweaking with the lengths of the spacers turns out very difficult and results in hairpins at unequal vertical positions:
\version "2.24.1"
\new Voice \relative <<
{ c'2 c2 }
{ s4...\< s32\! s2\> <>\! }
>>
And sometimes I need an absolute dynamic in front of the hairpins, in which case the left hairpin becomes very small:
\version "2.24.1"
\new Voice \relative <<
{ c'2 c2 }
{ s4...\pp\< s32\! s2\> <>\! }
>>
Is there an (hopefully easy) way to give both hairpins equal size and vertical alignment, regardless of the presence of an absolute dynamic in front?
I prefer to enter the dynamics together with the music, instead of instead of using a parallel set of spacing notes, but that may be a matter of taste. A first step to get close to what you want is to set the minimum-length, either for en individual hairpin using \tweak:
\new Voice \relative {
c'2 \pp -\tweak minimum-length #7 \< c2 \> <>\!
}
or setting it for all upcoming hairpins:
\new Voice \relative {
\override Hairpin.minimum-length=#7 c'2 \< c2 \>
<>\!
}
However, as you can see from these two examples, you probably
need some manual tweaking of the minimum-length for each specific
situation, in which case the \tweak syntax is somewhat more
convenient. In particular, it seems that the absolut dynamic (the
\pp in this example) is included in the length.
For more aspects on the problem and some ideas of possible
solutions, see
https://lists.gnu.org/archive/html/lilypond-user/2023-09/msg00079.html,
where I'm still hoping that some other people on the list can
contribute with even better ideas than the ones I came up with.
/Mats
PS My examples can of course also be written more similar to your code:
\new Voice \relative <<
{ c'2 c2 }
{ s2 \pp -\tweak minimum-length #7 \< s2\> <>\! }
>>
\new Voice \relative <<
{ c'2 c2 }
{ \override Hairpin.minimum-length=#7 s2 \< s2\>
<>\! }
>>