]> git.cworth.org Git - scherzo/blobdiff - scherzo.c
Fix key signature setting to accept an enharmonic pitch
[scherzo] / scherzo.c
index dacefa8e8e8e186ec9fa6f20b9f79f05ab34e420..bdd1a0fe5c7dbe86e97cf1c2a219e17815b9873e 100644 (file)
--- a/scherzo.c
+++ b/scherzo.c
@@ -397,17 +397,6 @@ on_key_release_event (unused (GtkWidget *widget),
     return FALSE;
 }
 
-/* Return true if 'a' and 'b' sound identical, (even if spelled differently)
- *
- * This comparison considers octaves as significant. So Bb and A# in
- * the same octave are considered enharmonic, but Bb and A# in
- * different octaves are not. */
-static int
-_pitches_are_enharmonic (pitch_t a, pitch_t b)
-{
-    return pitch_to_midi (a) == pitch_to_midi (b);
-}
-
 /* Determine a chord name (if any) from the current notes pressed */
 
 typedef struct analyzed_pitch {
@@ -871,7 +860,7 @@ pitch_group_remove_pitch_enharmonic (pitch_group_t *group, pitch_t pitch)
     int i;
 
     for (i = 0; i < group->num_pitches; i++)
-       if (_pitches_are_enharmonic (group->pitches[i], pitch))
+       if (pitch_enharmonic_to (group->pitches[i], pitch))
            pitch_group_remove_pitch_at (group, i);
 }