Next: , Previous: Automatic and manual beams, Up: Tutorial



2.6 Octave entry

To raise a note by an octave, add a high quote ' (apostrophe) to the note name, to lower a note one octave, add a `low quote' , (comma). Middle C is c'

     c'4 c'' c''' \clef bass c c,

[image of music]

An example of the use of quotes is in the following Mozart fragment

     \key a \major
     \time 6/8
     cis''8. d''16 cis''8 e''4 e''8
     b'8. cis''16 b'8 d''4 d''8

[image of music]

This example shows that music in a high register needs lots of quotes. This makes the input less readable, and it is a source of errors. The solution is to use `relative octave' mode. This is the most convenient way to copy existing music.

In relative mode, a note without octavation quotes (i.e. the ' or , after a note) is chosen so that it is closest to the previous one. For example, c f goes up while c g goes down.

To use relative mode, add \relative before the piece of music. The first note is taken relative to the middle C (i.e., c')

     \relative {
       c' f c g c
     }

[image of music]

Since most music has small intervals, pieces can be written almost without octavation quotes in relative mode. The previous example is entered as

     \relative {
       \key a \major
       \time 6/8
       cis'8. d16 cis8 e4 e8
       b8. cis16 b8 d4 d8
     }

[image of music]

Larger intervals are made by adding octavation quotes.

     \relative c {
       c'' f, f c' c g' c,
     }

[image of music]

In summary, quotes or commas no longer determine the absolute height of a note in \relative mode. Rather, the height of a note is relative to the previous one, and changing the octave of a single note shifts all following notes an octave up or down.

For more information on relative octaves see Relative octaves, and Octave check.

This page is for LilyPond-2.6.3 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.

Other languages: English.
Using automatic language selection.