bell notificationshomepageloginNewPostedit profiledmBox

Hoots : Lilypond: how to align lyrics vertically if the melody is split into variables? In Lilypond, I'd like to split a melody into variables in order to easily see which syllables belong to which notes. Unfortunately, I am doing - freshhoot.com

10% popularity   0 Reactions

Lilypond: how to align lyrics vertically if the melody is split into variables?
In Lilypond, I'd like to split a melody into variables in order to easily see which syllables belong to which notes. Unfortunately, I am doing it in a way that seems to mess up the vertical alignment of the lyrics.
Lilypond example code:
barI = {
relative c {
c g e e' |
}
addlyrics {
Ve -- ry first bar.
}
}

barII = {
relative c' {
c c c c
}
addlyrics {
and the se -- cond.
}
}

% ------------------------------------------------
% Staves
% ------------------------------------------------
bass = new Staff with {
instrumentName = #"Bass "
shortInstrumentName = #"B "
} {
clef "bass"
key g major
barI barII
}

% ------------------------------------------------
% Document
% ------------------------------------------------
header {
title = "Vertical Lyrics"
composer = "The famous"
opus = "DWV 42"
}

score {
<<
bass
>>

version "2.20.0"
midi { }
layout { }
}

This is what the output looks like.

Question: What is the best practice to see the notes and lyrics as close as possible in the code, and at the same time get lyrics reasonably aligned vertically in Lilypond's output?
Thanks for any help!


Load Full (1)

Login to follow hoots

1 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

I'm not sure if there is an easier method, but splitting like this works:
barImelody = relative c {
c g e e' |
}
barIlyrics = lyricmode {
Ve -- ry first bar.
}

barIImelody = relative c' {
c c c c
}
barIIlyrics = lyricmode {
and the se -- cond.
}

bass = new Staff with {
instrumentName = #"Bass "
shortInstrumentName = #"B "
} {
clef "bass"
key g major
{
barImelody barIImelody
}
addlyrics {
barIlyrics barIIlyrics
}
}


Back to top Use Dark theme