Professional Documents
Culture Documents
... Adventure
The Problem
Consider the following melody, a fragment of a simplification of a well known song by a great composer, represented
in Cloy:
C1 / F3 / A1 / C3 \ F1 / Z1 / D1 / F1 \ D1 \ C3 \ A1
/ Z1 \ G1 R1 / Z1 \ A1 \ F1 R1 / A1 \ G1 G1 / B1 B1 / C3
To start the investigation of key via Krumhansl’s algorithm in MxM, we encode the melodic fragment in the key of
C major, since presumably we don’t know its key. Here is the Clay code:
Of course, we should verify that our code actually generates the melody. In the following demo you can see that I
changed the Cloy output mode to “text” and then ran the program to generate the melodic fragment:
Meta> -RENDER
TYPE OF NOTE = Text
Clay> TUNE
C1 / F3 / A1 / C3 \ F1 / Z1 / D1 / F1 \ D1 \ C3 \ A1
/ Z1 \ G1 R1 / Z1 \ A1 \ F1 R1 / A1 \ G1 G1 / B1 B1 / C3
We will ask MxM to run Krumhansel’s key finding algorithm. In the demo, I do so twice. Once without the relevant
trace flag set. Once with it set. In each case, I launch the algorithm by means of the “statistics” button.
Meta> -STATS
Performing the Krumhansl Key Finding Algorithm ...
F major
Clay> .TRACE.KKFA.ON
Meta> -STATS
Performing the Krumhansl Key Finding Algorithm ...
pprofile ...
C10.0 C#0.0 D2.0 Eb0.0 E0.0 F6.0 F#0.0 G3.0 Ab0.0 A4.0 Bb3.0 B2.0
F major
Anaysis
The piece is in the key of F major. The key and the four runners up: F major > C major > A minor > C minor >
F minor.