From: Carl Worth Date: Fri, 27 Sep 2013 05:12:14 +0000 (-0700) Subject: Don't print the inversion names X-Git-Url: https://git.cworth.org/git?p=scherzo;a=commitdiff_plain;h=7bab1f929a847d2b1ee569a5ed4149d374aa707a Don't print the inversion names These were just too long for a very little bit of information, (perhaps in the future I'll decide to bring back the inversion information but with a style such as C/G for a C major triad in 2nd inversion). --- diff --git a/scherzo.c b/scherzo.c index 1da182f..671d354 100644 --- a/scherzo.c +++ b/scherzo.c @@ -911,36 +911,14 @@ scherzo_analyze_chord (scherzo_t *scherzo) CHORD_NAME_KNOWN: if (chord_name) { - if (inversion) { - const char *inversion_str; - switch (inversion) { - case 1: - inversion_str = "1st inversion"; - break; - case 2: - inversion_str = "2nd inversion"; - break; - case 3: - inversion_str = "3rd inversion"; - break; - default: - fprintf (stderr, "Internal error: Unexpected inversion: %d\n", - inversion); - exit(1); - } - chord_name = talloc_asprintf (local, "%s%s %s", - _pitch_str (root), - chord_name, inversion_str); + /* 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 { - /* 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); - } + chord_name = talloc_asprintf (local, "%s%s", + _pitch_str (root), + chord_name); } } else { chord_name = talloc_strdup (local, "Unknown chord");