Volta text markup using repeatCommands: Difference between revisions

m New category
mNo edit summary
 
Line 1: Line 1:
Though volte are best specified using <code>\repeat volta</code>, the context property <code>repeatCommands</code> must be used in cases where the volta text needs more advanced formatting with <code>\markup</code>.
Though volte are best specified using <code>\repeat volta</code>, the context property <code>repeatCommands</code> must be used in cases where the volta text needs more advanced formatting with <code>\markup</code>.


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>#`((volta ,<var>textIdentifier</var>) ...)</code> (note the use of the backtick after <code>#</code> and the comma before <var>textIdentifier</var>). Start- and end-repeat commands can be added as separate list elements.


<lilypond version="2.24">
<lilypond version="2.24">
Line 8: Line 8:
\relative c'' {
\relative c'' {
   c1
   c1
   \set Score.repeatCommands = #(list (list 'volta voltaAdLib) 'start-repeat)
   \set Score.repeatCommands = #`((volta ,voltaAdLib) start-repeat)
   c4 b d e
   c4 b d e
   \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat)
   \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat)
Line 16: Line 16:
</lilypond>
</lilypond>


[[Category:Repeats]]
[[Category:Repeats]]
[[Category:Repeats]]
[[Category:Symbols and glyphs]]
[[Category:Symbols and glyphs]]