Jump to content

Volta text markup using repeatCommands: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
Line 3: Line 3:
Since <code>repeatCommands</code> takes a list, the simplest method of including markup is to use an identifier for the text and embed it in the command list using the Scheme syntax <code>#(list (list 'volta textIdentifier))</code>. Start- and end-repeat commands can be added as separate list elements:
Since <code>repeatCommands</code> takes a list, the simplest method of including markup is to use an identifier for the text and embed it in the command list using the Scheme syntax <code>#(list (list 'volta textIdentifier))</code>. Start- and end-repeat commands can be added as separate list elements:


<lilypond version="2.24.0">
<lilypond version="2.24">
voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } }
voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } }



Revision as of 18:50, 16 November 2025

Though volte are best specified using \repeat volta, the context property repeatCommands must be used in cases where the volta text needs more advanced formatting with \markup.

Since repeatCommands takes a list, the simplest method of including markup is to use an identifier for the text and embed it in the command list using the Scheme syntax #(list (list 'volta textIdentifier)). Start- and end-repeat commands can be added as separate list elements:

\version "2.24"

voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } }

\relative c'' {
  c1
  \set Score.repeatCommands = #(list (list 'volta voltaAdLib) 'start-repeat)
  c4 b d e
  \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat)
  f1
  \set Score.repeatCommands = #'((volta #f))
}