/* excldesc.c -- describe a system exclusive message if possible */

/*****************************************************************************
*	    Change Log
*  Date	    | Change
*-----------+-----------------------------------------------------------------
* 13-Jun-86 | Created Change Log
*****************************************************************************/

#include "stdio.h"
#include "cext.h"
#include "midicode.h"

/****************************************************************************
*				excldesc
* Inputs:
*	char *msg: the system exclusive message
* Effect: 
*	prints manufacturer and device code, if known
****************************************************************************/

excldesc(msg)
    byte *msg;
{
/* length of Exclusive message preamble: */
#define HDRSIZ 6
    int i;
    if (msg[1] == 0x43) {
	printf("YAMAHA, ");
	switch (msg[3]) {
	    case 0:
		printf("single voice data (");
		for (i = HDRSIZ+145; i < HDRSIZ+155; i++) printf("%c",msg[i]);
		printf(")");
		break;
	    case 1:
		printf("single performance data: ");
		for (i = HDRSIZ+64; i < HDRSIZ+94; i++) printf("%c", msg[i]);
		printf(")");
		break;
	    case 2:
		printf("64 performance data");
		break;
	    case 9:
		printf("32 voice data");
		break;
	    default:
		printf("format %x", msg[3]);
		break;
	}
    } else printf("I.D.: %x", msg[1]);
    printf("\n");
}
