Next: , Previous: Relative octaves, Up: Easier music entry



5.2.2 Octave check

Octave checks make octave errors easier to correct: a note may be followed by =quotes which indicates what its absolute octave should be. In the following example,

\relative c'' { c='' b=' d,='' }

the d will generate a warning, because a d'' is expected (because b' to d'' is only a third), but a d' is found. In the output, the octave is corrected to be a d'' and the next note is calculated relative to d'' instead of d'.

There is also a syntax that is separate from the notes. The syntax

\octave pitch

This checks that pitch (without quotes) yields pitch (with quotes) in \relative mode. If not, a warning is printed, and the octave is corrected.

In the example below, the first check passes without incident, since the e (in relative mode) is within a fifth of a'. However, the second check produces a warning, since the e is not within a fifth of b'. The warning message is printed, and the octave is adjusted so that the following notes are in the correct octave once again.

\relative c' {
  e
  \octave a'
  \octave b'
}

The octave of a note following an octave check is determined with respect to the note preceding it. In the next fragment, the last note is a a', above middle C. That means that the \octave check passes successfully, so the check could be deleted without changing the output of the piece.

     \relative c' {
       e
       \octave b
       a
     }

[image of music]

Read comments on this page, or add one.

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

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

Other languages: English.
Using automatic language selection.