Key Scape

Make your own keyscape from a music file (MusicXML, ABC, or MIDI)

The picture below shows a keyscape of Petzold's Minuet in G major. It is a table in pyramid shape where each row represents an analysis of the complete music file. Time goes from left to right and is measured in quarter beats (indicated below the picture). Each cell shows a key analysis of a time window around the cell. The window width is shown to the left of the row (in quarter beats, it is the same for each cell in a row). The shading of a cell represents the confidence in the key (dark shades indicate low confidence). When two keys are close together on the line of fifth their colors are close together in rainbow order.

analysis width (per cell, in quarter beats)
48.0G
41.5G G G G G G
35.8G G G G G G G G G G G
31.0G G G G G G G G G G G G G G G G
26.8G G G G G G G G G G G G G G G G G G G G
23.1G G G G G G G G G G G G G G G G G G G G G G G
20.0G G G G G G G G G G G G G G G G G G G G G G G G G G
17.3G G G G G G G G G G G G G G G G G G G G G G G G G G G G
14.9G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G
12.9G G G G G G G G G G G G D D G G G G G G G G G G G G G C G G G G
11.1G G G G G G G G G G G G D D G G G G G G G G G G G G G C G G G G G G
9.6G G G G G G C G G G G G G D G G G D G G G G G G G G C C C G G G G G G
8.3G G G G G G C G G G G G G G G G G D D G G G G G G G C C C C G G G G G G
7.2G G G G G G C C G G G G G G G G G D D D G G G G G G C C C C G G G AmG G G
6.2G G G G G G C C C G G G G G G G G D D D D G G G C G C C C C G G G AmAmG G G
5.4G G G G EmEmC C C G G AmG G G G G D D D D D G G G G C C C C G G G G AmG G G G
4.6G G G G C EmC G C G AmAmG G G G G D D D AmD G G G G C C C C G G G AmAmG G G G
4.0G G BmG EmEmC G C G AmAmAmG G G G D D D AmAmG G G G C C C C G G G AmG G G G G G
3.5G G BmG G C C C G G AmAmAmG G G G D D D D AmG G G G C C C C G G AmAmG G G D G G
3.0G G BmBmEmEmC C G G AmAmAmAmG G G D D A D A BmBmG G C C C C G G AmAmG G G D D G G
2.6G G BmBmEmEmC C G G BmAmAmAmG G G G D AmAmA BmBmG G C C C C G G AmAmAmG G AmD G G
2.2G G BmBmEmEmC C C BmBmAmAmAmG G G G D D AmA BmBmG G C C C C G G AmAmAmG G AmD G G G
112233546
101 notes, 48.0 quarter beats, horizontal cell spacing: 1.1 quarter beats (file: ../windy/werk/bachAnnamin.abc)

The top row has only one cell. Its window covers the complete music file (48 quarter notes). The cells in the rows beneath the top, have a slowly decreasing window width, resulting in a more detailed view of local keys in the music. Each row still covers the complete music file.
The bottom row has 42 cells. The time distance between two cells therefore is: 48 quarter notes / 42 cells = 1.1 quarter note. The window width (of each cell in the bottom row) is twice the time spacing between the cells: 2 * 1.1 = 2.2 (shown left of the bottom row).

The key analysis follows a method proposed by C.L. Krumhansl. The idea of the key scape is due to C.S. Sapp and described in this paper.

Chord Analysis

Make your own chordal analysis of a music file (MusicXML, ABC, or MIDI)

The chordal analysis computes an optimal assignment of jazz chord labels to areas of notes. Each chord label gets a score representing how well the chord matches the notes in the labeled area. The areas are chosen in such a way that the sum of the scores of all chord labels is maximal. (trying all possible areas with all possible chord labels). The algorithm is described by Pardo and Birmingham in: Algorithms for chordal analysis.

In the output (shown below) note areas are called chord segments (each segment is a row in the figure, there are 19 segments in this Menuet).
The time column shows the number of quarter notes passed at the start of a segment. The time is shown as a fractional number. For instance, at time 25 1/2 we see chord Bdom7 in the illustration. The means that the segment Bdom7 starts 25 quaters and 1 eight note after the start of the music. This is at the 1/8 A in measure 9 (right hand).

File: bachAnnamin.abc, ticks per quarternote: 384
72 note groups, 19 chord segments
Key: G , confidence: 10%
Time
Chord
Score
KeyScape
Pitch classes
0000
Gmaj
100%
G
Zw
Zw
Zw
Zw
Zw
G4,B4,D5,G5,D6
0001 1/2
Bhdim
38%
D
G
Zw
Zw
Zw
Zw
G4,A4,B4,D5,A5,B5,C6
0003
Gmaj
100%
G
G
G
Zw
Zw
Zw
B4,G5,D6
0006
F#hdim
70%
C
G
G
Zw
Zw
Zw
C5,C6,D6,E6,F#6
0009
Gmaj
83%
G
Am
G
G
Zw
Zw
B4,G5,G6
0012
Ddom7
70%
Am
G
G
G
Zw
Zw
A4,A5,B5,C6,D6
0015
Gmaj
60%
G
G
G
G
Zw
Zw
G4,B4,D5,F#5,G5,A5,B5,C6
0021
Ddom7
70%
Am
G
G
G
Zw
Zw
D4,A4,B4,C5,D5,A5
0024
Gmaj
100%
Bm
Am
G
G
G
Zw
B4,G5,D6
0025 1/2
Bdom7
50%
Am
Bm
D
G
G
Zw
A4,B4,A5,B5
0026 1/2
Amin
50%
G
G
G
G
G
Zw
A4,C6
0027
Gmaj
100%
G
C
C
G
Zw
Zw
G4,B4,G5,D6
0029
Cmaj
80%
C
C
C
G
Zw
Zw
G4,C5,G5,C6,D6,E6
0032 1/2
F#dim
50%
G
C
G
G
Zw
Zw
C5,F#6
0033
Ahdim
58%
G
G
G
G
Zw
Zw
G4,A4,B4,C5,G5,C6,G6
0037
Ddom7
75%
D
G
G
Zw
Zw
Zw
F#4,A4,A5,B5,C6,D6
0039
Gmaj
50%
G
G
G
Zw
Zw
Zw
G4,B4,G5,A5,B5,C6
0042
Amin
50%
Am
G
Zw
Zw
Zw
Zw
C5,A5
0043
Gmaj
67%
G
Zw
Zw
Zw
Zw
Zw
G3,D4,G4,D5,F#5,G5,A5,B5
Minuet in G Major (BWV Anhang 114) Piano  Gmaj Bhdim Gmaj F#hdim Gmaj Ddom7  6 Gmaj Ddom7 Gmaj Bdom7 Amin Gmaj Cmaj F#dim  12 Ahdim Ddom7 Gmaj Amin Gmaj

The score column shows how well a chord label matches all notes in the segment. A score of 100% means that every note in the segment matches the chord label. The pitch classes in each segment are shown in the last column. Note that one pitch class can represent multiple notes (e.g. the pitch classes of C D D C C are C D). The score of the first segment in the figure is 100% because all pitch classes (G, B, D) are explained by the chord label Gmaj.

To approximate a correct spelling of the chord labels (e.g. C#7 or Db7) in the analysis, the overall key of the music is determined with a method originally proposed by C.L. Krumhansl and R.N. Shepard (in: pdf). The method uses the overall pitch class histogram to match the best key. Depending on the distance of the best matching key to the next best match a confidence percetage is calculated.