# Can't make my crescendo end were I want it to with Lilypond

I'm trying to reproduce a scanned score with Lilypond. The original (the part of interest, at least), looks like this :

As you can see, there is a crescendo starting at the beginning of the 3rd bar, and ending at the end of the 4th bar.

My Lilypond code is the following (I put the crescendo in the upper staff) :

%%%%%%%%%%
%% VERSION
%%%%%%%%%%

\version "2.20.0.3"

%%%%%%%%%%%
%% PIANO UP
%%%%%%%%%%%

pianoUpper = \relative c' {
\clef "treble"
\time 3/4
\key c \major

f4-. \p a-. c-. |
e,-. g-. c-. |
a( \< b c) |
<b d>2.\fermata \! \bar "||"

\time 6/8

<e, g>8.( \p <f a>16 <e g>8 <c e>4.) |
}

%%%%%%%%%%%%
%% PIANO LOW
%%%%%%%%%%%%

pianoLower = \relative c {
\clef "bass"
\time 3/4
\key c \major

<f a c>2. |
<g c> |
<d a' c> |
<g b>\fermata \bar "||"

\time 6/8

<c, e g>4 <c e g>8 <c e g>4. |
}

%%%%%%%%
%% SCORE
%%%%%%%%

\score {
<<
\new PianoStaff <<
\new Staff = "upper" \pianoUpper
\new Staff = "lower" \pianoLower
>>
>>
}


And it produces the following result :

Which is upsetting, because I would very much like the crescendo to finish just after the accord of the 4th bar. I have tried placing the \! at different places, with no satisfying result.

Has someone an idea of how I can have the crescendo ending at the end of bar 4, like on my original scanned score?

The hairpin that ends on the first beat of a measure stops at the bar line. To change this, override the property to-barline to false.

...

f4-. \p a-. c-. |
e,-. g-. c-. |
\once \override Hairpin.to-barline = ##f
a( \< b c) |
<b d>2.\fermata \! \bar "||"

...


If you want the hairpin to go further than that, use a scaled duration and spacer rests to trick the hairpin to end at an invisible note at the third beat of the measure.

...

f4-. \p a-. c-. |
e,-. g-. c-. |
\once \override Hairpin.to-barline = ##f
a( \< b c) |
<b d>2.*1/3 \fermata s4 s \! \bar "||"

...


See here about scaling durations: http://lilypond.org/doc/v2.20/Documentation/notation/writing-rhythms#scaling-durations

• You could also let the hairpin end on a void chord using <>\!. This way, you don’t have to insert spacer rests. Apr 19, 2020 at 7:13
• @JasperHabicht how so? I am very new at Lilypond, so I tried finding the corresponding documentation, but no such luck. And between your suggestion and TiagoPC's solution, which one is actually better / more recommended / better practice? Apr 19, 2020 at 12:03
• @JambonSama I added my comment as new answer. Actually, there is no “best“ answer to your approach. I would perhaps not necessarily scale durations because I think this is a quite hacky solution and may have some negative effects on the placement of the notes, but I guess the solution with overriding the hairpin’s to-barline property is actually one of the intended ways to solve your problem. Apr 19, 2020 at 17:30

You can input an empty chord with <> and let the hairpin end on it. This way, you don’t need to input an \override or scale the duration.

\new Voice {
\time 3/4
\relative c' { a'4(\< b c) | <b d>2.\fermata <>\! \bar "||" }
}


The above code should render as:

• This is actually a better solution. I didn't know that. I'll add it to my repertoire. Apr 21, 2020 at 7:22
• I don’t remember where I learned this trick and could not find it in the documentation. But it is especially helpful when you deal with multiple voices. I think it works for spanners in general. Apr 21, 2020 at 7:25