From 39a9e8b1d8548408fcdfe63922b93b4776237944 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 25 Sep 2013 18:03:19 -0700 Subject: [PATCH] Add recognition of sus2 and sus (sus4) chords. 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 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scherzo.c b/scherzo.c index d1a164c..a1ed6e3 100644 --- a/scherzo.c +++ b/scherzo.c @@ -661,17 +661,24 @@ scherzo_analyze_chord (scherzo_t *scherzo) #define PUS "" 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) { -- 2.43.0