Next: , Previous: Absolute octave entry, Up: Writing pitches


Relative octave entry

When octaves are specified in absolute mode it is easy to accidentally put a pitch in the wrong octave. Relative octave mode reduces these errors since most of the time it is not necessary to indicate any octaves at all. Furthermore, in absolute mode a single mistake may be difficult to spot, while in relative mode a single error puts the rest of the piece off by one octave.

\relative startpitch musicexpr

In relative mode, each note is assumed to be as close to the previous note as possible. This means that the octave of each pitch inside musicexpr is calculated as follows:

Here is the relative mode shown in action:

     
     \relative c {
       \clef bass
       c d e f
       g a b c
       d e f g
     }

[image of music]

Octave changing marks are used for intervals greater than a fourth:

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

[image of music]

A note sequence without a single octave mark can nevertheless span large intervals:

     
     \relative c {
       c f b e
       a d g c
     }

[image of music]

If the preceding item is a chord, the first note of the chord is used as the reference point for the octave placement of a following note or chord. Inside chords, the next note is always relative to the preceding one. Examine the next example carefully, paying attention to the c notes.

     
     \relative c' {
       c
       <c e g>
       <c' e g'>
       <c, e, g''>
     }

[image of music]

As explained above, the octave of pitches is calculated only with the note names, regardless of any alterations. Therefore, an E-double-sharp following a B will be placed higher, while an F-double-flat will be placed lower. In other words, a double-augmented fourth is considered a smaller interval than a double-diminished fifth, regardless of the number of semitones that each interval contains.

     
     \relative c'' {
       c2 fis
       c2 ges
       b2 eisis
       b2 feses
     }

[image of music]

See also

Music Glossary: fifth, interval, Pitch names.

Notation Reference: Octave checks.

Snippets: Pitches.

Internals Reference: RelativeOctaveMusic.

Known issues and warnings

The relative conversion will not affect \transpose, \chordmode or \relative sections in its argument. To use relative mode within transposed music, an additional \relative must be placed inside \transpose.

If no startpitch is specified for \relative, then c' is assumed. However, this is a deprecated option and may disappear in future versions, so its use is discouraged.

This page is for LilyPond-2.11.58 (development-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.

Your suggestions for the documentation are welcome.

Other languages: français, español, deutsch.