LilyPond Notation Reference: 2.7.2 Displaying chords

### 2.7.2 Displaying chords

Chords can be displayed by name, in addition to the standard display as notes on a staff.

#### Printing chord names

Chord names are printed in the `ChordNames` context:

>     \new ChordNames {
>       \chordmode {
>         c2 f4. g8
>       }
>     }

Chords can be entered as simultaneous notes or through the use of chord mode. The displayed chord name will be the same, regardless of the mode of entry, unless there are inversions or added bass notes:

>     chordmusic = \relative {
>       <c' e g>2 <f bes c>
>       <f c' e g>1
>       \chordmode {
>         c2 f:sus4 c1:/f
>       }
>     }
>     <<
>       \new ChordNames {
>         \chordmusic
>       }
>       {
>         \chordmusic
>       }
>     >>

Rests passed to a `ChordNames` context will cause the `noChordSymbol` markup to be displayed.

>     <<
>       \new ChordNames \chordmode {
>         c1
>         r1
>         g1
>         c1
>       }
>       \chordmode {
>         c1
>         r1
>         g1
>         c1
>       }
>     >>

`\chords { … }` is a shortcut notation for `\new ChordNames \chordmode { … }`.

>     \chords {
>       c2 f4.:m g8:maj7
>     }

>     \new ChordNames {
>       \chordmode {
>         c2 f4.:m g8:maj7
>       }
>     }

#### Selected Snippets

Showing chords at changes

By default, every chord entered is printed; this behavior can be modified so that chord names are printed only at the start of lines and when the chord changes.

>     harmonies = \chordmode {
>       c1:m c:m \break c:m c:m d
>     }

>     <<
>       \new ChordNames {
>         \set chordChanges = ##t
>         \harmonies
>       }
>       \new Staff {
>         \relative c' { \harmonies }
>       }
>     >>

Simple lead sheet

When put together, chord names, a melody, and lyrics form a lead sheet:

>     <<
>       \chords { c2 g:sus4 f e }
>       \new Staff \relative c'' {
>         a4 e c8 e r4
>         b2 c4( d)
>       }
>       \addlyrics { One day this shall be free __ }
>     >>

#### See also

Music Glossary: chord.

Notation Reference: Writing music in parallel.

Snippets: Chords.

Internals Reference: ChordNames, ChordName, Chord_name_engraver, Volta_engraver, Bar_engraver.

#### Known issues and warnings

Chords containing inversions or altered bass notes are not named properly if entered using simultaneous music.

#### Customizing chord names

There is no unique system for naming chords. Different musical traditions use different names for the same set of chords. There are also different symbols displayed for a given chord name. The names and symbols displayed for chord names are customizable.

The basic chord name layout is a system for Jazz music, proposed by Klaus Ignatzek (see Literature list). (Other chord naming systems may be implemented through Scheme functions, as demonstrated by the “Chord names alternative” snippet in Chords.) A list of common jazz chords notations may be found on the chart in Chord name chart.

The default naming system may be tweaked easily in a number of ways. To begin with, predefined commands allow to use different languages for the root pitch. These include `\germanChords`, `\semiGermanChords`, `\italianChords` and `\frenchChords`:

German songbooks may indicate minor chords as lowercase letters, without any m suffix. This can be obtained by setting the `chordNameLowercaseMinor` property:

>     \chords {
>       \set chordNameLowercaseMinor = ##t
>       c2 d:m e:m f
>     }

The chord name display can also be tuned through the following properties.

`chordRootNamer`

  The chord name is usually printed as a letter for the root with an optional alteration. The transformation from pitch to letter is done by this function. Special note names (for example, the German ‘H’ for a B-chord) can be produced by storing a new function in this property.

`majorSevenSymbol`

  This property contains the markup object used to follow the output of `chordRootNamer` to identify a major 7 chord. Predefined options are `whiteTriangleMarkup` and `blackTriangleMarkup`.

`additionalPitchPrefix`

  When the chord name contains additional pitches, they can optionally be prefixed with some text. The default is no prefix, in order to avoid too much visual clutter, but for small numbers of additional pitches this can be visually effective.

  >     \new ChordNames {
  >       <c e g d'>    % add9
  >       \set additionalPitchPrefix = "add"
  >       <c e g d'>    % add9
  >     }

`chordNoteNamer`

  When the chord name contains additional pitches other than the root (e.g., an added bass note), this function is used to print the additional pitch. By default the pitch is printed using `chordRootNamer`. The `chordNoteNamer` property can be set to a specialized function to change this behavior. For example, the bass note can be printed in lower case.

