]> git.cworth.org Git - scherzo/blobdiff - scherzo.c
Don't print root pitch for octaves and intervals
[scherzo] / scherzo.c
index 5c24a543baaf4e4f63a38d304fabacfd57f8c786..38f0c3d8520928f24c6d3ebe90eac8b990005f4d 100644 (file)
--- a/scherzo.c
+++ b/scherzo.c
@@ -725,6 +725,8 @@ scherzo_analyze_chord (scherzo_t *scherzo)
        { {{1, 0}, {9,  0}, {3, -1}, {7,  0}}, "m" SUP "M9" PUS },
        { {{1, 0}, {9,  0}, {3, -1}, {7, -1}}, "m9" },
        { {{1, 0}, {9, -1}, {3, -1}, {7, -1}}, "m♭9" },
+       { {{1, 0}, {9,  0}, {3, -1}, {6,  0}}, "m6/9" },
+       { {{1, 0}, {9, -1}, {3, -1}, {6,  0}}, "m6/♭9" },
     };
 
     /* The sorting here is funny to keep the array in degree order
@@ -758,11 +760,6 @@ scherzo_analyze_chord (scherzo_t *scherzo)
        { {{1, 0}, {9,  0}, {3,  0}, {5, -1}, {7, -1}}, "9" SUP "♭5" PUS },
        { {{1, 0}, {9,  0}, {3, -1}, {5, -1}, {7,  0}}, "m" SUP "M9♭5" PUS },
        { {{1, 0}, {9,  0}, {3, -1}, {5, -1}, {7, -1}}, "𝆩" SUP "9" PUS },
-
-       /* FIXME: I don't have names for these last three after
-        * dropping the 5th from the voicing. That suggests to me that
-        * I'm missing names for these with a perfect 5th in the list
-        * above. */
        { {{1, 0}, {9, -1}, {3, -1}, {5, -1}, {7, -1}}, "𝆩" SUP "♭9" PUS },
        { {{1, 0}, {9,  0}, {3, -1}, {5, -1}, {7, -2}}, "°" SUP "9" PUS },
        { {{1, 0}, {9, -1}, {3, -1}, {5, -1}, {7, -2}}, "°" SUP "♭9" PUS },
@@ -935,9 +932,15 @@ scherzo_analyze_chord (scherzo_t *scherzo)
                                          _pitch_str (root),
                                          chord_name, inversion_str);
        } else {
-           chord_name = talloc_asprintf (local, "%s%s",
-                                         _pitch_str (root),
-                                         chord_name);
+           /* Don't print root pitch for octaves and inversions,
+            * (since a pitch name alone looks like a major triad) */
+           if (num_notes < 3) {
+               chord_name = talloc_strdup (local, chord_name);
+           } else {
+               chord_name = talloc_asprintf (local, "%s%s",
+                                             _pitch_str (root),
+                                             chord_name);
+           }
        }
     } else {
        chord_name = talloc_strdup (local, "Unknown chord");