X-Git-Url: https://git.cworth.org/git?p=scherzo;a=blobdiff_plain;f=scherzo.c;h=7296280302ddbb53e3d4bff04d0a5176c6a92f1f;hp=9b0e2d9ced96bc43dfcf5f8c388d373549c8923f;hb=9f1dfa2331bdac81aa261442b44b753c115c0102;hpb=05713bff8bc084c401d58b1b9526d83d9a42b641 diff --git a/scherzo.c b/scherzo.c index 9b0e2d9..7296280 100644 --- a/scherzo.c +++ b/scherzo.c @@ -417,6 +417,18 @@ scherzo_analyze_chord (scherzo_t *scherzo) { {0, 3, 6}, "Diminished triad" } }; + struct { int pitches[4]; const char *name; } sevenths[] = { + { {0, 4, 8, 11}, "Augmented/major 7" }, + { {0, 4, 7, 11}, "Major 7" }, + { {0, 4, 7, 10}, "Dominant 7" }, + { {0, 3, 7, 11}, "Minor/major 7" }, + { {0, 3, 7, 10}, "Minor 7" }, + { {0, 3, 6, 10}, "Half-diminished 7" }, + { {0, 3, 6, 9}, "Diminished 7" }, + { {0, 4, 8, 10}, "Augmented 7" }, + { {0, 3, 6, 11}, "Diminished/major 7" }, + }; + if (scherzo->chord) { score_remove_chord (scherzo->chord); scherzo->chord = NULL; @@ -451,12 +463,10 @@ scherzo_analyze_chord (scherzo_t *scherzo) chord_name = triads[i].name; } -/* - for (i = 0; i < num_sevenths; i++) { - if (_chord_signature_matches (notes, num_notes, seventh[i].pitches, 4)) - chord_name = seventh[i].name; + for (i = 0; i < ARRAY_SIZE(sevenths); i++) { + if (_chord_signature_matches (notes, num_notes, sevenths[i].pitches, 4)) + chord_name = sevenths[i].name; } -*/ if (chord_name) scherzo->chord = score_add_chord (scherzo->treble, chord_name);