3
|
1 |
### Chordal Analysis
|
|
2 |
|
|
3 |
*xmlChordAna* is a python script that makes a chordal analysis of a MusicXML file.
|
4
|
4 |
|
5
|
5 |
An [interactive demo][1] is avaiable on the
|
|
6 |
[Chord Analysis][1] page. It runs the script on
|
4
|
7 |
my server and formats the output in some neat html.
|
|
8 |
|
|
9 |
At the command line *xmlChordAna* is used as follows:
|
3
|
10 |
|
|
11 |
> ./xmlChordAna.py scorefile.xml
|
|
12 |
|
4
|
13 |
The output is printed in plain text looks like this:
|
3
|
14 |
|
|
15 |
File: bwv539p_arr.xml, ticks per quarternote: 384
|
|
16 |
342 note groups, 102 chord segments
|
|
17 |
Key: Am, confidence: 33%
|
|
18 |
---- chord Dmin, score: 90%
|
|
19 |
0 D3, D4, F4, A4
|
|
20 |
2 D3, F4, A4, D5
|
|
21 |
2 1/2 F4, A4, D5, D3
|
|
22 |
3 F4, A4, D5, C#3
|
|
23 |
3 1/2 F4, A4, D5, D3
|
|
24 |
---- chord Ehdim, score: 75%
|
|
25 |
4 D5, E3, E4, G4
|
|
26 |
---- chord C#hdim, score: 92%
|
|
27 |
5 E3, E4, G4, C#5
|
|
28 |
5 1/2 E3, E4, G4, B4
|
|
29 |
6 E3, E4, G4, C#5
|
|
30 |
6 1/2 E4, G4, C#5, E3
|
|
31 |
7 E4, G4, C#5, D3
|
|
32 |
7 1/2 E4, G4, C#5, E3
|
5
|
33 |
...
|
3
|
34 |
|
4
|
35 |
See [this explanation](https://wim.vree.org/keys09/uitleg.html) for more info.
|
|
36 |
|
|
37 |
### KeyScape
|
3
|
38 |
|
4
|
39 |
On the [KeyScape](../keys09) page you can find two other interactive demos. One makes
|
|
40 |
a *keyscape* from a MIDI file. The other runs the same chordal analysis as *xmlChordAna*,
|
|
41 |
but for a MIDI file. There is no download page (yet) for these programs.
|
|
42 |
|
5
|
43 |
### Base-40 note numbers
|
3
|
44 |
|
5
|
45 |
*xml2b40* is a python script to convert a MusicXML file to a list of base-40 events.
|
3
|
46 |
It is invoked from the command line as follows:
|
|
47 |
|
|
48 |
> ./xml2b40.py -t 384 scorefile.xml
|
|
49 |
|
|
50 |
and produces the following output:
|
|
51 |
|
|
52 |
0 129
|
|
53 |
0 169
|
|
54 |
0 180
|
|
55 |
0 192
|
|
56 |
768 -192
|
|
57 |
768 -169
|
|
58 |
768 192
|
|
59 |
768 209
|
|
60 |
960 -129
|
|
61 |
960 129
|
|
62 |
1152 -129
|
|
63 |
1152 124
|
|
64 |
1344 -124
|
|
65 |
1344 129
|
|
66 |
1536 -192
|
|
67 |
1536 -180
|
|
68 |
...
|
|
69 |
|
5
|
70 |
Each line contains two numbers: the time and a base-40 note.
|
|
71 |
The time is in ticks, where a quarter note is 384 ticks. The base-40 note number is positive
|
|
72 |
when the note starts sounding and negative when the note stops sounding.
|
|
73 |
|
|
74 |
The base-40 note number system encodes 40 pitches in an octave.
|
|
75 |
It is maps all single and double accidentals.
|
|
76 |
For instance, the first 10 numbers are:
|
4
|
77 |
|
5
|
78 |
1: Cbb
|
|
79 |
2: Cb
|
|
80 |
3: C
|
|
81 |
4: C#
|
|
82 |
5: C##
|
|
83 |
6: not used
|
|
84 |
7: Dbb
|
|
85 |
8: Db
|
|
86 |
9: D
|
|
87 |
10: D#
|
|
88 |
|
|
89 |
Base-40 numbers allow precise matching of chord patterns. For instance, chord pattern
|
|
90 |
C7 only matches
|
|
91 |
C-E-Bb and not C-E-A# or C-Fb-Bb or B#-E-Bb etc.
|
|
92 |
|
|
93 |
The idea of base-40 note numbers is due to B. Hewlett and described in
|
|
94 |
[this paper][2]
|
|
95 |
|
|
96 |
[1]: ../keys09/abc2chord.html?../js/pre_wind.js
|
|
97 |
[2]: http://www.ccarh.org/publications/reprints/base40/ |