Thank you Aaron, it seems to work! But what does stencil mean exactly?
Best,
Erika
Lähettäjä: Aaron Hill
Lähetetty: lauantai 5. maaliskuuta 2022 18.35
Vastaanottaja: Erika Pirnes
Kopio: lilypond-user@gnu.org
Aihe: Re: DynamicTextSpanner spacing
On 2022-03-05 3:49 pm, Erika Pirnes wrote:
> I would like the dotted line of the crescendo to start a bit later and
> end a bit earlier. It is too close to "cresc.", in my opinion at
> least. And sometimes too close to the "f" as well. (A tiny detail, for
> sure, but it looks annoying.) Any ideas?
> [...]
> music = \relative c' {
> \repeat unfold 5{c8 \p \cresc d e f g a b4 c8 \f b c2.}
> }
You will need to play around with the bound-details for the
DynamicTextSpanner:
\version "2.18.2"
\relative c' {
%% The space before the left side of the spanner.
%% (NOTE: This includes the attached stencil.)
%% Default is 0.75; we are adding two units of space.
\override DynamicTextSpanner.bound-details.left.padding = #2.75
%% Since we want the space between the stencil and
%% line, we need to shift the stencil over a bit.
%% Default is (-0.75 . -0.5); we move it left by the
%% same increment we applied to the padding above.
\override DynamicTextSpanner.bound-details
.left.stencil-offset = #'(-2.75 . -0.5)
%% The space after the right side of the spanner.
%% Default is 0.75; we are adding two units of space.
\override DynamicTextSpanner.bound-details.right.padding = #2.75
%% (For debugging only...)
%% Highlight the grob in red for better visibility.
%% Also make the line solid to show its extents clearly.
\override DynamicTextSpanner.color = #red
\override DynamicTextSpanner.dash-fraction = #1
\repeat unfold 5{ c8 \p \cresc d e f g a b4 c8 \f b c2. }
}
-- Aaron Hill