2

I use Lilypond to make scores with only chords and lyrics. However, I don't understand the chords placement I get with the following snippet:

<<                                                                                                                                                           
  \new ChordNames
    \chordmode {
      a2:m a4:m a4:m/gis
      c2:/g c
      d2:/fis f2:m6 c2 c4 f4 c1                                             
     }
  \new Lyrics
    \lyricmode{
      " "8 "When I try to get through"4. " "2 \break                        
      " "8 "On the telephone to"4. "you"2 \break                            
      ""2. "There'll be nobody"4 "home."4 " "2. " "1 \break
    }
>>  
    \layout {                                                               
      ragged-right = ##t                                                    
      \context { \Score                                                     
        \omit BarNumber                                                     
      }                                                                     
      \context { \Lyrics                                                           
        \override VerticalAxisGroup.staff-affinity = ##f                             
        \override LyricText.parent-alignment-X = #LEFT                               
        \override LyricText.self-alignment-X = #LEFT                                 
      }
    }

which results in: enter image description here

In the first line, the last two chords should appear after the text, as in the third line. Can someone explain why they are aligned in this way and how to get the desired result?

1

1 Answer 1

0

I found a workaround, which is to fill the empty lyric notes with something, as in:

\lyricmode{
  " "8 "When I try to get through"4. "__"2 \break                        
  " "8 "On the telephone to"4. "you"2 \break                            
  ""2. "There'll be nobody"4 "home."4 " "2. " "1 \break
}

which would result in enter image description here

To avoid the underscores showing up. I found this trick to add invisible text:

spacetwo = \lyricmode{
  \override Lyrics.LyricText.color = #white
  "X"2
  \override Lyrics.LyricText.color = #black
  }

Then:

    \lyricmode{
      " "8 "When I try to get through"4. \spacetwo \break
      " "8 "On the telephone to"4. "you"2 \break
      ""2. "There'll be nobody"4 "home."4 " "2. " "1 \break
    }

Now the result looks exactly the way I wanted:

enter image description here

Hope this is useful to someone!

2
  • I wonder why such laborious a code is used (Lilypond) to get chords over lyrics when an application or two exists that does the same by typing a brackets around the chord name, i.e. [G#m] within the text. The chord is automatically placed over word, or any where you want it in a line of verse, and it is stored so as the chord is repeated in the lyrics, it can be tapped or clicked upon from a now stored list of chords places it where you want it. You only write the chord once in [X] format then tap it from the list. No code necessary.
    – ejbpesca
    Dec 8, 2023 at 11:07
  • Lilypond is much more flexible, though: for example, you could use the same chords above a stave (or the same words under a stave), or show the chords on their own with barlines, or other combinations, simply by changing the \score block — very handy for generating e.g. lead sheets and chords sheets _and scores for the same song.
    – gidds
    Jan 7 at 16:51

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.