README.md
changeset 5 377c84f956dc
parent 4 319d42cc33d8
--- a/README.md	Mon May 25 17:59:16 2020 +0200
+++ b/README.md	Tue May 26 11:43:51 2020 +0200
@@ -2,8 +2,8 @@
 
 *xmlChordAna* is a python script that makes a chordal analysis of a MusicXML file.
 
-An interactive demo is avaiable on the
-[Chord Analysis](../keys09/abc2chord.html?../js/pre_wind.js) page. It runs the script on
+An [interactive demo][1] is avaiable on the
+[Chord Analysis][1] page. It runs the script on
 my server and formats the output in some neat html.
 
 At the command line *xmlChordAna* is used as follows:
@@ -30,6 +30,7 @@
            6 1/2 E4, G4, C#5, E3
            7     E4, G4, C#5, D3
            7 1/2 E4, G4, C#5, E3
+        ...
 
 See [this explanation](https://wim.vree.org/keys09/uitleg.html) for more info.
 
@@ -39,9 +40,9 @@
 a *keyscape* from a MIDI file. The other runs the same chordal analysis as *xmlChordAna*,
 but for a MIDI file. There is no download page (yet) for these programs.
 
-### B40 notes
+### Base-40 note numbers
 
-*xml2b40* is a python script to convert a MusicXML file to a list of B40 events.
+*xml2b40* is a python script to convert a MusicXML file to a list of base-40 events.
 It is invoked from the command line as follows:
 
         > ./xml2b40.py -t 384 scorefile.xml
@@ -66,6 +67,31 @@
         1536 -180
         ...
 
-Each line contains two numbers: the time and a B40 note.
+Each line contains two numbers: the time and a base-40 note.
+The time is in ticks, where a quarter note is 384 ticks. The base-40 note number is positive
+when the note starts sounding and negative when the note stops sounding.
+
+The base-40 note number system encodes 40 pitches in an octave.
+It is maps all single and double accidentals.
+For instance, the first 10 numbers are:
 
-*TO DO: More explanation*
+        1:  Cbb
+        2:  Cb
+        3:  C
+        4:  C#
+        5:  C##
+        6:  not used 
+        7:  Dbb
+        8:  Db
+        9:  D
+        10: D#
+
+Base-40 numbers allow precise matching of chord patterns. For instance, chord pattern
+C7 only matches
+C-E-Bb and not C-E-A# or C-Fb-Bb or B#-E-Bb etc.
+
+The idea of base-40 note numbers is due to B. Hewlett and described in
+[this paper][2]
+
+[1]: ../keys09/abc2chord.html?../js/pre_wind.js
+[2]: http://www.ccarh.org/publications/reprints/base40/
\ No newline at end of file