Node: Key signature, Next: , Previous: Staff symbol, Up: Staff notation



Key signature

The key signature indicates the scale in which a piece is played. It is denoted by a set of alterations (flats or sharps) at the start of the staff.

Syntax

Setting or changing the key signature is done with the \key command:

       \key pitch type
     

Here, type should be \major or \minor to get pitch-major or pitch-minor, respectively. The standard mode names \ionian, \locrian, \aeolian, \mixolydian, \lydian, \phrygian, and \dorian are also defined.

This command sets the context property Staff.keySignature. Non-standard key signatures can be specified by setting this property directly.

Accidentals and key signatures often confuse new users, because unaltered notes get natural signs depending on the keysignature. The tutorial explains why this is so in More about pitches.

Bugs

The ordering of a key cancellation is wrong when it is combined with repeat bar lines. The cancellation is also printed after a line break.

See also

KeyChangeEvent, and KeySignature.

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

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