3

I'm trying to produce a piece containing only chords and lyrics in lilypond, and I want to use one set of chords for different verses. Yet, I don't understand why the chords won't appear over the second line in the following example.

versechords = \chords { g2 d f g}                                                                                                                            

verseI  = \lyricmode {This2 "is the" first verse \break}
verseII = \lyricmode {This2 "is the" second verse \break}

\new Score \with {
  \remove "Bar_number_engraver"
}
<<
  \new Chords {
    \versechords
    \versechords
  }
  \new Lyrics \with {
    \override VerticalAxisGroup.staff-affinity = ##f
    \override LyricText.parent-alignment-X = #LEFT
    \override LyricText.self-alignment-X = #LEFT
  }
  {
    \verseI
    \verseII
  }
>>

\layout {
  indent = 0
  ragged-right = ##t
  \context {
    \Score
    \override SpacingSpanner packed-spacing = ##t
  }
}

enter image description here

I can get the right result if I create one sequence of chords containing twice the chords of the verses, but I really want to define the sequence only once and use it multiple times.

1 Answer 1

6

Your mistake is in the very first line:

versechords = \chords { g2 d f g}

Note that \chords is an abbreviation for \context ChordNames \chordmode, so your double use of \versechords leads to two separate ChordNames contexts. You want to use just \chordmode here, and \new ChordNames (and not \new Chords, please don't ignore warnings LilyPond issues!) around the double use of \versechords.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.