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
{
typedef struct score_note
{
+ score_staff_t *staff;
score_pitch_t pitch;
int octave;
score_duration_t duration;
+
+ struct {
+ double r;
+ double g;
+ double b;
+ } color;
} score_note_t;
+typedef struct score_chord
+{
+ score_staff_t *staff;
+
+ char *name;
+ double width;
+} score_chord_t;
+
typedef enum score_clef
{
SCORE_CLEF_G,
* QUARTER=4, EIGHTH=8, etc.)
*/
score_note_t *
-score_staff_add_note (score_staff_t *staff,
- score_pitch_t pitch,
- int octave,
- score_duration_t);
+score_add_note (score_staff_t *staff,
+ score_pitch_t pitch,
+ int octave,
+ score_duration_t);
+
+/* Add a chord symbol of 'name' to a staff.
+ *
+ * For now, the chord symbols are free-form names.
+ */
+score_chord_t *
+score_add_chord (score_staff_t *staff,
+ const char * name);
+
+/* Remove the given chord from its staff. */
+void
+score_remove_chord (score_chord_t *chord);
+
+/* Remove the given note from its staff. */
+void
+score_remove_note (score_note_t *note);
-/* Remove the given note from the given staff. */
void
-score_staff_remove_note (score_staff_t *staff, score_note_t *note);
+score_set_note_color_rgb (score_note_t *note,
+ double r,
+ double g,
+ double b);
/* Return the first note on the given staff with the given pitch,
* octave, and durations. Returns NULL if no match is found. */