3.4.5 Scores and parts

In orchestral music, all notes are printed twice. Once in a part for the musicians, and once in a full score for the conductor. Variables can be used to avoid double work. The music is entered once, and stored in a variable. The contents of that variable is then used to generate both the part and the full score.

It is convenient to define the notes in a special file. For example, suppose that the file ‘horn-music.ly’ contains the following part of a horn/bassoon duo

hornNotes = \relative c {
  \time 2/4
  r4 f8 a | cis4 f | e4 d |

Then, an individual part is made by putting the following in a file

\include "horn-music.ly"

\header {
  instrument = "Horn in F"

 \transpose f c' \hornNotes

The line

\include "horn-music.ly"

substitutes the contents of ‘horn-music.ly’ at this position in the file, so hornNotes is defined afterwards. The command \transpose f c' indicates that the argument, being \hornNotes, should be transposed by a fifth upwards. Sounding f is denoted by notated c', which corresponds with the tuning of a normal French Horn in F. The transposition can be seen in the following output

[image of music]

In ensemble pieces, one of the voices often does not play for many measures. This is denoted by a special rest, the multi-measure rest. It is entered with a capital R followed by a duration (1 for a whole note, 2 for a half note, etc.). By multiplying the duration, longer rests can be constructed. For example, this rest takes 3 measures in 2/4 time


When printing the part, multi-measure rests must be compressed. There is a music function available to do this:

\compressMMRests { ... }

Applying this to hornNotes gives:

[image of music]

The score is made by combining all of the music together. Assuming that the other voice is in bassoonNotes in the file ‘bassoon-music.ly’, a score is made with

\include "bassoon-music.ly"
\include "horn-music.ly"

  \new Staff \hornNotes
  \new Staff \bassoonNotes

leading to

[image of music]

See also

Learning Manual: Organizing pieces with variables.

Notation Reference: Transpose, Writing parts, Full measure rests, Including LilyPond files.

Other languages: català, česky, deutsch, español, français, magyar, italiano, 日本語, nederlands.
About automatic language selection.

LilyPond — Learning Manual v2.19.20 (development-branch).