key [-af] [inputfile ...]
The input may be either
The program adapts to input having varying
numbers spines each with a different interpretation.
Output consists of three items of information:
The algorithm is based on Krumhansl's perceptually-based key-finding method
This method compares a given pitch-class
frequency profile with two perceptually-determined prototypes
(one each for major and minor modes).
The coefficients used for these prototypes are those
Krumhansl & Kessler (1982).
In order for the algorithm to work properly, durational information
ought to be provided.
format input, best results are achieved when
the input has a
The key command is poor at distinguishing less common enharmonic keys. For example, it is unable to distinguish the following enharmonic spellings for tonic pitches: C-flat, B-sharp, E-sharp, F-flat. Also, key is unable to distinguish enharmonic spellings involving double- or triple- sharps or flats. That is, G double-sharp major is identified as A major. KEY is able to distinguish the more common enharmonic spellings (such as E-flat versus D-sharp).
There is no special output file-type designation.
Options are specified in the command line.
-a output correlation values for all keys -f output frequencies for all pitch-classes -h displays a help screen summarizing the command syntax
The -a option will show all of the correlation coefficients for all 24 of the (enharmonic) major and minor keys.
The -f option will output the relative frequencies for each of the twelve chromatic pitch classes (in quarter-note durations).
Estimated key: B minor (r=0.8442) confidence: 51.3%
With both the
options invoked, a typical output is given below.
option causes 12 pitch-class tallies to be outputted.
These values are given in acculumated whole-note durations.
For example, the output: "PC: 4.25" means that the
enharmonic pitch-class "F" appears in the passage for the
equivalent of 4 whole-notes plus a quarter-note duration.
If inputs do not include durational information (such as in
input), each note is assigned the nominal duration of a quarter-note.
The -a option causes the tonic major and minor correlations to be printed for each pitch-class. Good key matches have a high positive correlation; the maximum value is 1.0.
PC: 5.50617 PC: 0.375 PC: 6.1875 PC: 0 PC: 5.625 PC: 4.25 PC: 1.25 PC: 5.6875 PC: 0.5 PC: 4.625 PC: 0.625 PC: 4.40625 Tonic major 0.791744 minor 0.0962456 Tonic major -0.747033 minor -0.337397 Tonic major 0.506935 minor 0.535771 Tonic major -0.404982 minor -0.720203 Tonic major 0.0308014 minor 0.64007 Tonic major 0.475928 minor -0.13113 Tonic major -0.735928 minor -0.157988 Tonic major 0.772586 minor 0.205276 Tonic major -0.574103 minor -0.487743 Tonic major 0.232566 minor 0.66303 Tonic major -0.014411 minor -0.625767 Tonic major -0.334105 minor 0.319835 Estimated key: C major (r=0.7917) confidence: 5.7%
In the above sample output, notice that the confidence score for the predicted key of C major (Tonic) is quite low. The reason for this is that the correlation coefficient for A minor (Tonic) is rather close to that for C major (0.791744 versus 0.66303) Note that confidence scores may be used as a simple index for estimating the tonal ambiguity or degree of chromaticism for a passage.
**kern (2), kern (4), **semits (2), semits (4), timebase (4)
**kerninterpretations. If no recognizable interpretation is given in the input stream, key assumes
**kerncompatible input. This may lead to erroneous results.
Krumhansl, C. L. & Kessler, E. J. "Tracing the dynamic changes in perceived tonal organization in a spatial representation of musical keys," Psychological Review, Vol. 89 (1982) pp.334-368.