Next: Numeric values calculation
Up: Data structures
Previous: Data structures
Contents
Special structures have been created for the Virtual Music Teacher package and the detector object to store data from the score. They are:
- Structure for notes:
typedef struct _scorenote_ /*------------------- */
{
int *pitch; /* pitch of the note, between 0 and 127 */
int *value_n; /* upper number of the duration fraction */
int *value_d; /* lower number of the duration fraction */
int *accent; /* 1 if the note should be accentuated */
measure_t *position; /* musical time of current note */
} scorenote_t;
- Structure for controlers:
typedef struct _scorecontroler_ /*----------------- */
{
int *type; /* controler type: tempo, time signature, dynamics...*/
int *value; /* value of the controler */
int *value2; /* only for controlers that need 2 values */
measure_t *position; /* musical time of current controler */
} scorecontroler_t;
- In both, the data type measure_t has the following definition:
typedef struct _measure_t_ /*------------------- */
{
int measure_number; /* begins with 1 and not 0 */
int beat_number; /* according to the time signature */
int beat_fraction; /* value between 0 and 95 */
} measure_t;
The main structure contains a pointer to a scorenote_t array and to a scorecontroler_t array, in which are stored all the event got from the score text file.
Next: Numeric values calculation
Up: Data structures
Previous: Data structures
Contents
Mathieu Gilles (Betr. soltau)
2003-08-25