static char *parse_extra(char *p,
			char **p_name,
			char **p_middle,
			char **p_stlines,
			char **p_scale,
			char **p_octave,
			char **p_cue,
			char **p_map)
{
	for (;;) {
		if (strncmp(p, "clef=", 5) == 0
		 || strncmp(p, "bass", 4) == 0
		 || strncmp(p, "treble", 6) == 0
		 || strncmp(p, "alto", 4) == 0
		 || strncmp(p, "tenor", 5) == 0
		 || strncmp(p, "perc", 4) == 0) {
			if (*p_name)
				syntax("Double clef name", p);
			*p_name = p;
		} else if (strncmp(p, "microscale=", 11) == 0
			|| strncmp(p, "uscale=", 7) == 0) {
			int i;

			p += p[0] == 'm' ? 11 : 7;
			i = atoi(p);
			if (i < 4 || i >= 256)
				syntax("Invalid value in microscale=", p);
			else
				microscale = i;
		} else if (strncmp(p, "middle=", 7) == 0
			|| strncmp(p, "m=", 2) == 0) {
			if (*p_middle)
				syntax("Double clef middle", p);
			*p_middle = p + (p[1] == '=' ? 2 : 7);
		} else if (strncmp(p, "octave=", 7) == 0) {
			if (*p_octave)
				syntax("Double octave=", p);
			*p_octave = p + 7;
		} else if (strncmp(p, "stafflines=", 11) == 0) {
			int l;
			char *q;

			if (*p_stlines)
				syntax("Double stafflines", p);
			p += 11;
			if (isdigit((unsigned char) *p)) {
				switch (atoi(p)) {
				case 0: *p_stlines = "..."; break;
				case 1: *p_stlines = "..|"; break;
				case 2: *p_stlines = ".||"; break;
				case 3: *p_stlines = ".|||"; break;
				case 4: *p_stlines = "||||"; break;
				case 5: *p_stlines = "|||||"; break;
				case 6: *p_stlines = "||||||"; break;
				case 7: *p_stlines = "|||||||"; break;
				case 8: *p_stlines = "||||||||"; break;
				default:
					syntax("Bad number of lines", p);
					break;
				}
			} else {
				q = p;
				while (!isspace((unsigned char) *p) && *p != '\0')
					p++;
				l = p - q;
				*p_stlines = getarena(l + 1);
				strncpy(*p_stlines, q, l);
				(*p_stlines)[l] = '\0';
			}
		} else if (strncmp(p, "staffscale=", 11) == 0) {
			if (*p_scale)
				syntax("Double staffscale", p);
			*p_scale = p + 11;
		} else if (strncmp(p, "cue=", 4) == 0) {
			if (*p_cue)
				syntax("Double cue", p);
			*p_cue = p + 4;
		} else if (strncmp(p, "map=", 4) == 0) {
			if (*p_map)
				syntax("Double map", p);
			*p_map = p + 4;
//		} else if (strncmp(p, "transpose=", 10) == 0
//			|| strncmp(p, "t=", 2) == 0) {
//			;		/* ignored - abcMIDI */
		} else {
			break;
		}
		while (!isspace((unsigned char) *p) && *p != '\0')
			p++;
		while (isspace((unsigned char) *p))
			p++;
		if (*p == '\0')
			break;
	}
	return p;
}
static char *parse_extra(char *p,
			char **p_name,
			char **p_middle,
			char **p_stlines,
			char **p_scale,
			char **p_octave,
			char **p_cue,
			char **p_map)
{
	for (;;) {
		if (strncmp(p, "clef=", 5) == 0
		 || strncmp(p, "bass", 4) == 0
		 || strncmp(p, "treble", 6) == 0
		 || strncmp(p, "alto", 4) == 0
		 || strncmp(p, "tenor", 5) == 0
		 || strncmp(p, "perc", 4) == 0) {
			if (*p_name)
				syntax("Double clef name", p);
			*p_name = p;
		} else if (strncmp(p, "microscale=", 11) == 0
			|| strncmp(p, "uscale=", 7) == 0) {
			int i;

			p += p[0] == 'm' ? 11 : 7;
			i = atoi(p);
			if (i < 4 || i >= 256)
				syntax("Invalid value in microscale=", p);
			else
				microscale = i;
		} else if (strncmp(p, "middle=", 7) == 0
			|| strncmp(p, "m=", 2) == 0) {
			if (*p_middle)
				syntax("Double clef middle", p);
			*p_middle = p + (p[1] == '=' ? 2 : 7);
		} else if (strncmp(p, "octave=", 7) == 0) {
			if (*p_octave)
				syntax("Double octave=", p);
			*p_octave = p + 7;
		} else if (strncmp(p, "stafflines=", 11) == 0) {
			int l;
			char *q;

			if (*p_stlines)
				syntax("Double stafflines", p);
			p += 11;
			if (isdigit((unsigned char) *p)) {
				switch (atoi(p)) {
				case 0: *p_stlines = "..."; break;
				case 1: *p_stlines = "..|"; break;
				case 2: *p_stlines = ".||"; break;
				case 3: *p_stlines = ".|||"; break;
				case 4: *p_stlines = "||||"; break;
				case 5: *p_stlines = "|||||"; break;
				case 6: *p_stlines = "||||||"; break;
				case 7: *p_stlines = "|||||||"; break;
				case 8: *p_stlines = "||||||||"; break;
				default:
					syntax("Bad number of lines", p);
					break;
				}
			} else {
				q = p;
				while (!isspace((unsigned char) *p) && *p != '\0')
					p++;
				l = p - q;
				*p_stlines = getarena(l + 1);
				strncpy(*p_stlines, q, l);
				(*p_stlines)[l] = '\0';
			}
		} else if (strncmp(p, "staffscale=", 11) == 0) {
			if (*p_scale)
				syntax("Double staffscale", p);
			*p_scale = p + 11;
		} else if (strncmp(p, "cue=", 4) == 0) {
			if (*p_cue)
				syntax("Double cue", p);
			*p_cue = p + 4;
		} else if (strncmp(p, "map=", 4) == 0) {
			if (*p_map)
				syntax("Double map", p);
			*p_map = p + 4;
 
 
 
		} else {
			break;
		}
		while (!isspace((unsigned char) *p) && *p != '\0')
			p++;
		while (isspace((unsigned char) *p))
			p++;
		if (*p == '\0')
			break;
	}
	return p;
}