Template:Key

This template formats and displays a key signature for all the major and minor keys up to seven sharps or seven flats. Major keys use upper-case letters; minor keys use lower-case letters. If the note pitch is flattened, the letter b follows the pitch name; if sharpened, the hash character # is used. These characters are formatted into the appropriate musical symbols.

The template also adds the page on which it is used to the Category corresponding to the key; e.g. {{Key|C}} adds the page to the corresponding category.

A second template, {{K}}, returns identical formatting but does not add a Category corresponding to the key.

An invalidly entered key will display an error message linking to this page.

Examples

  1. {{Key|C}} C major
  2. {{Key|d}} D minor
  3. {{Key|Eb}} E-flat major
  4. {{Key|F#}} → F-sharp major
  5. {{Key|bb}} B-flat minor
  6. {{Key|B#}} → Invalid key