On Tue 23 Nov 2021 at 12:25:47 (-0800), Kees van den Doel wrote:
> I have a \repeat volta 2 { music}, but a few bars inside "music" are
> different the second time through.
> Is there a way to do something like this:
> \repeat volta 2 { A \alternative {{a1}{a2}} B}
> Written out fully Aa1BAa2B.

If it suits, you could try and adapt the attached.

Cheers,
David.
\version "2.19.44"
\language english

#(set-global-staff-size 18)
\header { tagline = ##f }

global = {
  \key ef \major
  \time 6/4
  s1.
  \time 4/4
  s1
  \time 6/4
  s1.
}

globalm = {
  \allowVoltaHook "|"
  \key ef \major
  \time 6/4
  s1. \noBreak
  \time 4/4
  \set Score.repeatCommands = #'((volta "1."))
  s1 \noBreak % alternative 1
  \set Score.repeatCommands = #'((volta #f) (volta "2."))
  s1 \noBreak % alternative 2
  \set Score.repeatCommands = #'((volta #f))
  \time 6/4
  s1.
}

align = \relative {
  bf'2. bf4 g af
  c4 bf8 af g4 g
  af2. bf4 c g
}

soprano = \relative {
  bf'2. bf4 g af
  <<
    { c8 bf4 af8 g4 g }
    \new Staff = ossia \with {
      \remove "Time_signature_engraver"
      alignAboveContext = #"main"
      \magnifyStaff #2/3
      firstClef = ##f
    } <<
      \new Voice = alt { \omit Staff.KeySignature \key ef \major c4 bf8 af g4 g 
}
      %%\new Lyrics \lyricsto alt { one with the brood -- ing sea, }
    >>
  >>
  af2. bf4 c g
}


sopranom = \relative {
  bf'2. bf4 g af
  c8 bf4 af8 g4 g % alternative 1
  c4 bf8 af g4 g % alternative 2
  af2. bf4 c g
}

texti = \lyricmode {
  wall,
  When blind moths flut -- ter by door and " " _ _ _ _ tree,
  Then comes the
}

textii = \lyricmode {
  rath,
  When night is " " _ _ _ _ one with the brood -- ing sea,
  Then comes the
}

texta = \lyricmode {
  wall,
  When blind moths flut -- ter by door and tree,
  Then comes the
}

textb = \lyricmode {
  rath,
  When night is one with the brood -- ing sea,
  Then comes the
}

textc = \lyricmode {
  _ _ _ _ one with the brood -- ing
}

\score {
  \new Staff <<
    \clef treble \globalm
    \new Voice = sop { \sopranom }
    \new Lyrics \lyricsto sop { \texti }
    \new Lyrics \lyricsto sop { \textii }
  >>
  \layout {
    indent = 0
    \context {
      \Staff
      \omit TimeSignature
    }
  }
}

\markup { " " }
\markup { " " }
\markup { " " }
\markup { " " }
\markup { " " }

\score {
  \new Staff = main <<
    \clef treble \global
    \new NullVoice = ali { \align }
    \new Lyrics \with { alignAboveContext = main } \lyricsto ali { \override 
LyricText.font-size = #-2 \textc }
    \new Voice = sop { \soprano }
    \new Lyrics \lyricsto sop { \texta }
    \new Lyrics \lyricsto sop { \textb }
  >>
  \layout {
    indent = 0
    \context {
      \Staff
      \omit TimeSignature
    }
  }
}

Attachment: alt.pdf
Description: Adobe PDF document

Reply via email to