I am in the process of engraving a piano sheet, and I wrote a custom dynamic mark with the look of which I am very happy, but the behavior, not totally. It is the following :
mff = \tweak DynamicText.self-alignment-X #LEFT
#(make-dynamic-script
(markup
#:dynamic "mf"
#:normal-text #:italic #:teeny "2ème fois"
#:dynamic "f"))
When used, it looks like :
When not used, it looks like :
I am happy with the mark beginning below the note to which it is attached (as opposed to centered below that note); but I would like that it doesn't postpone the next note until the mark is entirely written. Ideally, it would affect the bar width only if the line marking the end of the bar risks to cut the mark.
I can't find what I'm looking for in the documentation.
In case there is any need for it, here is my code for the music :
%%%%%%%%%%
%% VERSION
%%%%%%%%%%
\version "2.20.0"
\paper {
#(include-special-characters)
}
%%%%%%%%%%%
%% PIANO UP
%%%%%%%%%%%
mff = \tweak DynamicText.self-alignment-X #LEFT
#(make-dynamic-script
(markup
#:dynamic "mf"
#:normal-text #:italic #:teeny "2ème fois"
#:dynamic "f"))
pianoUpper = \relative c' {
\override DynamicLineSpanner.staff-padding = #3
\clef "treble"
\key d \minor
\time 4/4
<\tweak font-size #-3 a f'>4 \f <\tweak font-size #-3 c g'> <f a> <d bes'> |
<f a>2 <e g> |
f2. r4 \bar "||"
<f a> \mf \< <f a> <f a> <f a>8 <a c> |
<a c>4. <g bes>8 <f a>4 f \! |
<f a> <f a>8 <e g> <f a>4 <f a>8 <a c> |
<a c>4. \> <g bes>8 <f a>4 r \! |
<f a> \p \< <f a> <f a> <f a>8 <a c> |
<a c>4. <g bes>8 <f a>4 f \! |
<f a> <f a>8 <e g> <f a>4 <f a>8 <a c> |
<a c>4. \> <g bes>8 <f a>4 r \! |
\repeat volta 2 {
c'2\( d8 c bes a |
bes2 c8 bes a g |
a2 bes8 a g f |
g4.\) g8 c,2 \> |
<\tweak font-size #-3 a f'>4 \< <\tweak font-size #-3 c g'> <f a> <d bes'> |
}
\alternative{
{<f a>2 \> <e g>4 r \! |}
{<c a'>2\( <bes g'>\) |
<a f'>2. r4 \bar "|."}
}
}
%%%%%%%%%%%%
%% PIANO LOW
%%%%%%%%%%%%
pianoLower = \relative c {
\clef "bass"
\key d \minor
f4 c f bes, |
c2 <c, c'> |
<f f'>4 c' f, r |
f' <a c> f <a c> |
c, <e bes' c> f <a c> |
f <a c> f <a c> |
c, <e bes' c> <f a c> r |
f <a c> f <a c> |
c, <e bes' c> f <a c> |
f <a c> f <a c> |
c, <e bes' c> <f a c> r |
f <a c> d, <fis c'> |
g, <g' bes d> c, <e bes' c> |
f <a c> d, <f bes> |
c <e bes c> c <e g> |
f c f bes, |
c2 c4 c |
c2 <c, c'> |
<f f'>4 c' f, r |
}
%%%%%%%%
%% SCORE
%%%%%%%%
\score {
<<
\new PianoStaff <<
\new Staff = "upper" \pianoUpper
\new Staff = "lower" \pianoLower
>>
>>
}