`chordNameSeparator`

  Different parts of a chord name are normally separated by a small amount of horizontal space. By setting `chordNameSeparator`, you can use any desired markup for a separator. This does not affect the separator between a chord and its bass note; to customize that, use `slashChordSeparator`.

  >     \chords {
  >       c4:7.9- c:7.9-/g
  >       \set chordNameSeparator = \markup { "/" }
  >       \break
  >       c4:7.9- c:7.9-/g
  >     }

`slashChordSeparator`

  Chords can be played over a bass note other than the conventional root of the chord. These are known as “inversions” or “slash chords”, because the default way of notating them is with a forward slash between the main chord and the bass note. Therefore the value of `slashChordSeparator` defaults to a forward slash, but you can change it to any markup you choose.

  >     \chords {
  >       c4:7.9- c:7.9-/g
  >       \set slashChordSeparator = \markup { " over " }
  >       \break
  >       c4:7.9- c:7.9-/g
  >     }

`chordNameExceptions`

  This property is a list of pairs. The first item in each pair is a set of pitches used to identify the steps present in the chord. The second item is a markup that will follow the `chordRootNamer` output to create the chord name.

`minorChordModifier`

  Minor chords are often denoted via a ‘m’ suffix to the right of the root of the chord. However some idioms prefer other suffices, such as a minus sign.

  >     \chords {
  >       c4:min f:min7
  >       \set minorChordModifier = \markup { "-" }
  >       \break
  >       c4:min f:min7
  >     }

`chordPrefixSpacer`

  The modifier for minor chords as determined by `minorChordModifier` is usually printed immediately to the right of the root of the chord. A spacer can be placed between the root and the modifier by setting `chordPrefixSpacer`. The spacer is not used when the root is altered.

#### Predefined commands

`\whiteTriangleMarkup`, `\blackTriangleMarkup`, `\germanChords`, `\semiGermanChords`, `\italianChords`, `\frenchChords`.

#### Selected Snippets

Chord name exceptions

The property `chordNameExceptions` can be used to store a list of special notations for specific chords.

>     % modify maj9 and 6(add9)
>     % Exception music is chords with markups
>     chExceptionMusic = {
>       <c e g b d'>1-\markup { \super "maj9" }
>       <c e g a d'>1-\markup { \super "6(add9)" }
>     }

>     % Convert music to list and prepend to existing exceptions.
>     chExceptions = #(append
>       (sequential-music-to-chord-exceptions chExceptionMusic #t)
>       ignatzekExceptions)

>     theMusic = \chordmode {
>       g1:maj9 g1:6.9
>       \set chordNameExceptions = #chExceptions
>       g1:maj9 g1:6.9
>     }

>     \layout {
>       ragged-right = ##t
>     }

>     <<
>        \new ChordNames \theMusic
>        \new Voice \theMusic
>     >>

chord name major7

The layout of the major 7 can be tuned with `majorSevenSymbol`.

>     \chords {
>       c:7+
>       \set majorSevenSymbol = \markup { j7 }
>       c:7+
>     }

Adding bar lines to ChordNames context

To add bar line indications in the `ChordNames` context, add the `Bar_engraver`.

>     \new ChordNames \with {
>       \override BarLine.bar-extent = #'(-2 . 2)
>       \consists "Bar_engraver"
>     }

>     \chordmode {
>       f1:maj7 f:7 bes:7
>     }

Volta below chords

By adding the `Volta_engraver` to the relevant staff, volte can be put under chords.

>     \score {
>       <<
>         \chords {
>           c1
>           c1
>         }
>         \new Staff \with {
>           \consists "Volta_engraver"
>         }
>         {
>           \repeat volta 2 { c'1 }
>           \alternative { c' }
>         }
>       >>
>       \layout {
>         \context {
>           \Score
>           \remove "Volta_engraver"
>         }
>       }
>     }

Changing chord separator

The separator between different parts of a chord name can be set to any markup.

>     \chords {
>       c:7sus4
>       \set chordNameSeparator
>         = \markup { \typewriter | }
>       c:7sus4
>     }

#### See also

Notation Reference: Chord name chart, Common chord modifiers.

Essay on automated music engraving: Literature list.

Installed Files: ‘`scm/chords-ignatzek-names.scm`’, ‘`scm/chord-entry.scm`’, ‘`ly/chord-modifiers-init.ly`’.

Snippets: Chords.

#### Known issues and warnings

Chord names are determined from both the pitches that are present in the chord and the information on the chord structure that may have been entered in `\chordmode`. If the simultaneous pitches method of entering chords is used, undesired names result from inversions or bass notes.

>     myChords = \relative c' {
>       \chordmode { c1 c/g c/f }
>       <c e g>1 <g c e> <f c' e g>
>     }
>     <<
>       \new ChordNames { \myChords }
>       \new Staff { \myChords }
>     >>

#### LilyPond — Notation Reference v2.22.2 (stable-branch).