home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / midi / cmtcmu / adagio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-28  |  1.2 KB  |  43 lines

  1. #define name_length 255
  2.  
  3. #define num_voices 16
  4. #define minpitch -12
  5. #define maxpitch 115
  6. #define NO_PITCH (maxpitch+1)
  7. #define minprogram 1
  8. #define maxprogram 128
  9.  
  10. struct note_struct {
  11.     long ndur;        /* duration */
  12.     char npitch;    /* pitch (middle C = 48) */
  13.     char nloud;        /* loudness (MIDI velocity) */
  14.     char nprogram;    /* adagio Z parameter (MIDI program) */
  15.     };
  16.  
  17. struct ctrl_struct {
  18.     char value;
  19.     };
  20.  
  21. typedef struct event_struct {
  22.     struct event_struct *next;
  23.     long ntime;        /* start time */
  24.     int nline;        /* line number from source code */
  25.     char nvoice;    /* adagio voice (MIDI Channel)
  26.              *  if this is a control change, high order 4 bits
  27.              *  contain the control number, otherwise high order
  28.              *  4 bits are 0 (see is_note macro below)
  29.              */
  30.     union {
  31.     struct note_struct note;
  32.     struct ctrl_struct ctrl;
  33.     } u;
  34.     } *event_type;
  35.  
  36. #define nctrl 7
  37. #define ctrlsize (sizeof(struct event_struct) - \
  38.           sizeof(struct note_struct) + sizeof(struct ctrl_struct))
  39. #define ctrl_voice(c, v) (((c) << 4) + (v))
  40. #define vc_ctrl(v) ((v) >> 4)
  41. #define vc_voice(v) ((v) & 0x0F)
  42. #define is_note(n) (((n)->nvoice & 0xF0) == 0)
  43.