[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

The full score

The second file, input/tutorial/os-score.ly, reads the definitions of the first (input/tutorial/os-music.ly), and defines the \score block for the full conductor's score.

     \version "1.7.6"
     
     \include "os-music.ly"
     \include "paper13.ly"
     
     #(ly:set-point-and-click 'line-column)
     textFlat = \markup {\smaller \musicglyph #"accidentals--1"}
     \score {
       <
         \global
         \property Score.BarNumber \override #'padding = #3
         \context StaffGroup = woodwind <
           \context Staff = flauti <
     	\property Staff.midiInstrument = #"flute"
     	\property Staff.instrument = "2 Flauti"
     	\property Staff.instr = "Fl."
             \Key
     	\context Voice=one { \voiceOne \flautoI }
     	\context Voice=two { \voiceTwo \flautoII }
           >
         >
         \context StaffGroup = timpani <
           \context Staff = timpani <
     	\property Staff.midiInstrument = #"timpani"
     	\property Staff.instrument = \markup { \column <<  "Timpani" "(C-G)" >> }
     	\property Staff.instr = #"Timp."
     	\clef bass
             \Key
     	\timpani
           >
         >
         \context StaffGroup = brass <
           \context Staff = trombe <
       	\property Staff.midiInstrument = #"trumpet"
     	\property Staff.instrument = \markup { \column << "2 Trombe" "(C)" >> }
     	\property Staff.instr = \markup{ \column << "Tbe." "(C)">> }
             \Key
     	\context Voice=one \partcombine Voice
     	  \context Thread=one \tromboI
     	  \context Thread=two \tromboII
           >
           \context Staff = corni <
             \property Staff.midiInstrument = #"french horn"
     	\property Staff.instrument
     	= \markup { \column << "Corno" { "(E"  \textFlat ")" } >> }
     	\property Staff.instr =
     	\markup { \column << "Cor." { "(E"  \textFlat ")" } >> }
     	\property Staff.transposing = #3
     	\notes \key bes \major
     	\context Voice=one \corno
           >
         >
       >
       \paper {
         indent = 15 * \staffspace
         linewidth = 60 * \staffspace
         textheight = 90 * \staffspace
         \translator{
           \VoiceContext
           \consists "Multi_measure_rest_engraver"
         }
         \translator{
           \HaraKiriStaffContext
           \remove "Multi_measure_rest_engraver"
         }
       }
       \midi {
         \tempo 4 = 75
       }
     }
     
Zo, goed lieverd?

How's, this babe?
Opus 1.
LAID BACK
[picture of music]



     \include "os-music.ly"
     
First we need to include the music definitions we made in os-music.ly.



     #(ly:set-point-and-click 'line-column)
     

This piece of Scheme code executes the function ly:set-point-and-click with the argument line-column. Editing input files can be complicated if you're working with large files: if you're digitizing existing music, you have to synchronize the .ly file, the sheet music on your lap and the sheet music on the screen. The point-and-click mechanism makes it easy to find the origin of an error in the LY file: when you view the file with Xdvi and click on a note, your editor will jump to the spot where that note was entered. For more information, see Point and click.



     #(define text-flat '((font-relative-size . -2)
              (music "accidentals--1")))
     

To name the transposition of the french horn, we will need a piece of text with a flat sign. LilyPond has a mechanism for font selection and kerning called Scheme markup text (See Text markup). The flat sign is taken from the music font, and its name is accidentals--1 (The natural sign is called accidentals-0). The default font is too big for text, so we select a relative size of -2.



       <
         \global
     
All staves are simultaneous and use the same global settings.



         \property Score.BarNumber \override #'padding = #3
     
LilyPond prints bar numbers at the start of each line, but unfortunately they end up a bit too close to the staff in this example. In LilyPond, a bar number is called BarNumber. BarNumber objects can be manipulated through their side-position-interface. One of the properties of a side-position-interface that can be tweaked is padding: the amount of extra space that is put between this and other objects. We set the padding to three staff spaces.

You can find information on all these kind of properties in LilyPond's automatically generated documentation in LilyPond Internals or in Fine tuning a piece.



         \context StaffGroup = woodwind <
           \context Staff = flauti <
     
A new notation context: the StaffGroup. StaffGroup can hold one or more Staff's, and will print a big bracket at the left of the score. This starts a new staff group for the woodwind section (just the flutes in this case). Immediately after that, we start the staff for the two flutes, who also play simultaneously.



             \property Staff.midiInstrument = #"flute"
     
Specify the instrument for MIDI output (see MIDI instrument names).



             \property Staff.instrument = "2 Flauti"
             \property Staff.instr = "Fl."
     
This defines the instrument names to be printed in the margin. instrument specifies the name for the first line of the score, instr is used for the rest of the score.



             \Key
     
The flutes play in the default key.



             \context Voice=one { \voiceOne \flautoI }
             \context Voice=two { \voiceTwo \flautoII }
     
Last come the actual flute parts. Remember that we're still in simultaneous mode. We name both voices differently, so that LilyPond will create two Voice contexts. The flute parts are simple, so we specify manually which voice is which: \voiceOne forces the direction of stems, beams, slurs and ties up, \voiceTwo sets directions down.



           >
         >
     
Close the flutes staff and woodwind staff group.



             \property Staff.instrument = #'(lines "Timpani" "(C-G)")
     
The timpani staff demonstrates a new piece of scheme markup, it sets two lines of text.



             \context Voice=one \partcombine Voice
               \context Thread=one \tromboI
               \context Thread=two \tromboII
     
You have seen the notation contexts Staff and Voice, but here's a new one: Thread. One or more Threads can be part of a Voice. Thread takes care of note heads and rests; Voice combine note heads onto a stem.

For the trumpets we use the automatic part combiner (see Automatic part combining) to combine the two simultaneous trumpet parts onto the trumpet staff. Each trumpet gets its own Thread context, which must be named one and two). The part combiner makes these two threads share a Voice when they're similar, and splits the threads up when they're different.



     \property Staff.instrument = #`(lines "Corno"
       (columns "(E" ,text-flat ")"))
     
The french horn ("Corno") has the most complex scheme markup name, made up of two lines of text. The second line has three elements (columns) - the (E, the flat sign text-flat that we defined previously, and a final ")". Note that we use a backquote instead of an ordinary quote at the beginning of the Scheme expression to be able to access the text-flat identifier, `unquoting' it with a ",".



             \property Staff.transposing = #3
     
The french horn is to be tuned in E-flat, so we tell the MIDI back-end to transpose this staff by three steps.

Note how we can choose different tunings for the text input, sheet music output and, and MIDI output, using \transpose and the MIDI Staff property transposing.



             \notes \key bes \major
     
Since the horn is transposing, it's in a different key.



         indent = 15 * \staffspace
         linewidth = 55 * \staffspace
     
We specify a big indent for the first line and a small linewidth for this tutorial.



Usually LilyPond's default setup of notation contexts (Thread, Voice, Staff, Staffgroup, Score) is just fine. But in this case we want a different type of Staff context.

         \translator{
           \HaraKiriStaffContext
         }
     

In orchestral scores it often happens that one instrument only has rests during one line of the score. HaraKiriStaffContext can be used as a regular StaffContext drop-in and will take care of the automatic removing of empty staves - so if the strings are the only instruments playing for a line, LilyPond will only print the string parts for that line of the score. This reduces the number of page turns (and the number of dead trees!) required in a score.

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.