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 { }
}
1 Comments
Sorted by latest first Latest Oldest Best
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.
I found your song here: www.heimat-bayern.de/uploads/8445f14732c410b3a0669cfdc345d6bd.pdf
I added the correct key signature, and fixed some of your notes and rhythms to match the PDF version.
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 { }
}
Terms of Use Privacy policy Contact About Cancellation policy © freshhoot.com2025 All Rights reserved.