]> git.cworth.org Git - scherzo/commitdiff
Add recognition of sus2 and sus (sus4) chords.
authorCarl Worth <cworth@cworth.org>
Thu, 26 Sep 2013 01:03:19 +0000 (18:03 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 26 Sep 2013 01:03:19 +0000 (18:03 -0700)
I'm not sure that all of this is exactly correct, but I'm trying to
implement the rules described here:

http://en.wikipedia.org/wiki/Chord_notation#Suspended_chords

scherzo.c

index d1a164c76e6e9ac052faf1def3810dcf4d8681b6..a1ed6e3794ff09a182c55f3c355bae8826497ea5 100644 (file)
--- a/scherzo.c
+++ b/scherzo.c
@@ -661,17 +661,24 @@ scherzo_analyze_chord (scherzo_t *scherzo)
 #define PUS "</span>"
 
     struct { modified_degree_t degrees[3]; const char *name; } triads[] = {
+       { {{1, 0}, {3, +1}, {5,  0}}, "sus" },
        { {{1, 0}, {3,  0}, {5, +1}}, SUP "+" PUS },
        { {{1, 0}, {3,  0}, {5,  0}}, "" },
        { {{1, 0}, {3, -1}, {5,  0}}, "m" },
-       { {{1, 0}, {3, -1}, {5, -1}}, "°" }
+       { {{1, 0}, {3, -1}, {5, -1}}, "°" },
+       { {{1, 0}, {2,  0}, {5,  0}}, "msus2" }
     };
 
     struct { modified_degree_t degrees[4]; const char *name; } tetrachords[] = {
        /* Sixth chords */
+       { {{1, 0}, {3, +1}, {5,  0}, {6,  0}}, "sus" SUP "6" PUS },
        { {{1, 0}, {3,  0}, {5,  0}, {6,  0}}, "6" },
        { {{1, 0}, {3, -1}, {5,  0}, {6,  0}}, "m6" },
+       { {{1, 0}, {2,  0}, {5,  0}, {6,  0}}, "msus2" SUP "6" PUS },
        /* Seventh chords */
+       { {{1, 0}, {3, +1}, {5,  0}, {7,  0}}, "sus" SUP "M7" PUS },
+       { {{1, 0}, {3, +1}, {5,  0}, {7, -1}}, "sus" SUP "7" PUS },
+       { {{1, 0}, {3, +1}, {5, -1}, {7, -1}}, "sus" SUP "7♭5" PUS },
        { {{1, 0}, {3,  0}, {5, +1}, {7,  0}}, SUP "+M7" PUS },
        { {{1, 0}, {3,  0}, {5, +1}, {7, -1}}, SUP "+7" PUS },
        { {{1, 0}, {3,  0}, {5,  0}, {7,  0}}, "M7" },
@@ -681,7 +688,12 @@ scherzo_analyze_chord (scherzo_t *scherzo)
        { {{1, 0}, {3, -1}, {5,  0}, {7, -1}}, "m7" },
        { {{1, 0}, {3, -1}, {5, -1}, {7,  0}}, "°" SUP "M7" PUS },
        { {{1, 0}, {3, -1}, {5, -1}, {7, -1}}, "𝆩" SUP "7" PUS },
-       { {{1, 0}, {3, -1}, {5, -1}, {7, -2}}, "°" SUP "7" PUS }
+       { {{1, 0}, {3, -1}, {5, -1}, {7, -2}}, "°" SUP "7" PUS },
+       { {{1, 0}, {2,  0}, {5,  0}, {7,  0}}, "msus2" SUP "M7" PUS },
+       { {{1, 0}, {2,  0}, {5,  0}, {7, -1}}, "msus2" SUP "7" PUS },
+       { {{1, 0}, {2,  0}, {5, -1}, {7,  0}}, "msus2°" SUP "M7" PUS },
+       { {{1, 0}, {2,  0}, {5, -1}, {7, -1}}, "msus2𝆩" SUP "7" PUS },
+       { {{1, 0}, {2,  0}, {5, -1}, {7, -2}}, "msus2°" SUP "7" PUS }
     };
 
     if (scherzo->chord) {