A description key signature encoding in **kern data.

Key signatures

Key signatures are represented by interpretations in the form *k[X], where X is a list of the accidentals in the order in which they are displayed in the key signature. Here a scale in C-sharp major and C-flat major, showing all of the accidentals in their proper order:

Key designation

The key of the music is different from the key signature. Indicate the key of the music by adding an interpretation in this form *X:, where X is a pitch name plus possible accidental, with lower-case pitch names indicating minor keys, and upper-case pitch names indicating major keys. For example, *C: means C major, and *a: means A minor (note that both have the key signature *k[] where there are no sharps or flats).

The key designation typical follows the key signature, or can appear on its own if the key changes but the key signature does not.

Note that the music in the last measure does not have a key signature change even though the music modulates to C-sharp minor.

The following codes can be appended to the key designation to indicate a particular mode:

code meaning example
dor dorian *d:dor
phr phrygian *e:phr
lyd lydian *F:lyd
mix mixolydian *G:mix
aeo aeolian *a:aeo
ion ionian *C:ion
loc locrian *b:loc

If the mode is closest to a minor key, then a lower-case letter will be used for the tonic note; otherwise, modes closer to major use an upper-case for the tonic.

Key signature cancellation

When changing to a new key signature, there are two styles: either with cancellation of accidentals in the previous key signature when necessary, or by just displaying the new key signature without cancellations, which is more typical of modern notation.

Regardless of which style, when moving to a key signature which has no sharps or flats, cancellation accidentals are required, otherwise the new key siganture is not visible in the music notation:

By default, cancellation signatures will not be used when switching between key signatures that contain accidentals:

By adding *kcancel to a **kern spine, cancellation accidentals will be added to the key signatures that follow in the spine:

Adding the tandem interpretation *Xkcancel will revert to the default style of no cancellations:

Editorial accidentals in key signature

Place an X after an accidental in the key signature string to place the accident in square brackets:

Non-standard key signatures

The ordering of the accidentals in the key-signature string control the order in the key signature. Here is an example of such a case:

Modern/original key signatures

When encoding a modern or diplomatic score, the modori filter can be used to switch the key signatures between the two encoding types. When encoding a diplomatic score, use the *k[] format for the original key signature, and *mk[] for the modern key signature (if they are different). Likewise, when encoding a modernized version of a score, use *k[] for the modern key signature format, and *ok[] for the original key signature.

Here is an example diplomatic score:

Applying the modori filter to display the modern score:

Notice that after compiling the modori filter in VHV, the modern key signature uses *k[] and the original is moved to *ok[]: