key [Class]

A class implementing abstract key signatures for output to event streams.

While key supports a wide range of key signatures, some output syntaxes impose restrictions on the range of keys that are representable. For instance, MIDI files can only encode major or minor key signatures from 7 flats to 7 sharps.

key is only useful when used in conjunction with *chromatic-scale*. This seems reasonable, though, since the concept of key signatures is associated with the standard "western" tone system.

Slots available in key:

tonic {note-class}
The tonic note class of the key. If unspecified, tonic is determined automatically for standard values of mode and accidentals.
mode {symbol}
The mode of the key. Though this can be any symbol, CM treats the following modes as standard: Major, Ionian, Dorian, Phrygian, Lydian, Mixolydian, Aolean, Minor, Locrian. If unspecified, mode is determined automatically for standard values of tonic and accidentals.
accidentals{number}
The number of sharps and flats in the key's signature. A positive integer indicates that number of sharps, a negative integer denotes flats. If unspecified, accidentals is determined automatically for standard values of tonic and mode.
signotes {list}
The explicit list of note classes that are sharp or flat in the key's signature. Use this to specify "non-standard" keys, for example keys that mix sharps and flats.

See Also:

key [Macro], note-class [Function], keyify-note [Function], unkeyify-note [Function], *chromatic-scale* [Variable], event-stream [Class], meter [Class]


Last Modified: 25-Jul-1998