Jump to content

Define shorthand for text spanner, like rit. or rall.

From LilyPond wiki
Revision as of 22:51, 26 October 2025 by Jean Abou Samra (talk | contribs) (Import snippet from LSR)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

To obtain a textual indication like "rit." or "rall." followed by a dashed line, you have to first set bound-details.left.text. However, it is easy to define a shorthand to both set the text and start the text spanner.

\version "2.24.0"

rit = 
  \tweak bound-details.left.text #"rit. "
  \startTextSpan 

rall = 
  \tweak bound-details.left.text #"rall. "
  \startTextSpan 

% If you prefer the syntax \rit ... \stopRit:
stopRit = \stopTextSpan

\fixed c' {
  c4 d e \rit f |
  g1 \stopRit
  c4 d e _\rall f |
  g1 \stopTextSpan
}