Multiple repeats with alternate endings: Difference between revisions
Appearance
Import snippet from LSR |
m New category Tags: Mobile edit Mobile web edit |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 3: | Line 3: | ||
This snippet shows how to create a single first alternative using <code>\tag</code> for the midi output. | This snippet shows how to create a single first alternative using <code>\tag</code> for the midi output. | ||
<lilypond version="2.24 | <lilypond version="2.24" full> | ||
\paper { tagline = ##f } | \paper { tagline = ##f } | ||
| Line 69: | Line 69: | ||
[[Category:Repeats]] | [[Category:Repeats]] | ||
[[Category:Midi]] | [[Category:Midi]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:22, 21 November 2025
By default it is the last alternative that stays single.
This snippet shows how to create a single first alternative using \tag for the midi output.
\version "2.24"
\paper { tagline = ##f }
\markup \italic "Default alternatives :"
\relative c' {
c d e f
\repeat volta 4 { d e f g }
\alternative {
{ e f g a }
{ f g a b }
}
g a b c
a
}
\markup\vspace #1
\markup\italic "Forcing the first alternative as single :"
myMusic = \relative c' {
c d e f
% this tag's for the pdf
\tag myScore {
\repeat volta 4 { d e f g }
% 1st repeat alternative
\set Score.repeatCommands = #'((volta "1."))
e f g a
% 2nd to 4th repeats alternative
\set Score.repeatCommands = #'((volta #f) (volta "2.--4.") end-repeat)
f g a b
\set Score.repeatCommands = #'((volta #f))
}
% this tag's for the midi
\tag myMidi
\relative c' {
d e f g
e f g a
\repeat volta 3 {
d, e f g
f g b c
}
}
g a b c
a
}
% Score output :
\score {
\keepWithTag myScore \myMusic
\layout {}
}
% Midi output :
\score {
\unfoldRepeats
\keepWithTag myMidi \myMusic
\midi {}
}