Next: , Up: Alternate music entry


6.2.1 Relative octaves

Octaves are specified by adding ' and , to pitch names. When you copy existing music, it is easy to accidentally put a pitch in the wrong octave and hard to find such an error. The relative octave mode prevents these errors by making the mistakes much larger: a single error puts the rest of the piece off by one octave

\relative startpitch musicexpr

or

\relative musicexpr

The octave of notes that appear in musicexpr are calculated as follows: if no octave changing marks are used, the basic interval between this and the last note is always taken to be a fourth or less. This distance is determined without regarding alterations; a fisis following a ceses will be put above the ceses. In other words, a doubly-augmented fourth is considered a smaller interval than a diminshed fifth, even though the fourth is seven semitones while the fifth is only six semitones.

The octave changing marks ' and , can be added to raise or lower the pitch by an extra octave. Upon entering relative mode, an absolute starting pitch can be specified that will act as the predecessor of the first note of musicexpr. If no starting pitch is specified, then middle C is used as a start.

Here is the relative mode shown in action

     \relative c'' {
       b c d c b c bes a
     }

[image of music]

Octave changing marks are used for intervals greater than a fourth

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

[image of music]

If the preceding item is a chord, the first note of the chord is used to determine the first note of the next chord

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

[image of music]

The pitch after the \relative contains a note name.

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

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

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

Other languages: English.
Using automatic language selection.