Rameau: A System for Automatic Harmonic
Analysis
Pedro Kröger and Alexandre Passos
Genos—Computer Music Research Group
Federal University of Bahia, Brazil
1 How the system works
The input: LilyPond format
\score {
<<
\new Staff {
<< \new Voice { \voiceOne \relative c’’ { c4 b c2 }}
\new Voice { \voiceTwo \relative c’ { e4 d e2 }}
>> }
\new Staff {
<< \clef "bass"
\new Voice { \voiceOne \relative c’ { c4 b c2 }}
\new Voice { \voiceTwo \relative c { c4 g c2 }}
>> }
>>
}
The input: LilyPond format
4
3
The answer sheet format
For the previous example:
C G C
For the 1st phrase of Bach Chorale #1
{g
g c/e [b] d/f#
g bm/d bm7/d em
c [b d] [b] f#
◦
/a g
d g
d/f# em7/g f#
◦
/a
g/b am7/c d d7 g}
The output as a table
#
|answer |ES-tree|EC-Knn |ES-Knn |ES-PB
|S-PB
|
---1
|C
|C
|C
|C
|C
|C
|
2
|G
|G
|G
|G
|G
|G
|
3
|C
|C
|C
|C
|C
|C
|
---CORRECT(%) |100.00 |100.00 |100.00 |100.00 |100.00 |
Comparison of results
Timing the program
chorale #1 (80 segments) on my aging laptop:
14s for all 9 algorithms
0.2s for the fastest algorithm (neural network)
2 Problems
Pitch spelling
equal
not equal
Pitch class notation
C=0, C]=1, D=2, D]=3, . . . , B=11
(or MIDI: 60, 62, 64 . . . )
problem:
C]
=
D[
A codification for tonal music (Dr. Jamary Oliveira)
c
d
e
f
g
a
b
7[
7
21
62
76
6[
90
8
22
35
49
63
77
5[
91
9
23
36
50
64
78
4[
92
10
24
37
51
65
79
3[
93
11
25
38
52
66
80
2[
94
12
26
39
53
67
81
[
95
13
27
40
54
68
82
\
0
14
28
41
55
69
83
]
1
15
29
42
56
70
84
2]
2
16
30
43
57
71
85
3]
3
17
31
44
58
72
86
4]
4
18
32
45
59
73
87
5]
5
19
33
46
60
74
88
6]
6
20
34
47
61
75
89
7]
48
C=0, D=14, F]=42, A[[=67
Segmentation (easy case)
splitting the piece into chord spans
Segmentation (not easy)
Chord labeling
Labeling each chord with a name
Eb
Eb
B°7
D°7
Functional Analysis
Assigning tonal functions to the chords
F F C/E F/Eb Bb/D
I I V V /IV IV
42 6 6
3 The analysis per se
The process is:
Each algorithm
converts the list of pitches into chords
Pardo and Birmingham’s algorithm
straight template-matching
0
4
=
⇒
Major
7
0
3
=
⇒
Minor
7
And so on. . . (but we did extend it to have enough labels and be
enharmonically savvy)
Temperley and Sleator’s algorithm
maximizing something over the piece
Too slow.
Naïve Bayesian algorithm
the chord that gives the highest probability to each sonority
Hidden Markov Model (Raphael)
Bayesian, but also maximizes the probability of the entire piece in a Markov Model
As you can see, it’s the only one that can tell that a transition from Bm to D and then to Em is too unlikely.