Breaking horizontal alignment of dynamics and textscripts
Appearance
LilyPond uses DynamicLineSpanner grobs to horizontally align successive dynamic objects like hairpins and dynamic text, even if they are positioned on different sides of a staff. This connection cannot be broken, contrary to the vertical alignment (see snippet Breaking vertical alignment of dynamics and textscripts).
There are two solutions to circumvent the problem.
- Modify the
shorten-pairproperty of theHairpingrob to compensate the offset by which the hairpin was moved. - Put the two dynamic objects into two different voices.
Both solutions are demonstrated in this snippet.
\version "2.24.4"
{
<>^"default"
f'_\pp ^\> f' f' f'\!
}
{
<>^\markup { setting \typewriter shorten-pair }
f'_\pp \tweak shorten-pair #'(-3 . 0) ^\> f' f' f'\!
}
{
<>^\markup { using another \typewriter Voice context }
<< { f'^\> f' f' f'\! }
\new Voice { s4_\pp } >>
}
\layout {
line-width = 8\cm
ragged-right = ##f
\context {
\Voice
\override TextScript.staff-padding = #3.5
}
}