These snippets illustrate the Notation Reference, section Vocal music.
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 } >>
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 \with { \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 4) } \new Voice = melody \relative c' { c4 d e f g4 f e d c1 } \new Lyrics \with { \override VerticalAxisGroup #'minimum-Y-extent = #'(-1.2 . 1) } \lyricsto melody { aa aa aa aa aa aa aa aa aa } >>
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" }
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 } >>
This form of notation is used for the chant of the Psalms, where verses aren't always the same length.
stemOn = { \override Staff.Stem #'transparent = ##f } stemOff = { \override Staff.Stem #'transparent = ##t } \score { \new Staff \with { \remove "Time_signature_engraver" } { \key g \minor \set Score.timing = ##f \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 "||" } }
Problem: How to know which midiInstrument
would be best for your
composition? Solution: A LilyPond demo file.
\header { title = "Demo of all midi sounds" arranger = "Myself " } basemelodie = \relative c' { c4. \mf g c16 b' c d e16 d e f g4 g'4 r R1 } melodie = { \tempo 4 = 150 \basemelodie } \score { \new Staff << \new Voice { \melodie } >> \layout { } } \score { \new Staff << %\set Staff.instrumentName= #"S/A" %\set Staff.midiMinimumVolume = #0.2 %\set Staff.midiMaximumVolume = #0.4 %\set Voice.dynamicAbsoluteVolumeFunction = #0.6 \new Voice { r \mf \set Staff.midiInstrument = #"acoustic grand" \melodie \set Staff.midiInstrument = #"bright acoustic" \melodie \set Staff.midiInstrument = #"electric grand" \melodie \set Staff.midiInstrument = #"honky-tonk" \melodie \set Staff.midiInstrument = #"electric piano 1" \melodie \set Staff.midiInstrument = #"electric piano 2" \melodie \set Staff.midiInstrument = #"harpsichord" \melodie \set Staff.midiInstrument = #"clav" \melodie \set Staff.midiInstrument = #"celesta" \melodie \set Staff.midiInstrument = #"glockenspiel" \melodie \set Staff.midiInstrument = #"music box" \melodie \set Staff.midiInstrument = #"vibraphone" \melodie \set Staff.midiInstrument = #"marimba" \melodie \set Staff.midiInstrument = #"xylophone" \melodie \set Staff.midiInstrument = #"tubular bells" \melodie \set Staff.midiInstrument = #"dulcimer" \melodie \set Staff.midiInstrument = #"drawbar organ" \melodie \set Staff.midiInstrument = #"percussive organ" \melodie \set Staff.midiInstrument = #"rock organ" \melodie \set Staff.midiInstrument = #"church organ" \melodie \set Staff.midiInstrument = #"reed organ" \melodie \set Staff.midiInstrument = #"accordion" \melodie \set Staff.midiInstrument = #"harmonica" \melodie \set Staff.midiInstrument = #"concertina" \melodie \set Staff.midiInstrument = #"acoustic guitar (nylon)" \melodie \set Staff.midiInstrument = #"acoustic guitar (steel)" \melodie \set Staff.midiInstrument = #"electric guitar (jazz)" \melodie \set Staff.midiInstrument = #"electric guitar (clean)" \melodie \set Staff.midiInstrument = #"electric guitar (muted)" \melodie \set Staff.midiInstrument = #"overdriven guitar" \melodie \set Staff.midiInstrument = #"distorted guitar" \melodie \set Staff.midiInstrument = #"acoustic bass" \melodie \set Staff.midiInstrument = #"electric bass (finger)" \melodie \set Staff.midiInstrument = #"electric bass (pick)" \melodie \set Staff.midiInstrument = #"fretless bass" \melodie \set Staff.midiInstrument = #"slap bass 1" \melodie \set Staff.midiInstrument = #"slap bass 2" \melodie \set Staff.midiInstrument = #"synth bass 1" \melodie \set Staff.midiInstrument = #"synth bass 2" \melodie \set Staff.midiInstrument = #"violin" \melodie \set Staff.midiInstrument = #"viola" \melodie \set Staff.midiInstrument = #"cello" \melodie \set Staff.midiInstrument = #"contrabass" \melodie \set Staff.midiInstrument = #"tremolo strings" \melodie \set Staff.midiInstrument = #"pizzicato strings" \melodie \set Staff.midiInstrument = #"orchestral strings" \melodie \set Staff.midiInstrument = #"timpani" \melodie \set Staff.midiInstrument = #"string ensemble 1" \melodie \set Staff.midiInstrument = #"string ensemble 2" \melodie \set Staff.midiInstrument = #"synthstrings 1" \melodie \set Staff.midiInstrument = #"synthstrings 2" \melodie \set Staff.midiInstrument = #"choir aahs" \melodie \set Staff.midiInstrument = #"voice oohs" \melodie \set Staff.midiInstrument = #"synth voice" \melodie \set Staff.midiInstrument = #"orchestra hit" \melodie \set Staff.midiInstrument = #"trumpet" \melodie \set Staff.midiInstrument = #"trombone" \melodie \set Staff.midiInstrument = #"tuba" \melodie \set Staff.midiInstrument = #"muted trumpet" \melodie \set Staff.midiInstrument = #"french horn" \melodie \set Staff.midiInstrument = #"brass section" \melodie \set Staff.midiInstrument = #"synthbrass 1" \melodie \set Staff.midiInstrument = #"synthbrass 2" \melodie \set Staff.midiInstrument = #"soprano sax" \melodie \set Staff.midiInstrument = #"alto sax" \melodie \set Staff.midiInstrument = #"tenor sax" \melodie \set Staff.midiInstrument = #"baritone sax" \melodie \set Staff.midiInstrument = #"oboe" \melodie \set Staff.midiInstrument = #"english horn" \melodie \set Staff.midiInstrument = #"bassoon" \melodie \set Staff.midiInstrument = #"clarinet" \melodie \set Staff.midiInstrument = #"piccolo" \melodie \set Staff.midiInstrument = #"flute" \melodie \set Staff.midiInstrument = #"recorder" \melodie \set Staff.midiInstrument = #"pan flute" \melodie \set Staff.midiInstrument = #"blown bottle" \melodie \set Staff.midiInstrument = #"shakuhachi" \melodie \set Staff.midiInstrument = #"whistle" \melodie \set Staff.midiInstrument = #"ocarina" \melodie \set Staff.midiInstrument = #"lead 1 (square)" \melodie \set Staff.midiInstrument = #"lead 2 (sawtooth)" \melodie \set Staff.midiInstrument = #"lead 3 (calliope)" \melodie \set Staff.midiInstrument = #"lead 4 (chiff)" \melodie \set Staff.midiInstrument = #"lead 5 (charang)" \melodie \set Staff.midiInstrument = #"lead 6 (voice)" \melodie \set Staff.midiInstrument = #"lead 7 (fifths)" \melodie \set Staff.midiInstrument = #"lead 8 (bass+lead)" \melodie \set Staff.midiInstrument = #"pad 1 (new age)" \melodie \set Staff.midiInstrument = #"pad 2 (warm)" \melodie \set Staff.midiInstrument = #"pad 3 (polysynth)" \melodie \set Staff.midiInstrument = #"pad 4 (choir)" \melodie \set Staff.midiInstrument = #"pad 5 (bowed)" \melodie \set Staff.midiInstrument = #"pad 6 (metallic)" \melodie \set Staff.midiInstrument = #"pad 7 (halo)" \melodie \set Staff.midiInstrument = #"pad 8 (sweep)" \melodie \set Staff.midiInstrument = #"fx 1 (rain)" \melodie \set Staff.midiInstrument = #"fx 2 (soundtrack)" \melodie \set Staff.midiInstrument = #"fx 3 (crystal)" \melodie \set Staff.midiInstrument = #"fx 4 (atmosphere)" \melodie \set Staff.midiInstrument = #"fx 5 (brightness)" \melodie \set Staff.midiInstrument = #"fx 6 (goblins)" \melodie \set Staff.midiInstrument = #"fx 7 (echoes)" \melodie \set Staff.midiInstrument = #"fx 8 (sci-fi)" \melodie \set Staff.midiInstrument = #"sitar" \melodie \set Staff.midiInstrument = #"banjo" \melodie \set Staff.midiInstrument = #"shamisen" \melodie \set Staff.midiInstrument = #"koto" \melodie \set Staff.midiInstrument = #"kalimba" \melodie \set Staff.midiInstrument = #"bagpipe" \melodie \set Staff.midiInstrument = #"fiddle" \melodie \set Staff.midiInstrument = #"shanai" \melodie \set Staff.midiInstrument = #"tinkle bell" \melodie \set Staff.midiInstrument = #"agogo" \melodie \set Staff.midiInstrument = #"steel drums" \melodie \set Staff.midiInstrument = #"woodblock" \melodie \set Staff.midiInstrument = #"taiko drum" \melodie \set Staff.midiInstrument = #"melodic tom" \melodie \set Staff.midiInstrument = #"synth drum" \melodie \set Staff.midiInstrument = #"reverse cymbal" \melodie \set Staff.midiInstrument = #"guitar fret noise" \melodie \set Staff.midiInstrument = #"breath noise" \melodie \set Staff.midiInstrument = #"seashore" \melodie \set Staff.midiInstrument = #"bird tweet" \melodie \set Staff.midiInstrument = #"telephone ring" \melodie \set Staff.midiInstrument = #"helicopter" \melodie \set Staff.midiInstrument = #"applause" \melodie \set Staff.midiInstrument = #"gunshot" \melodie } >> \midi { } }
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 >>
This can be achieved by separating those syllables by tildes.
\lyrics { wa~o~a }
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 { \RemoveEmptyStaffContext } } \midi { } }
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 { } }
Here is a simple lead sheet template with melody, lyrics, chords and fret diagrams.
% Define the fret diagrams to be used cFretDiagram = \markup { \fret-diagram #"6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;" } gFretDiagram = \markup { \fret-diagram #"6-3-2;5-2-1;4-o;3-o;2-o;1-3-3;" } verseI = \lyricmode { \set stanza = #"1." This is the first verse } verseII = \lyricmode { \set stanza = #"2." This is the second verse. } theChords = \new ChordNames { \chordmode { % insert the chords for chordnames here c2 g4 c } } staffMelody = \new Staff { \context Voice = "voiceMelody" { \key c \major \clef treble \relative c' { % Type notes and fret diagram markups here c4^\cFretDiagram d8 e f4^\gFretDiagram g^\cFretDiagram \bar "|." } } } \score { << \theChords \staffMelody \new Lyrics = "lyricsI" \lyricmode { \lyricsto "voiceMelody" \verseI } \new Lyrics = "lyricsII" \lyricmode { \lyricsto "voiceMelody" \verseII } >> \layout { } \midi { } }
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 { } }
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 } >>
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 { a'1 a } \new Lyrics \lyricmode { \skip 1 bla1 } >>
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 } } >> } >>
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 >> }
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) } } }
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) } } }
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) } } }
This page is for LilyPond-2.11.58 (development-branch).
Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.
Your suggestions for the documentation are welcome.