-typedef enum pitch
-{
- PITCH_Cff = PITCH_LITERAL (C, DOUBLE_FLAT),
- PITCH_Cf = PITCH_LITERAL (C, FLAT),
- PITCH_C = PITCH_LITERAL (C, NATURAL),
- PITCH_Cs = PITCH_LITERAL (C, SHARP),
- PITCH_Css = PITCH_LITERAL (C, DOUBLE_SHARP),
-
- PITCH_Dff = PITCH_LITERAL (D, DOUBLE_FLAT),
- PITCH_Df = PITCH_LITERAL (D, FLAT),
- PITCH_D = PITCH_LITERAL (D, NATURAL),
- PITCH_Ds = PITCH_LITERAL (D, SHARP),
- PITCH_Dss = PITCH_LITERAL (D, DOUBLE_SHARP),
-
- PITCH_Eff = PITCH_LITERAL (E, DOUBLE_FLAT),
- PITCH_Ef = PITCH_LITERAL (E, FLAT),
- PITCH_E = PITCH_LITERAL (E, NATURAL),
- PITCH_Es = PITCH_LITERAL (E, SHARP),
- PITCH_Ess = PITCH_LITERAL (E, DOUBLE_SHARP),
-
- PITCH_Fff = PITCH_LITERAL (F, DOUBLE_FLAT),
- PITCH_Ff = PITCH_LITERAL (F, FLAT),
- PITCH_F = PITCH_LITERAL (F, NATURAL),
- PITCH_Fs = PITCH_LITERAL (F, SHARP),
- PITCH_Fss = PITCH_LITERAL (F, DOUBLE_SHARP),
-
- PITCH_Gff = PITCH_LITERAL (G, DOUBLE_FLAT),
- PITCH_Gf = PITCH_LITERAL (G, FLAT),
- PITCH_G = PITCH_LITERAL (G, NATURAL),
- PITCH_Gs = PITCH_LITERAL (G, SHARP),
- PITCH_Gss = PITCH_LITERAL (G, DOUBLE_SHARP),
-
- PITCH_Aff = PITCH_LITERAL (A, DOUBLE_FLAT),
- PITCH_Af = PITCH_LITERAL (A, FLAT),
- PITCH_A = PITCH_LITERAL (A, NATURAL),
- PITCH_As = PITCH_LITERAL (A, SHARP),
- PITCH_Ass = PITCH_LITERAL (A, DOUBLE_SHARP),
-
- PITCH_Bff = PITCH_LITERAL (B, DOUBLE_FLAT),
- PITCH_Bf = PITCH_LITERAL (B, FLAT),
- PITCH_B = PITCH_LITERAL (B, NATURAL),
- PITCH_Bs = PITCH_LITERAL (B, SHARP),
- PITCH_Bss = PITCH_LITERAL (B, DOUBLE_SHARP)
-} pitch_t;
+/* Respell 'pitch' to have a name that matches the (diatonic) scale
+ * 'degree' from 'root'.
+ *
+ * If the pitch is too distant from the specified degree to be
+ * respelled, the original pitch will be returned unmodified.
+ */
+pitch_t
+pitch_spell_as_degree (pitch_t pitch, pitch_t root, int degree);
+
+/* Return a MIDI note value corresponding to 'pitch' */
+unsigned char
+pitch_to_midi (pitch_t pitch);
+
+/* Return the pitch_t value corresponding to the given MIDI note value. */
+pitch_t
+pitch_from_midi (unsigned char midi_note);
+
+/* 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. */
+int
+pitch_enharmonic_to (pitch_t a, pitch_t b);
+
+#endif /* PITCH_H */