Align secondary lyrics to hidden Voice

750 Views Asked by At

I think I'm close, but can't quite seem to get two stanzas going with one aligned to a hidden voice - so that rhythmic variations can be approximated by the lyrics.

melody = \relative c' {
  \clef treble
  \key c \major
  \time 4/4
  c4 d e f | g f e d |

  <<
 \new Voice = "shown" {
  \relative c' { 
  c4 d c d | e f g2
     }
    }  

  \new Voice = "hidden" {
   \hide { 
  c'8 c d d c c d d | e f g2
     }
    }
  >>
}

text =  \lyricmode {
   Here we have a | li -- tle si -- lly

  <<
    {
      \set stanza = #"1. "
      Si -- lly li -- tle | al -- pha -- bet

    \new Lyrics {
      \set associatedVoice = "hidden"
      \set stanza = #"2. " 
      Si -- ly li -- tle fu -- nny soun -- ding |
      Al -- pha -- bet song.
        }
    }
  >>
  }

\score {
  <<
    \new Voice = "one" { \melody }
    \new Lyrics \lyricsto "one" \text
  >>

  \layout { }
  \midi { }
}

The above shows both voices and neither of their "associated" (or not) lyrics.

2

There are 2 best solutions below

0
On BEST ANSWER

You can use the NullVoice context as so:

\version "2.19.15"
\language "english"

\score {
  \new Staff
  <<
    \new Voice = "displayedMusic" \relative c'' {
      b8 c d \times 2/3 {c16 d c}
      b8 a g a
      bf c bf \times 2/3 {a16 bf a}
      g8 f g a
      bf f' e a,
      d cs4.~
      cs1
    }

    \new NullVoice = "hiddenMusic"
    {
      c4 d e f %\break
      g a b8~ b c4 \break
      d e f g a
    }
    \new Lyrics \lyricsto "hiddenMusic" {
      Those words seem to be aligned to the hidden melody or are they?
    }
  >>
}

Which will result in :

Sheet Music Snippet

0
On

Okay. From the lilypond mailinglist I learned:

First, you need to use \hideNotes, not \hide. Also the above structure doesn't quite work. It's usually easier to have all the lyrics contexts running from the start rather than starting them part way along - they'll get their position from the notes. Here's one way of doing it, although in this particular case the stanza number doesn't quite fit.

melody = \relative c' {
  \clef treble
  \key c \major
  \time 4/4
  c4 d e f | g f e d |

  <<
    \new Voice = "shown" {
      \relative c' { 
        c4 d c d | e f g2
      }
    }  

    \new Voice = "hidden" {
      \hideNotes {                  % !!
        c'8 c d d c c d d | e f g2
      }
    }
  >>
}

text =  \lyricmode {
   Here we have a | li -- tle si -- lly
}

wordsOne = \lyricmode {
  \set stanza = #"1. "
  Si -- lly li -- tle | al -- pha -- bet
}

wordsTwo = \lyricmode {
  \set stanza = #"2. " 
  Si -- ly li -- tle fu -- nny soun -- ding |
  Al -- pha -- bet song.
}

\score {
  <<
    \new Voice = "one" { \melody }
    \new Lyrics \lyricsto "one" \text
    \new Lyrics \lyricsto "shown" \wordsOne
    \new Lyrics \lyricsto "hidden" \wordsTwo
  >>

  \layout { }
  \midi { }
}