1.1.1 Writing pitches

This section discusses how to input pitches. There are two different ways to place notes in octaves: absolute and relative mode. In most cases, relative mode will be more convenient.


Absolute octave entry

A pitch name is specified using lowercase letters a through g. The note names c to b are engraved in the octave below middle C.

{
  \clef bass
  c4 d e f
  g4 a b c
  d4 e f g
}

[image of music]

Other octaves may be specified with a single quote (') or comma (,) character. Each ' raises the pitch by one octave; each , lowers the pitch by an octave.

{
  \clef treble
  c'4 c'' e' g
  d''4 d' d c
  \clef bass
  c,4 c,, e, g
  d,,4 d, d c
}

[image of music]

See also

Music Glossary: Pitch names.

Snippets: 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]

When \relative blocks are nested, the innermost \relative block applies.

\relative c' {
  c d e f
  \relative c'' {
    c d e f
  }
}

[image of music]

\relative has no effect on \chordmode blocks.

\new Staff {
  \relative c''' {
    \chordmode { c1 }
  }
  \chordmode { c1 }
}

[image of music]

\relative is not allowed inside of \chordmode blocks.

Music inside a \transpose block is absolute unless a \relative is included.

\relative c' {
  d e
  \transpose f g {
    d e
    \relative c' {
      d e
    }
  }
}

[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]

One consequence of these rules is that the first note inside \relative f music is interpreted just the same as if it was written in absolute pitch mode.

See also

Music Glossary: fifth, interval, Pitch names.

Notation Reference: Octave checks.

Snippets: Pitches.

Internals Reference: RelativeOctaveMusic.

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.


Accidentals

Note: New users are sometimes confused about accidentals and key signatures. In LilyPond, note names are the raw input; key signatures and clefs determine how this raw input is displayed. An unaltered note like c means ‘C natural’, regardless of the key signature or clef. For more information, see Accidentals and key signatures.

A sharp pitch is made by adding is to the note name, and a flat pitch by adding es. As you might expect, a double sharp or double flat is made by adding isis or eses. This syntax is derived from Dutch note naming conventions. To use other names for accidentals, see Note names in other languages.

ais1 aes aisis aeses

[image of music]

A natural will cancel the effect of an accidental or key signature. However, naturals are not encoded into the note name syntax with a suffix; a natural pitch is shown as a simple note name:

a4 aes a2

[image of music]

Quarter tones may be added; the following is a series of Cs with increasing pitches:

ceseh1 ces ceh c cih cis cisih

[image of music]

Normally accidentals are printed automatically, but you may also print them manually. A reminder accidental can be forced by adding an exclamation mark ! after the pitch. A cautionary accidental (i.e., an accidental within parentheses) can be obtained by adding the question mark ? after the pitch. These extra accidentals can also be used to produce natural signs.

cis cis cis! cis? c c c! c?

[image of music]

Accidentals on tied notes are only printed at the beginning of a new system:

cis1~ cis~
\break
cis

[image of music]

Selected Snippets

Hiding accidentals on tied notes at the start of a new system

This shows how to hide accidentals on tied notes at the start of a new system.

\relative c'' {
  \override Accidental #'hide-tied-accidental-after-break = ##t
  cis1~ cis~
  \break
  cis
}

[image of music]

Preventing extra naturals from being automatically added

In accordance with standard typesetting rules, a natural sign is printed before a sharp or flat if a previous accidental on the same note needs to be canceled. To change this behavior, set the extraNatural property to f in the Staff context.

\relative c'' {
  aeses4 aes ais a
  \set Staff.extraNatural = ##f
  aeses4 aes ais a
}

[image of music]

See also

Music Glossary: sharp, flat, double sharp, double flat, Pitch names, quarter tone.

Learning Manual: Accidentals and key signatures.

Notation Reference: Automatic accidentals, Annotational accidentals (musica ficta), Note names in other languages.

Snippets: Pitches.

Internals Reference: Accidental_engraver, Accidental, AccidentalCautionary, accidental-interface.

Known issues and warnings

There are no generally accepted standards for denoting quarter-tone accidentals, so LilyPond’s symbol does not conform to any standard.


Note names in other languages

There are predefined sets of note and accidental names for various other languages. Selecting the note name language is usually done at the beginning of the file; the following example is written using Italian note names:

\language "italiano"

\relative do' {
  do re mi sib
}

[image of music]

The available languages and the note names they define are:

Language

Note Names

nederlands

c d e f g a bes b

catalan

do re mi fa sol la sib si

deutsch

c d e f g a b h

english

c d e f g a bf b

espanol

do re mi fa sol la sib si

italiano

do re mi fa sol la sib si

norsk

c d e f g a b h

portugues

do re mi fa sol la sib si

suomi

c d e f g a b h

svenska

c d e f g a b h

vlaams

do re mi fa sol la sib si

In addition to note names, accidental suffixes may also vary depending on the language:

Language

sharp

flat

double sharp

double flat

nederlands

-is

-es

-isis

-eses

catalan

-d/-s

-b

-dd/-ss

-bb

deutsch

-is

-es

-isis

-eses

english

-s/-sharp

-f/-flat

-ss/-x/-sharpsharp

-ff/-flatflat

espanol

-s

-b

-ss/-x

-bb

italiano

-d

-b

-dd

-bb

norsk

-iss/-is

-ess/-es

-ississ/-isis

-essess/-eses

portugues

-s

-b

-ss

-bb

suomi

-is

-es

-isis

-eses

svenska

-iss

-ess

-ississ

-essess

vlaams

-k

-b

-kk

-bb

In Dutch, aes is contracted to as, but both forms are accepted in LilyPond. Similarly, both es and ees are accepted. This also applies to aeses / ases and eeses / eses. Sometimes only these contracted names are defined in the corresponding language files.

a2 as e es a ases e eses

[image of music]

Some music uses microtones whose alterations are fractions of a ‘normal’ sharp or flat. The following table lists note names for quarter-tone accidentals in various languages; here the prefixes semi- and sesqui- respectively mean ‘half’ and ‘one and a half’. Languages that do not appear in this table do not provide special note names yet.

Language

semi-sharp

semi-flat

sesqui-sharp

sesqui-flat

nederlands

-ih

-eh

-isih

-eseh

deutsch

-ih

-eh

-isih

-eseh

english

-qs

-qf

-tqs

-tqf

espanol

-cs

-cb

-tcs

-tcb

italiano

-sd

-sb

-dsd

-bsb

portugues

-sqt

-bqt

-stqt

-btqt

Most languages presented here are commonly associated with Western classical music, also referred to as Common Practice Period. However, alternate pitches and tuning systems are also supported: see Common notation for non-Western music.

See also

Music Glossary: Pitch names, Common Practice Period.

Notation Reference: Common notation for non-Western music.

Installed Files: ‘scm/define-note-names.scm’.

Snippets: Pitches.


Other languages: deutsch, español, français, italiano, 日本語.
About automatic language selection.

LilyPond — Notation Reference

inserted by FC2 system