|
|
GNU LilyPondWelcome to the home of the GNU Music Typesetter |
||||||||||
|
Node:Lyrics and chords, Next:More movements, Previous:The first real tune, Up:Tutorial Lyrics and chordsIn this section we show how to typeset a song. This file is
included as \header {
title = "The river is flowing"
composer = "Traditional"
}
\include "paper16.ly"
melody = \notes \relative c' {
\partial 8
\key c \minor
g8 |
c4 c8 d [es () d] c4 | f4 f8 g [es() d] c g |
c4 c8 d [es () d] c4 | d4 es8 d c4.
\bar "|."
}
text = \lyrics {
The ri -- ver is flo- __ wing, flo -- wing and gro -- wing, the
ri -- ver is flo -- wing down to the sea.
}
accompaniment =\chords {
r8
c2:3- f:3-.7 d:min es4 c8:min r8
c2:min f:min7 g:7^3.5 c:min }
\score {
\simultaneous {
%\accompaniment
\context ChordNames \accompaniment
\addlyrics
\context Staff = mel {
\property Staff.noAutoBeaming = ##t
\property Staff.automaticMelismata = ##t
\melody
}
\context Lyrics \text
}
\midi { \tempo 4=72 }
\paper { linewidth = 10.0\cm }
}
The result would look this.1 The river is flowing
Traditional
Again, we will dissect the file line by line.
\header {
Information about the music you are about to typeset goes into a
\header block. The information in this block is not used by
LilyPond, but it is passed into the output. ly2dvi uses this
information to print titles above the music.
title = "The river is flowing"
composer = "Traditional (?)"
the \header block contains assignments. In each assignment, a
variable is set to a value. Lexically, both the variable name and the
assigned value are strings. The values have to be quoted here, because
they contain spaces. The variable names could also be put within quotes
but it is not necessary.
\include "paper16.ly"
Smaller size for inclusion in a book.
melody = \notes \relative c' {
The structure of the file will be the same as the previous one, a
\score block with music in it. To keep things readable, we will
give names to the different parts of music, and use the names to
construct the music within the score block.
\partial 8 The piece starts with an anacrusis of one eighth. \key c \minorThe key is C minor: we have three flats.
c4 c8 d [es () d] c4 | f4 f8 g [es() d] c g |
c4 c8 d [es () d] c4 | d4 es8 d c4.
\bar "|."
We use explicit beaming. Since this is a song, we turn automatic beams off, and use explicit beaming where needed.
}
This ends the definition of melody.
text = \lyrics {
Another identifier assignment. This one is for the lyrics.
Lyrics are formed by syllables that have duration, and not by
notes. To make LilyPond parse words as syllables, switch it into
lyrics mode with \lyrics. Again, the brace after \lyrics
is a shorthand for \sequential {.
The4 ri -- ver is flo- __ wing, flo -- wing and gro -- wing, the ri- ver is flo- __ wing down to the sea. }The syllables themselves are separated by spaces. You can get syllable extenders by entering __, and centered hyphens with
--. We enter the syllables as if they are all quarter notes
in length (hence the 4), and use a feature to align the
syllables to the music, which obviously isn't all quarter notes.
accompaniment =\chords {
We'll put chords over the music. To enter them, there is a special mode
analogous to \lyrics and \notes mode, where you can give
the names of the chords you want, instead of listing the notes
comprising the chord.
r8
There is no accompaniment during the anacrusis.
c2:3- f:3-.7
A chord is started by the tonic of the chord. The
first one lasts a half note. An unadorned note creates a major
triad. Since a minor triad is wanted,
d:min es4 c8:min r8
Some modifiers have predefined names, e.g.
c2:min f:min7 g:7^3.5 c:min }
A named modifier
\score {
\simultaneous {
We assemble the music in the \score block. Melody, lyrics and
accompaniment have to sound at the same time, so they should be
\simultaneous.
%\accompaniment
Chord mode generates notes grouped in \simultaneous music. If
you remove the comment sign, you can see the chords in normal
notation: they will be printed as note heads on a separate
staff. To print them as chords names, they have to be interpreted as
being chords, not notes. This is done with the following command:
\context ChordNames \accompaniment
Normally, the notes that you enter are transformed into note heads. Note heads alone make no sense, they need surrounding information: a key signature, a clef, staff lines, etc. They need context. In LilyPond, these symbols are created by objects called `interpretation contexts'. Interpretation contexts exist for generating notation (`notation context') and for generating sound (`performance context'). These objects only exist during a run of LilyPond. By default, LilyPond will create a Staff context for you. If you would
remove the We don't want that default here, because we want chord names. The
command above explicitly creates an interpretation context of
\addlyrics
The lyrics should be aligned with the melody. This is done by
combining both with
\context Staff = mel {
The first argument of
\property Staff.noAutoBeaming = ##t
An interpretation context has variables, called properties, that tune
its behavior. One of the variables is noAutoBeaming. Setting
this Staff's property to ##t, which is the boolean value true,
turns the automatic beaming mechanism off for the current staff.
LilyPond internally uses GUILE, a Scheme-interpreter. Scheme is a
language from the LISP family. You can learn more about Scheme at
http://www.scheme.org. It is used to represent data throughout
the whole program. The hash-sign ( If Scheme scares you, don't worry. You don't need to know Scheme to create beautiful sheet music.
\property Staff.automaticMelismata = ##t
Similarly, we don't want to print a syllable when there is
a slur. This sets up \addlyrics to not put lyrics under each
separate note while there is a slur.
\melody
}
Finally, we put the melody on the current staff. Note that the
\property directives and \melody are grouped in sequential
music, so the property settings are done before the melody is
processed.
\context Lyrics \text
The second argument of \addlyrics is the text. The text also
should not land on a Staff, but on a interpretation context for
syllables, extenders, hyphens etc. This context is called
Lyrics.
\midi { \tempo 4=72}
MIDI (Musical Instrument Digital Interface) is a standard for
connecting and recording digital instruments. So a MIDI file is like a
tape recording of an instrument. The \midi block makes the
music go to a MIDI file, so you can listen to the music you entered. It
is great for checking the music. Whenever you hear something weird, you
probably hear a typing error.
Syntactically,
\paper { linewidth = 10.0\cm }
We also want notation output. The linewidth is short so the piece
will be set in two lines.
Footnotes
|
||||||||||
|
Go back to index of LilyPond.
Please send GNU LilyPond questions and comments to lilypond-user@gnu.org. Please send comments on these web pages to lilypond@packages.debian.org Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. |
|||||||||||
This page was built from LilyPond-1.4.12 (stable-branch) by