void abc_parse(char *p, char *fname, int ln)
{
	abc_fn = fname;
	linenum = ln;
	abc_line = p;

	/* parse the music line */
	switch (parse_line(p)) {
	case 2:				/* start of tune (X:) */
		g_abc_vers = parse.abc_vers;
		g_ulen = ulen;
		g_microscale = microscale;

		meter = 2;
		memcpy(g_char_tb, char_tb, sizeof g_char_tb);
		memcpy(g_deco_tb, parse.deco_tb, sizeof g_deco_tb);
		memcpy(g_micro_tb, parse.micro_tb, sizeof g_micro_tb);
		break;
	case 1:				/* end of tune */
		if (parse.first_sym) {
			do_tune();
			parse.first_sym = parse.last_sym = NULL;
		}
		parse.abc_state = ABC_S_GLOBAL;
		parse.abc_vers = g_abc_vers;
		ulen = g_ulen;
		microscale = g_microscale;
		memcpy(char_tb, g_char_tb, sizeof g_char_tb);
		memcpy(parse.deco_tb, g_deco_tb, sizeof parse.deco_tb);
		memcpy(parse.micro_tb, g_micro_tb, sizeof parse.micro_tb);
		lvlarena(0);
		if (dc.n > 0)
			syntax("Decoration without symbol", 0);
		dc.n = 0;
		break;
	}
}
void abc_parse(char *p, char *fname, int ln)
{
	abc_fn = fname;
	linenum = ln;
	abc_line = p;

	 
	switch (parse_line(p)) {
	case 2:				 
		g_abc_vers = parse.abc_vers;
		g_ulen = ulen;
		g_microscale = microscale;

		meter = 2;
		memcpy(g_char_tb, char_tb, sizeof g_char_tb);
		memcpy(g_deco_tb, parse.deco_tb, sizeof g_deco_tb);
		memcpy(g_micro_tb, parse.micro_tb, sizeof g_micro_tb);
		break;
	case 1:				 
		if (parse.first_sym) {
			do_tune();
			parse.first_sym = parse.last_sym = NULL;
		}
		parse.abc_state = ABC_S_GLOBAL;
		parse.abc_vers = g_abc_vers;
		ulen = g_ulen;
		microscale = g_microscale;
		memcpy(char_tb, g_char_tb, sizeof g_char_tb);
		memcpy(parse.deco_tb, g_deco_tb, sizeof parse.deco_tb);
		memcpy(parse.micro_tb, g_micro_tb, sizeof parse.micro_tb);
		lvlarena(0);
		if (dc.n > 0)
			syntax("Decoration without symbol", 0);
		dc.n = 0;
		break;
	}
}