Vocal music
Vocal music
Adding ambitus per voice
Ambitus can be added per voice. In this case, the ambitus must be moved
manually to prevent collisions.
\new Staff <<
\new Voice \with {
\consists "Ambitus_engraver"
} \relative c'' {
\override Ambitus #'X-offset = #2.0
\voiceOne
c4 a d e
f1
}
\new Voice \with {
\consists "Ambitus_engraver"
} \relative c' {
\voiceTwo
es4 f g as
b1
}
>>
Adding indicators to staves which get split after a break
This snippet defines the \splitStaffBarLine
command, which adds
arrows in north-east and south-east directions at a bar line, to denote
that several voices sharing a staff will each continue on a staff of
their own in the next system.
#(define-markup-command (arrow-at-angle layout props angle-deg length fill)
(number? number? boolean?)
(let* (
;; PI-OVER-180 and degrees->radians are taken from flag-styles.scm
(PI-OVER-180 (/ (atan 1 1) 45))
(degrees->radians (lambda (degrees) (* degrees PI-OVER-180)))
(angle-rad (degrees->radians angle-deg))
(target-x (* length (cos angle-rad)))
(target-y (* length (sin angle-rad))))
(interpret-markup layout props
(markup
#:translate (cons (/ target-x 2) (/ target-y 2))
#:rotate angle-deg
#:translate (cons (/ length -2) 0)
#:concat (#:draw-line (cons length 0)
#:arrow-head X RIGHT fill)))))
splitStaffBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
\combine
\arrow-at-angle #45 #(sqrt 8) ##f
\arrow-at-angle #-45 #(sqrt 8) ##f
}
splitStaffBarLine = {
\once \override Staff.BarLine #'stencil =
#(lambda (grob)
(ly:stencil-combine-at-edge
(ly:bar-line::print grob)
X RIGHT
(grob-interpret-markup grob splitStaffBarLineMarkup)
0 0))
\break
}
\paper {
ragged-right = ##t
short-indent = 5\mm
}
\score {
<<
\new ChoirStaff <<
\new Staff \with { instrumentName = #"High I + II" } {
<<
\repeat unfold 4 f''1
\\
\repeat unfold 4 d''1
>>
\splitStaffBarLine
}
\new Staff \with { instrumentName = #"Low" } {
<<
\repeat unfold 4 b'1
\\
\repeat unfold 4 g'1
>>
}
\new Staff \with { shortInstrumentName = #"H I" } {
R1*4
\repeat unfold 2 { r4 f''2 r4 } \repeat unfold 2 e''1
}
\new Staff \with { shortInstrumentName = #"H II" } {
R1*4
\repeat unfold 4 b'2 \repeat unfold 2 c''1
}
\new Staff \with { shortInstrumentName = #"L" } {
R1*4
<<
\repeat unfold 4 g'1
\\
\repeat unfold 4 c'1
>>
}
>>
>>
\layout {
\context {
\Staff \RemoveEmptyStaves
\override VerticalAxisGroup #'remove-first = ##t
}
}
}
Adjusting lyrics vertical spacing
This snippet shows how to bring the lyrics line closer to the staff.
% Default layout:
<<
\new Staff \new Voice = melody \relative c' {
c4 d e f
g4 f e d
c1
}
\new Lyrics \lyricsto melody { aa aa aa aa aa aa aa aa aa }
% Reducing the minimum space below the staff and above the lyrics:
\new Staff {
\new Voice = melody \relative c' {
c4 d e f
g4 f e d
c1
}
}
\new Lyrics \with {
\override VerticalAxisGroup #'inter-staff-spacing = #'((space . 1))
}
\lyricsto melody { aa aa aa aa aa aa aa aa aa }
>>
Ambitus with multiple voices
Adding the Ambitus_engraver
to the Staff
context creates
a single ambitus per staff, even in the case of staves with multiple
voices.
\new Staff \with {
\consists "Ambitus_engraver"
}
<<
\new Voice \relative c'' {
\voiceOne
c4 a d e
f1
}
\new Voice \relative c' {
\voiceTwo
es4 f g as
b1
}
>>
Ambitus
Ambitus indicate pitch ranges for voices.
Accidentals only show up if they are not part of the key signature.
AmbitusNoteHead
grobs also have ledger lines.
\layout {
\context {
\Voice
\consists "Ambitus_engraver"
}
}
<<
\new Staff {
\relative c' {
\time 2/4
c4 f'
}
}
\new Staff {
\relative c' {
\time 2/4
\key d \major
cis4 as'
}
}
>>
Changing stanza fonts
Fonts can be changed independently for each stanza, including the font
used for printing the stanza number.
\new Voice {
\time 3/4
g2 e4
a2 f4
g2.
}
\addlyrics {
\set stanza = #"1. "
Hi, my name is Bert.
}
\addlyrics {
\override StanzaNumber #'font-name = #"DejaVu"
\set stanza = #"2. "
\override LyricText #'font-family = #'typewriter
Oh, ché -- ri, je t'aime
}
Chant or psalms notation
This form of notation is used for the chant of the Psalms, where verses
aren’t always the same length.
stemOn = { \revert Staff.Stem #'transparent }
stemOff = { \override Staff.Stem #'transparent = ##t }
\score {
\new Staff \with { \remove "Time_signature_engraver" }
{
\key g \minor
\cadenzaOn
\stemOff a'\breve bes'4 g'4
\stemOn a'2 \bar "||"
\stemOff a'\breve g'4 a'4
\stemOn f'2 \bar "||"
\stemOff a'\breve^\markup { \italic flexe }
\stemOn g'2 \bar "||"
}
}
Forcing hyphens to be shown
If LilyPond does not think there is space for a hyphen, it will be
omitted. The behaviour can be overridden with the
minimum-distance
property of LyricHyphen
.
\relative c'' {
c32 c c c
c32 c c c
c32 c c c
c32 c c c
}
\addlyrics {
syl -- lab word word
\override LyricHyphen #'minimum-distance = #1.0
syl -- lab word word
\override LyricHyphen #'minimum-distance = #2.0
syl -- lab word word
\revert LyricHyphen #'minimum-distance
syl -- lab word word
}
Formatting lyrics syllables
To format individual syllables in lyrics, use \markup { ....
}
on these lyrics.
% Tip taken from http://lists.gnu.org/archive/html/lilypond-user/2007-12/msg00215.html
\header {
title = "Markup can be used inside lyrics!"
}
mel = \relative c'' { c4 c c c }
lyr = \lyricmode {
Lyrics \markup { \italic "can" } \markup {\with-color #red "contain" }
\markup {\fontsize #8 \bold "Markup!" }
}
<<
\context Voice = melody \mel
\context Lyrics \lyricsto melody \lyr
>>
How to put ties between syllables in lyrics
This can be achieved by separating those syllables by tildes.
\lyrics {
wa~o~a
}
Lyrics alignment
Horizontal alignment for lyrics cam be set by overriding the
self-alignment-X
property of the LyricText
object.
#-1
is left, #0
is center and #1
is right;
however, you can use #LEFT
, #CENTER
and #RIGHT
as
well.
\layout { ragged-right = ##f }
\relative c'' {
c1
c1
c1
}
\addlyrics {
\once \override LyricText #'self-alignment-X = #LEFT
"This is left-aligned"
\once \override LyricText #'self-alignment-X = #CENTER
"This is centered"
\once \override LyricText #'self-alignment-X = #1
"This is right-aligned"
}
Marking notes of spoken parts with a cross on the stem
This example shows how to put crosses on stems. Mark the beginning of
a spoken section with the \speakOn
keyword, and end it with the
\speakOff
keyword.
speakOn = {
\override Stem #'stencil = #(lambda (grob)
(let* ((x-parent (ly:grob-parent grob X))
(is-rest? (ly:grob? (ly:grob-object x-parent 'rest))))
(if is-rest?
empty-stencil
(ly:stencil-combine-at-edge
(ly:stem::print grob)
Y
(- (ly:grob-property grob 'direction))
(grob-interpret-markup grob
(markup #:hspace -1.025 #:fontsize -4
#:musicglyph "noteheads.s2cross"))
-2.3 0))))
}
speakOff = {
\revert Stem #'stencil
}
\score {
\new Staff {
\relative c'' {
a4 b a c
\speakOn
g4 f r g
b4 r d e
\speakOff
c4 a g f
}
}
}
Piano template with melody and lyrics
Here is a typical song format: one staff with the melody and lyrics,
with piano accompaniment underneath.
melody = \relative c'' {
\clef treble
\key c \major
\time 4/4
a b c d
}
text = \lyricmode {
Aaa Bee Cee Dee
}
upper = \relative c'' {
\clef treble
\key c \major
\time 4/4
a4 b c d
}
lower = \relative c {
\clef bass
\key c \major
\time 4/4
a2 c
}
\score {
<<
\new Voice = "mel" { \autoBeamOff \melody }
\new Lyrics \lyricsto mel \text
\new PianoStaff <<
\new Staff = "upper" \upper
\new Staff = "lower" \lower
>>
>>
\layout {
\context { \Staff \RemoveEmptyStaves }
}
\midi { }
}
Single staff template with notes lyrics and chords
This template allows the preparation of a song with melody, words, and
chords.
melody = \relative c' {
\clef treble
\key c \major
\time 4/4
a4 b c d
}
text = \lyricmode {
Aaa Bee Cee Dee
}
harmonies = \chordmode {
a2 c
}
\score {
<<
\new ChordNames {
\set chordChanges = ##t
\harmonies
}
\new Voice = "one" { \autoBeamOff \melody }
\new Lyrics \lyricsto "one" \text
>>
\layout { }
\midi { }
}
Single staff template with notes lyrics chords and frets
Here is a simple lead sheet template with melody, lyrics, chords and
fret diagrams.
verseI = \lyricmode {
\set stanza = #"1."
This is the first verse
}
verseII = \lyricmode {
\set stanza = #"2."
This is the second verse.
}
theChords = \chordmode {
% insert chords for chordnames and fretboards here
c2 g4 c
}
staffMelody = \relative c' {
\key c \major
\clef treble
% Type notes for melody here
c4 d8 e f4 g
\bar "|."
}
\score {
<<
\context ChordNames { \theChords }
\context FretBoards { \theChords }
\new Staff {
\context Voice = "voiceMelody" { \staffMelody }
}
\new Lyrics = "lyricsI" {
\lyricsto "voiceMelody" \verseI
}
\new Lyrics = "lyricsII" {
\lyricsto "voiceMelody" \verseII
}
>>
\layout { }
\midi { }
}
Single staff template with notes and lyrics
This small template demonstrates a simple melody with lyrics. Cut and
paste, add notes, then words for the lyrics. This example turns off
automatic beaming, which is common for vocal parts. To use automatic
beaming, change or comment out the relevant line.
melody = \relative c' {
\clef treble
\key c \major
\time 4/4
a4 b c d
}
text = \lyricmode {
Aaa Bee Cee Dee
}
\score{
<<
\new Voice = "one" {
\autoBeamOff
\melody
}
\new Lyrics \lyricsto "one" \text
>>
\layout { }
\midi { }
}
Skips in lyric mode (2)
Although s
skips cannot be used in \lyricmode
(it is
taken to be a literal “s”, not a space), double quotes (""
)
or underscores (_
) are available.So for example:
<<
\relative c'' { a4 b c d }
\new Lyrics \lyricmode { a4 "" _ gap }
>>
Skips in lyric mode
The s
syntax for skips is only available in note mode and chord
mode. In other situations, for example, when entering lyrics, using the
\skip
command is recommended.
<<
\relative c'' { a1 | a }
\new Lyrics \lyricmode { \skip 1 bla1 }
>>
Vertically aligning ossias and lyrics
This snippet demonstrates the use of the context properties
alignBelowContext
and alignAboveContext
to control the
positioning of lyrics and ossias.
\paper {
ragged-right = ##t
}
\relative c' <<
\new Staff = "1" { c4 c s2 }
\new Staff = "2" { c4 c s2 }
\new Staff = "3" { c4 c s2 }
{ \skip 2
<<
\lyrics {
\set alignBelowContext = #"1"
lyrics4 below
}
\new Staff \with {
alignAboveContext = #"3"
fontSize = #-2
\override StaffSymbol #'staff-space = #(magstep -2)
\remove "Time_signature_engraver"
} {
\times 4/6 {
\override TextScript #'padding = #3
c8[^"ossia above" d e d e f]
}
}
>>
}
>>
Vertically centered common lyrics
In a vocal piece where there are several (two,four or more) lines of
lyrics, and common lyrics for all voices at some point, these common
lyrics may be vertically centered regardingly, as shown in the
following example:
\include "english.ly"
leftbrace = \markup { \override #'(font-encoding . fetaBraces) \lookup #"brace240" }
rightbrace = \markup { \rotate #180 \leftbrace }
dropLyrics =
{
\override LyricText #'extra-offset = #'(0 . -5)
\override LyricHyphen #'extra-offset = #'(0 . -5)
\override LyricExtender #'extra-offset = #'(0 . -5)
}
raiseLyrics =
{
\revert LyricText #'extra-offset
\revert LyricHyphen #'extra-offset
\revert LyricExtender #'extra-offset
}
skipFour = \repeat unfold 4 { \skip 8 }
lyricsA = \lyricmode { The first verse has \dropLyrics the com -- mon
__ words \raiseLyrics used in all four. }
lyricsB = \lyricmode { In stan -- za two, \skipFour al -- so ap -- pear. }
lyricsC = \lyricmode { By the third verse, \skipFour are get -- ting dull. }
lyricsD = \lyricmode { Last stan -- za, and \skipFour get used once more. }
melody = \relative c' { c4 d e f g f e8( e f) d4 c e d c }
\score
{
<<
\new Voice = m \melody
\new Lyrics \lyricsto m \lyricsA
\new Lyrics \lyricsto m \lyricsB
\new Lyrics \lyricsto m \lyricsC
\new Lyrics \lyricsto m \lyricsD
>>
}
Vocal ensemble template with automatic piano reduction
This template adds an automatic piano reduction to the standard SATB
vocal score demonstrated in “Vocal ensemble template”. This
demonstrates one of the strengths of LilyPond – you can use a music
definition more than once. If any changes are made to the vocal notes
(say, tenorMusic
), then the changes will also apply to the piano
reduction.
global = {
\key c \major
\time 4/4
}
sopMusic = \relative c'' {
c4 c c8[( b)] c4
}
sopWords = \lyricmode {
hi hi hi hi
}
altoMusic = \relative c' {
e4 f d e
}
altoWords =\lyricmode {
ha ha ha ha
}
tenorMusic = \relative c' {
g4 a f g
}
tenorWords = \lyricmode {
hu hu hu hu
}
bassMusic = \relative c {
c4 c g c
}
bassWords = \lyricmode {
ho ho ho ho
}
\score {
<<
\new ChoirStaff <<
\new Lyrics = sopranos { s1 }
\new Staff = women <<
\new Voice = sopranos { \voiceOne << \global \sopMusic >> }
\new Voice = altos { \voiceTwo << \global \altoMusic >> }
>>
\new Lyrics = altos { s1 }
\new Lyrics = tenors { s1 }
\new Staff = men <<
\clef bass
\new Voice = tenors { \voiceOne <<\global \tenorMusic >> }
\new Voice = basses { \voiceTwo <<\global \bassMusic >> }
>>
\new Lyrics = basses { s1 }
\context Lyrics = sopranos \lyricsto sopranos \sopWords
\context Lyrics = altos \lyricsto altos \altoWords
\context Lyrics = tenors \lyricsto tenors \tenorWords
\context Lyrics = basses \lyricsto basses \bassWords
>>
\new PianoStaff <<
\new Staff <<
\set Staff.printPartCombineTexts = ##f
\partcombine
<< \global \sopMusic >>
<< \global \altoMusic >>
>>
\new Staff <<
\clef bass
\set Staff.printPartCombineTexts = ##f
\partcombine
<< \global \tenorMusic >>
<< \global \bassMusic >>
>>
>>
>>
\layout {
\context {
% a little smaller so lyrics
% can be closer to the staff
\Staff
\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
}
}
}
Vocal ensemble template with lyrics aligned below and above the staves
This template is basically the same as the simple “Vocal ensemble”
template, with the exception that here all the lyrics lines are placed
using alignAboveContext
and alignBelowContext
.
global = {
\key c \major
\time 4/4
}
sopMusic = \relative c'' {
c4 c c8[( b)] c4
}
sopWords = \lyricmode {
hi hi hi hi
}
altoMusic = \relative c' {
e4 f d e
}
altoWords = \lyricmode {
ha ha ha ha
}
tenorMusic = \relative c' {
g4 a f g
}
tenorWords = \lyricmode {
hu hu hu hu
}
bassMusic = \relative c {
c4 c g c
}
bassWords = \lyricmode {
ho ho ho ho
}
\score {
\new ChoirStaff <<
\new Staff = women <<
\new Voice = "sopranos" { \voiceOne << \global \sopMusic >> }
\new Voice = "altos" { \voiceTwo << \global \altoMusic >> }
>>
\new Lyrics \with { alignAboveContext = women } \lyricsto sopranos \sopWords
\new Lyrics \with { alignBelowContext = women } \lyricsto altos \altoWords
% we could remove the line about this with the line below, since we want
% the alto lyrics to be below the alto Voice anyway.
% \new Lyrics \lyricsto altos \altoWords
\new Staff = men <<
\clef bass
\new Voice = "tenors" { \voiceOne << \global \tenorMusic >> }
\new Voice = "basses" { \voiceTwo << \global \bassMusic >> }
>>
\new Lyrics \with { alignAboveContext = men } \lyricsto tenors \tenorWords
\new Lyrics \with { alignBelowContext = men } \lyricsto basses \bassWords
% again, we could replace the line above this with the line below.
% \new Lyrics \lyricsto basses \bassWords
>>
\layout {
\context {
% a little smaller so lyrics
% can be closer to the staff
\Staff
\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
}
}
}
Vocal ensemble template with verse and refrain
This template creates a score which starts with a solo verse and
continues into a refrain for two voices. It also demonstrates the
use of spacer rests within the \global
variable to define
meter changes (and other elements common to all parts) throughout
the entire score.
global = {
\key g \major
% verse
\time 3/4
s2.*2
\break
% refrain
\time 2/4
s2*2
\bar "|."
}
SoloNotes = \relative g' {
\clef "treble"
% verse
g4 g g |
b4 b b |
% refrain
R2*2 |
}
SoloLyrics = \lyricmode {
One two three |
four five six |
}
SopranoNotes = \relative c'' {
\clef "treble"
% verse
R2.*2 |
% refrain
c4 c |
g4 g |
}
SopranoLyrics = \lyricmode {
la la |
la la |
}
BassNotes = \relative c {
\clef "bass"
% verse
R2.*2 |
% refrain
c4 e |
d4 d |
}
BassLyrics = \lyricmode {
dum dum |
dum dum |
}
\score {
<<
\new Voice = "SoloVoice" << \global \SoloNotes >>
\new Lyrics \lyricsto "SoloVoice" \SoloLyrics
\new ChoirStaff <<
\new Voice = "SopranoVoice" << \global \SopranoNotes >>
\new Lyrics \lyricsto "SopranoVoice" \SopranoLyrics
\new Voice = "BassVoice" << \global \BassNotes >>
\new Lyrics \lyricsto "BassVoice" \BassLyrics
>>
>>
\layout {
ragged-right = ##t
\context { \Staff
% these lines prevent empty staves from being printed
\RemoveEmptyStaves
\override VerticalAxisGroup #'remove-first = ##t
}
}
}
Vocal ensemble template
Here is a standard four-part SATB vocal score. With larger ensembles,
it is often useful to include a section which is included in all parts.
For example, the time signature and key signature are almost always the
same for all parts. Like in the “Hymn” template, the four voices are
regrouped on only two staves.
global = {
\key c \major
\time 4/4
}
sopMusic = \relative c'' {
c4 c c8[( b)] c4
}
sopWords = \lyricmode {
hi hi hi hi
}
altoMusic = \relative c' {
e4 f d e
}
altoWords = \lyricmode {
ha ha ha ha
}
tenorMusic = \relative c' {
g4 a f g
}
tenorWords = \lyricmode {
hu hu hu hu
}
bassMusic = \relative c {
c4 c g c
}
bassWords = \lyricmode {
ho ho ho ho
}
\score {
\new ChoirStaff <<
\new Lyrics = sopranos { s1 }
\new Staff = women <<
\new Voice = "sopranos" {
\voiceOne
<< \global \sopMusic >>
}
\new Voice = "altos" {
\voiceTwo
<< \global \altoMusic >>
}
>>
\new Lyrics = "altos" { s1 }
\new Lyrics = "tenors" { s1 }
\new Staff = men <<
\clef bass
\new Voice = "tenors" {
\voiceOne
<< \global \tenorMusic >>
}
\new Voice = "basses" {
\voiceTwo << \global \bassMusic >>
}
>>
\new Lyrics = basses { s1 }
\context Lyrics = sopranos \lyricsto sopranos \sopWords
\context Lyrics = altos \lyricsto altos \altoWords
\context Lyrics = tenors \lyricsto tenors \tenorWords
\context Lyrics = basses \lyricsto basses \bassWords
>>
\layout {
\context {
% a little smaller so lyrics
% can be closer to the staff
\Staff
\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
}
}
}