]> git.cworth.org Git - scherzo/blobdiff - pitch.c
Fix key signature setting to accept an enharmonic pitch
[scherzo] / pitch.c
diff --git a/pitch.c b/pitch.c
index 211e68c1aeb1252ff60c62b1d214475ffe5d5ce9..03eb48100e56efd011206928d391b3ffa5eaba65 100644 (file)
--- a/pitch.c
+++ b/pitch.c
@@ -18,6 +18,7 @@
  * along with this program.  If not, see http://www.gnu.org/licenses/ .
  */
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "pitch.h"
@@ -288,3 +289,9 @@ pitch_from_midi (unsigned char midi_note)
        break;
     }
 }
+
+int
+pitch_enharmonic_to (pitch_t a, pitch_t b)
+{
+    return pitch_to_midi (a) == pitch_to_midi (b);
+}