[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

External sites
lilypond.org/development
lilypond.org/stable
ftp.lilypond.org
Mutopia
Other music online

Node:Printing named chords, Previous:Chords mode, Up:Chords



Printing named chords

For displaying printed chord names, use the ChordNames context. The chords may be entered either using the notation described above, or directly using simultaneous music.

scheme = \notes {
  \chords {a1 b c} <d f g>  <e g b>
}
\score {
  \notes<
    \context ChordNames \scheme
    \context Staff \transpose c'' \scheme
  >
}

[picture of music]

You can make the chord changes stand out by setting ChordNames.chordChanges to true. This will only display chord names when there's a change in the chords scheme and at the start of a new line.

scheme = \chords {
  c1:m c:m \break c:m c:m d
}
\score {
  \notes <
    \context ChordNames {
        \property ChordNames.chordChanges = ##t
        \scheme }
    \context Staff \transpose c'' \scheme
  > }

[picture of music]

LilyPond examines chords specified as lists of notes to determine a name to give the chord. LilyPond will not try to identify chord inversions or an added bass note, which may result in strange chord names when chords are entered as a list of pitches:

scheme = \notes {
  <c'1 e' g'>
  <e' g' c''>
  <e e' g' c''>
}

\score {
  <
    \context ChordNames \scheme
    \context Staff \scheme
  >
}

[picture of music]

By default, a chord name system proposed by Harald Banter (See Literature) is used. The system is very regular and predictable. Typical American style chord names may be selected by setting the style property of the ChordNames.ChordName grob to 'american. Similarly 'jazz selects Jazz chordnames.

Routines that determine the names to be printed are written in Scheme, and may be customized by the user. The code can be found in scm/chord-name.scm. Here's an example showing the differences in chord name styles:

scheme = \chords {
  c1 c:5^3 c:4^3 c:5+
  c:m7+ c:m5-.7
  c:5-.7 c:5+.7
  c:9^7
}

\score {
  \notes <
    \context ChordNames = banter \scheme
    \context ChordNames = american {
      \property ChordNames.ChordName \override
        #'style = #'american \scheme }
    \context ChordNames = jazz {
      \property ChordNames.ChordName \override
        #'style = #'jazz \scheme }
    \context Staff \transpose c'' \scheme
  >
}

[picture of music]

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to lilypond@packages.debian.org

Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.