# How to align chords, melody and lyrics in LilyPond?

I have to write down a simple song with LilyPond (my iPad music book did disappear when I've tried to recover a backup, so I think it is save to store the music sheets in text form), but I can't figure out, how to align words, melody and chord. I've managed somehow to align words and melody (it seems, as if they are associated over the timing), but I can't find it. I tried everything, but the chords showed up only directly from the beginning of then song, over every note, not about the bars or wherever I would place them.

While I saw some examples, where they were correctly set, I never managed to do it. Also, I can't figure out how to set a partial with two notes. This is my experiment:

\include "predefined-guitar-fretboards.ly"

verseI = \lyricmode {
\set stanza = #"1."
Ach was |
wird denn meine Mutter |
sagen wenn |
ich einst kehr zu ihr | zurück?
}

verseII = \lyricmode {
\set stanza = #"2."
This is the second verse.
}

theChords = \chordmode {
d | g | a | d
}

staffMelody = \relative c' {
\key c \major
\clef treble
\time 4/4
\partial 8*4 a8 d8 |
f4 f8 f8 g4 f4 |
e2 b b' |
a g f |
% \bar "|."
}

\score {
<<
\context ChordNames { \theChords }
\new Staff {
\context Voice = "voiceMelody" { \staffMelody }
}
\new Lyrics = "lyricsI" {
\lyricsto "voiceMelody" \verseI
}
\new Lyrics = "lyricsII" {
\lyricsto "voiceMelody" \verseII
}
>>
\layout { }
\midi { }


}

• I suspect you have to specify rhythm for the chord names and the default rhythm is quarter note (crotchet), which is why the names are showing up every quarter note. If it's anything like other notation packages, you'll probably have to manually break words into syllables, like putting "Mut-ter" if those syllables are supposed to be on different notes. – Todd Wilcox May 13 '16 at 21:18

There are several different ways to input lyrics to Lilypond, and the differences between them are confusing. This just describes one way, to get you started.

You need to input "something" as a lyric for every note in the melody, but the underscore character _ doesn't print anything, so you can use that to leave a space.

Also, you need to split the words into syllables. You should always input -- where there might be a hyphen. Lilypond won't print the hyphen if there is no room for it. (In the example, the hyphen is printed in "sa-gen" but not in "Mutter"). Note, there should be spaces between the syllables and any -- or _ characters in the input.

For the chords, you need to specify the rhythm in the same way as for notes. You can use s to make an "invisible rest," as at the start of the song.

\version "2.18.2"
\include "predefined-guitar-fretboards.ly"

verseI = \lyricmode {
\set stanza = #"1."
Ach was |
wird denn meine Mut -- ter |
sa -- gen wenn |
ich einst kehr komm nach  | Haus?
}

verseII = \lyricmode {
\set stanza = #"2."
This _ | is _ the se -- cond | verse. _
One | two _ _ three | four.
}

theChords = \chordmode {
s4 | d1 | g1 | a1 | d1
}

staffMelody = \relative c' {
\key d \major
\clef treble
\time 4/4
\partial 4 a8 d8 |
fis4 fis8 fis8 g4 fis4 |
e2 b4 b' |
a4. g8 fis4 eis | fis2
% \bar "|."
}

\score {
<<
\context ChordNames { \theChords }
\new Staff {
\context Voice = "voiceMelody" { \staffMelody }
}
\new Lyrics = "lyricsI" {
\lyricsto "voiceMelody" \verseI
}
\new Lyrics = "lyricsII" {
\lyricsto "voiceMelody" \verseII
}
>>
\layout { }
\midi { }
}

• Hello Alephzero, i marked your answer as correct, as it showed me some tricks, with which could answer some fundamental questions about the typesetting in lilypond. It is a very complex tool, and i wonder every time, why there are always only complex documentations, seemingly for already experts (not only lilypond, nearly every tool). Nevertheless, there is much work to do for me because i have to adapt many subtle thing, which aren't quite obvious. The song you found is the right one, but traditions vary and i have a very different piece, which i try to adapt. Thank you! – Coliban May 14 '16 at 8:57