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

  1. /* excldesc.c -- describe a system exclusive message if possible */
  2.  
  3. /*****************************************************************************
  4. *        Change Log
  5. *  Date        | Change
  6. *-----------+-----------------------------------------------------------------
  7. * 13-Jun-86 | Created Change Log
  8. *****************************************************************************/
  9.  
  10. #include "stdio.h"
  11. #include "cext.h"
  12. #include "midicode.h"
  13.  
  14. /****************************************************************************
  15. *                excldesc
  16. * Inputs:
  17. *    char *msg: the system exclusive message
  18. * Effect: 
  19. *    prints manufacturer and device code, if known
  20. ****************************************************************************/
  21.  
  22. excldesc(msg)
  23.     byte *msg;
  24. {
  25. /* length of Exclusive message preamble: */
  26. #define HDRSIZ 6
  27.     int i;
  28.     if (msg[1] == 0x43) {
  29.     printf("YAMAHA, ");
  30.     switch (msg[3]) {
  31.         case 0:
  32.         printf("single voice data (");
  33.         for (i = HDRSIZ+145; i < HDRSIZ+155; i++) printf("%c",msg[i]);
  34.         printf(")");
  35.         break;
  36.         case 1:
  37.         printf("single performance data: ");
  38.         for (i = HDRSIZ+64; i < HDRSIZ+94; i++) printf("%c", msg[i]);
  39.         printf(")");
  40.         break;
  41.         case 2:
  42.         printf("64 performance data");
  43.         break;
  44.         case 9:
  45.         printf("32 voice data");
  46.         break;
  47.         default:
  48.         printf("format %x", msg[3]);
  49.         break;
  50.     }
  51.     } else printf("I.D.: %x", msg[1]);
  52.     printf("\n");
  53. }
  54.