8

In the solo voice here:

Solo voice

a ritardando shows up on beat four of the measure, but there is only a whole note in the measure. If I attach the ^\markup{\italic rit.} to that whole note, the ritardando shows up on beat one. How do I put it on beat four?

3 Answers 3

6

Barring any more complicated notation decisions—like slurs, ties, expressions, or polyphonic voicing—two much simpler, easier ways to implement this than the current answer would be the following:

  1. ees1^\markup \italic \translate #'(3.7 . 0) "rit."
  2. ees1*3/4 s4^\markup \italic "rit."

For number 1, it’s a matter of attaching the markup to the note, then shifting it to the right some arbitrary distance. (See A.11.2 Align)

For number 2, it’s a matter of scaling durations, using spacer rests, and attaching the markup to that spacer rest; specifically, tell LilyPond to assign the whole note 3/4’s of its duration value, and use the remaining 1/4 of the measure to insert a spacer rest and attach the markup there. (See 1.2.1 Writing rhythms)

2
  • Nice. Number 1 doesn't look so great because of the hard-coded horizontal adjustment. This will fail if anything about the layout changes the horizontal length of the measure. Number 2 is new to me. I never knew exactly what R1*3/8 was doing, and I thought it had to do with "whole" measure rests. Your answer is suggestive and very helpful! I guess \translate only works on markup? I would like to use it on the other question I just posted :-D Commented Mar 22, 2022 at 19:04
  • 4
    LilyPond 2.24 (and 2.23) adds \after for this purpose. See my answer.
    – benrg
    Commented May 11, 2023 at 0:57
5

In the latest stable version of LilyPond (2.24), there's a new \after music function for this purpose:

\after 2 ^\markup{\italic rit.} ees1

You can push more than one expressive mark into the future this way: for example, to put a swell on the middle of the note:

\after 4 \< \after 2 \> \after 2. \! ees1

\after doesn't have its own section in the manual. It's mentioned in these places:

Expressive mark improvements
Dynamics
Percent repeats
Available music functions
Snippet: Creating a delayed turn
Snippet: Setting the minimum length of hairpins

3

Create an invisible second voice. Instead of

ees1^\markup{\italic rit.}}

which puts the ritardando on beat one, use

<< { \oneVoice ees1 } \\ { s2. 4^\markup{\italic rit.}} >>

Explanation:

  • << starts a "simultaneous" section and >> ends it; they can be used any time a music expression is expected.
  • Inside the first { } is the upper voice of the simultaneous music expression.
  • \oneVoice is used to write the part as though there is only one voice. The default in this "simultaneous" context is to use \voiceOne in the top part which will make all the stems up. Since we're only using two voices to create an invisible voice in voice two, we should typeset voice one as though there is only one voice.
  • \\ divides the top and bottom voices.
  • Inside the second { } is the lower voice.
  • s2. creates a "spacer" (that is, an invisible note) the length of a dotted half note.
  • 4 creates the same kind of note ("spacer" in this case) with the length of one quarter note.
  • ^ means "place something above this note" which is on the fourth beat of the measure.
  • \markup{\italic rit.}} does what it appears to do! (You can read more about markup in the Lilypond docs: https://lilypond.org/doc/v2.23/Documentation/notation/formatting-text

The result:

enter image description here

Of course, this trick works with other types of notation, too, like expression marks. In the second bar of that screen shot, see that there is a one beat crescendo followed by a one beat decrescendo on top of dotted quarter, eighth notes.

7
  • 2
    The \\ isn't necessary. And if you remove it then you won't need \voiceOne because you won't be creating any unnecessary extra voices. Commented Aug 8, 2022 at 15:01
  • @ElementsinSpace I think that if you disagree with this answer, while the author doesn't want to change it, you should write your own answer. Commented May 11, 2023 at 17:00
  • 1
    @user1079505 This answer works, explains why it works, and is well written. So, I up-voted it. In this particular case though, using \\ and \oneVoice aren't required as I tried to explain in my comment. I'm only suggesting that these two commands be left out of the otherwise identical line of code; I didn't think it was worth posting as a separate answer. Also, the new answer by benrg is best for the current version of LilyPond (2.24). Commented May 12, 2023 at 2:50
  • @ElementsinSpace I know too little about lilypond to be confident, so didn't vote neither to accept or reject the edit. That was my suggestion, but I could be wrong. Commented May 12, 2023 at 4:51
  • @user1079505 Oh, I didn't see there was a pending edit. Yeah, I do think that edit would make this answer better... But the answer works as is, and the edit kinda changes the intent of the answerer. I think whether to accept or reject that edit should be decided by Imat - Reinstate Monica. And if rejected, I agree with you 9505 — it could be posted as a separate answer Commented May 12, 2023 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.