typedef enum score_pitch_name
{
- SCORE_PITCH_NAME_C = 0 << SCORE_PITCH_NAME_SHIFT,
- SCORE_PITCH_NAME_D = 1 << SCORE_PITCH_NAME_SHIFT,
- SCORE_PITCH_NAME_E = 2 << SCORE_PITCH_NAME_SHIFT,
- SCORE_PITCH_NAME_F = 3 << SCORE_PITCH_NAME_SHIFT,
- SCORE_PITCH_NAME_G = 4 << SCORE_PITCH_NAME_SHIFT,
- SCORE_PITCH_NAME_A = 5 << SCORE_PITCH_NAME_SHIFT,
- SCORE_PITCH_NAME_B = 6 << SCORE_PITCH_NAME_SHIFT
+ SCORE_PITCH_NAME_C,
+ SCORE_PITCH_NAME_D,
+ SCORE_PITCH_NAME_E,
+ SCORE_PITCH_NAME_F,
+ SCORE_PITCH_NAME_G,
+ SCORE_PITCH_NAME_A,
+ SCORE_PITCH_NAME_B,
} score_pitch_name_t;
#define SCORE_PITCH_NAME(pitch) (((pitch) & SCORE_PITCH_NAME_MASK) >> SCORE_PITCH_NAME_SHIFT)
-#define SCORE_PITCH_VALUE(name, accidental) ((SCORE_PITCH_NAME_##name) + (SCORE_PITCH_ACCIDENTAL_##accidental))
+#define SCORE_PITCH_VALUE(name, accidental) ((SCORE_PITCH_NAME_##name << SCORE_PITCH_NAME_SHIFT) + (SCORE_PITCH_ACCIDENTAL_##accidental))
typedef enum score_pitch
{