Trevor Bača wrote:
> OK, I was confusing dynamics and text scripts. For text scripts this
> baseline alignment is very cool. But for dynamics what I'm actually
> looking for is *center* alignment in the vertical direction (rather
> than *baseline* aligment). In other words, in Kieren's example above,
> my preference is to see the p and f center aligned *as though the p
> were the beginning of a crescendo and the f were the end*.
>
> Is there such a trick for *center* alignment of dynamic marks??
Actually, as long as the dynamics belong to the same
DynamicLineSpanner, i.e. a sequence of absolute dynamics,
hairpins and/or cresc/decresc with not gaps inbetween them,
then this is exactly what you get by default. If you want it
also for dynamics that are separated by some notes so that
they don't belong to the same DynamicLineSpanner, then
you can use exactly the same trick. I just increased the default
value of the staff-padding and kept the default center alignment
of each DynamicText in relation to its DynamicLineSpanner:
\version "2.10.33"
\paper { indent = 0 line-width = 2\in }
music = \relative c''
{
c2\p^\markup { "gorgeous" } c\f^\markup { "fantastic" }
c4\p c \f \> c c \! \p
}
\score
{
{
\music \break
\override DynamicLineSpanner #'staff-padding = #2.0
\override DynamicLineSpanner #'Y-extent = #'(-1 . 1)
\override TextScript #'Y-extent = #'(-1 . 1)
\music
}
}
OK, that's now officially brilliant. Mats, thanks so much (as usual). And entire .scm file I have sitting in my score directory can now vanish thanks to this single setting -- DynamicLineSpanner #'Y-extent. Excellent.
At the risk of belaboring the point, I'm having trouble understanding *why* this works. Here's an absolutely minimal example:
%%% TURNING ON Y-EXTENT %%%
\version "2.11.39"
\layout { ragged-right = ##t }
\new Staff {
\override DynamicLineSpanner #'staff-padding = #4
c'2 \p
c'2 \f
}
\new Staff {
\override DynamicLineSpanner #'staff-padding = #4
\override DynamicLineSpanner #'Y-extent = #'(0 . 0)
c'2 \p
c'2 \f
}
%%% END %%%