[icon]

GNU LilyPond

-- --

What is LilyPond
Home
Examples
Templates
Download
GNU/Linux binaries
Windows binaries
Source code
Documentation
Tutorial
Manual
Glossary
Index

Support
Mailing lists
Search
WikiWiki

External sites
lilypond.org/stable
lilypond.org/development
savannah.gnu.org
ftp.lilypond.org
Mutopia
Other music online

More movements

The program lilypond only produces sheet music and does not create titles, subtitles, or print the composer's name. To do that, you need to use ly2dvi, which comes with LilyPond. ly2dvi creates the title, then calls lilypond to format the sheet music. In this section, we show you how to create titles like this:

Two miniatures
Opus 1.
Up
[picture of music]
Opus 2.
Down
[picture of music]

For example, consider the following file (miniatures.ly)

     \version "1.5.72"
     \header {
       title = "Two miniatures"
       composer = "F. Bar Baz"
       tagline = "small is beautiful" }
     
     \paper { linewidth = -1.0 }
     
     %{
     
     Mental note: discuss Schenkerian analysis of these key pieces.
     
     %}
     
     \score {
         \notes { c'4 d'4 }
         \header {
             opus = "Opus 1."
             piece = "Up" }
     }
     \score {
         \notes { d'4 c'4 }
         \header {
             opus = "Opus 2."
             piece = "Down" }
     }
     

The information for the global titling is in a so-called header block. The information in this block is not used by LilyPond, but it is passed into ly2dvi, which uses this information to print titles above the music. the \header block contains assignments. In each assignment, a variable is set to a value. The header block for this file looks like this

       \header {
         title = "Two miniatures"
         composer = "F. Bar Baz"
         tagline = "small is beautiful"
       }
     

When you process a file with ly2dvi, a signature line is printed at the bottom of the last page. This signature is produced from the tagline field of \header. The default "Lily was here, version number" is convenient for programmers: archiving the layouts of different versions allows programmers to compare the versions using old print-outs.

Many people find the default tagline ("Lily was here") too droll. If that is the case, you can change tagline to something else, as shown above.



       \paper {
         linewidth = -1.0 }
     

A paper block at top level (i.e. not in a \score block) sets the default page layout. The following \score blocks don't have \paper sections, so the settings of this block are used.

The variable linewidth normally sets the length of the systems on the page. However, a negative value has a special meaning. If linewidth is less than 0, no line breaks are inserted into the score, and the spacing is set to natural length: a short phrase takes up little space, a longer phrase takes more space, all on the same line.

     %{
     
     Mental note: discuss Schenkerian analysis of these key pieces.
     
     %}
     

Mental notes to yourself can be put into comments. There are two types of comments. Line comments are introduced by %, and block comments are delimited by %{ and %}.



       \score {
         \notes { c'4 d'4 }
     

In previous examples, most notes were specified in relative octaves (i.e. each note was put in the octave that is closest to its predecessor). Besides relative, there is also absolute octave specification, which you get when you don't include \relative in your input file. In this input mode, the middle C is denoted by c'. Going down, you get c c, c,, etc. Going up, you get c'' c''' etc.

When you're copying music from existing sheet music, relative octaves are probably the easiest to use: you have to do less typing, and errors are easily spotted. However, if you write LilyPond input directly, either by hand (i.e. composing) or by computer, absolute octaves may be easier to use.



         \header {
     

The \header is normally at the top of the file, where it sets values for the rest of the file. If you want to typeset different pieces from one file (for example, if there are multiple movements, or if you're making an exercise book), you can put different \score blocks into the input file. ly2dvi will assemble all LilyPond output files into a big document. The contents of \header blocks specified within each score is used for the title of that movement.



             opus = "Opus 1."
             piece = "Up" }
     
For example, the Opus number is put at the right, and the "piece" string will be at the left.
     \version "1.5.72"
     \header {
       title = "Two miniatures"
       composer = "F. Bar Baz"
       tagline = "small is beautiful" }
     
     \paper { linewidth = -1.0 }
     
     \score {
         \notes { c'4 d'4 }
         \header {
             opus = "Opus 1."
             piece = "Up" }
     }
     \score {
         \notes { d'4 c'4 }
         \header {
             opus = "Opus 2."
             piece = "Down" }
     }
     

TODO:

     
     scoreA = \score { \deelA  }
     scoreB = \score { \deelA  }
     
     % \score { \scoreA }
     \score { \scoreB }
     
     



     \version "1.5.72"
     
Lilypond and its language are still under development, and occasionally details of the syntax are changed. The version fragment indicates which version of lilypond the input file was written for. When you compile this file, the version number will be checked and you will get a warning when the file is too old. This version number is also used by the convert-ly program (See Invoking convert-ly), which can used to update the file to the latest lily version.
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 (address unknown)

Copyright (c) 1997--2002 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.7.14 (development-branch) by

Buchan Milne <(address unknown)>, Thu Mar 6 21:11:35 2003 CET.