next up previous contents
Next: Retrieve Musical data from Up: Report edition Previous: Report edition   Contents

Storing errors

Each error must be stored somewhere if we want to print a report at the end of the play. For each one, we need to know the error type, the note where the error has been done, and the ``value'' of the error (played pitch for a wrong note, time offset for a rhythm error...).
Errors that refer to more than one note like general dynamic errors need to refer to 2 indexes: note where the error begins, and note where the error stops.

The following structure has been implemented to store performed errors:

typedef struct _error_ /*----------------- */
{
  int *type;     /* error type: note, rhythm, dynamics */
  int *note;     /* index of note where the error occured */
  double *value; /* played pitch for note errors, offset for rhythm errors... */
  int *end;      /* only used for errors between 2 notes */

} error_t;

The main structure vmt_t contains an array of error_t. This array is filled on each new detected (and classified) error, and when the report is printed, all the data are got from this array.


next up previous contents
Next: Retrieve Musical data from Up: Report edition Previous: Report edition   Contents
Mathieu Gilles (Betr. soltau) 2003-08-25