Nov 6, 2014

Long, Broken (De-)Crescendo Text

Have you ever wondered how to create a dynamic marking like this:



I know I have, and as I was looking through the Chopin score above, I noticed this marking again, and having never tried to do it in LilyPond, I thought I'd figure it out.

In the LilyPond Notation Reference, under the Dynamics Section there's a subsection called "Changing text and spanner styles for text dynamics". In the example, it shows how you can customize the crescendo markings to be text instead of a hairpin and use your own markup text.

\relative c'' {
  \set crescendoText = \markup { \italic { cresc. poco } }
  \set crescendoSpanner = #'text
  \override DynamicTextSpanner.style = #'dotted-line
  a2\< a
  a2 a
  a2 a
  a2 a\mf
}

We can extend this further by using successive "\<" marks, which allows us to have as many bits of text as I want in the chain, except for the last one. To end the chain, it must end on a stand-alone dynamic. This can be created with:
do = \markup { \normal-text \italic do }
do = #(make-dynamic-script do)
or these operations can be combined:
do = #(make-dynamic-script (markup #:normal-text #:italic "do"))

Now, to create the broken-up crescendo (I'll leave the default dashed-line), we can do something like this:
\relative c'' {
  \set crescendoSpanner = #'text
  \set crescendoText = \markup \italic "cre"
  a2\< a 
  \set crescendoText = \markup \italic "scen"
  a2 a\<
  a2 a
  a2 a\do
}
So, all we need to do is put \set crescendoText = \markup \italic "some text" before the note or chord we want to attach it to and \< after it like we would normally do.

No comments:

Post a Comment