/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /home/kde/kdemultimedia/kmidi/cfg.cpp,v 1.9 2000/08/08 18:21:55 faure Exp $
 */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

#include <stdio.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>
#include <unistd.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS

/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST

#else	/* ! __cplusplus */

#if __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif	/* __STDC__ */
#endif	/* ! __cplusplus */

#ifdef __TURBOC__
 #pragma warn -rch
 #pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif

/* Returned upon end-of-file. */
#define YY_NULL 0

/* Promotes a possibly negative, possibly signed char to an unsigned
 * integer for use as an array index.  If the signed char is negative,
 * we want to instead treat it as an 8-bit unsigned char, hence the
 * double cast.
 */
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)

/* Enter a start condition.  This macro really ought to take a parameter,
 * but we do it the disgusting crufty way forced on us by the ()-less
 * definition of BEGIN.
 */
#define BEGIN yy_start = 1 + 2 *

/* Translate the current start state into a value that can be later handed
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
 * compatibility.
 */
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START

/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)

/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )

#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#define YY_BUF_SIZE 16384

typedef struct yy_buffer_state *YY_BUFFER_STATE;

extern int yyleng;
extern FILE *yyin, *yyout;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

/* The funky do-while in the following #define is used to turn the definition
 * int a single C statement (which needs a semi-colon terminator).  This
 * avoids problems with code like:
 *
 * 	if ( condition_holds )
 *		yyless( 5 );
 *	else
 *		do_something_else();
 *
 * Prior to using the do-while the compiler would get upset at the
 * "else" because it interpreted the "if" statement as being all
 * done when it reached the ';' after the yyless() call.
 */

/* Return all but the first 'n' matched characters back to the input stream. */

#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		*yy_cp = yy_hold_char; \
		YY_RESTORE_YY_MORE_OFFSET \
		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

#define unput(c) yyunput( c, yytext_ptr )

/* The following is because we cannot portably get our hands on size_t
 * (without autoconf's help, which isn't available because we want
 * flex-generated scanners to compile on their own).
 */
typedef unsigned int yy_size_t;


struct yy_buffer_state
	{
	FILE *yy_input_file;

	char *yy_ch_buf;		/* input buffer */
	char *yy_buf_pos;		/* current position in input buffer */

	/* Size of input buffer in bytes, not including room for EOB
	 * characters.
	 */
	yy_size_t yy_buf_size;

	/* Number of characters read into yy_ch_buf, not including EOB
	 * characters.
	 */
	int yy_n_chars;

	/* Whether we "own" the buffer - i.e., we know we created it,
	 * and can realloc() it to grow it, and should free() it to
	 * delete it.
	 */
	int yy_is_our_buffer;

	/* Whether this is an "interactive" input source; if so, and
	 * if we're using stdio for input, then we want to use getc()
	 * instead of fread(), to make sure we stop fetching input after
	 * each newline.
	 */
	int yy_is_interactive;

	/* Whether we're considered to be at the beginning of a line.
	 * If so, '^' rules will be active on the next match, otherwise
	 * not.
	 */
	int yy_at_bol;

	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int yy_fill_buffer;

	int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
	/* When an EOF's been seen but there's still some text to process
	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
	 * shouldn't try reading from the input source any more.  We might
	 * still have a bunch of tokens to match, though, because of
	 * possible backing-up.
	 *
	 * When we actually see the EOF, we change the status to "new"
	 * (via yyrestart()), so that the user can continue scanning by
	 * just pointing yyin at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2
	};

static YY_BUFFER_STATE yy_current_buffer = 0;

/* We provide macros for accessing buffer states in case in the
 * future we want to put the buffer states in a more general
 * "scanner state".
 */
#define YY_CURRENT_BUFFER yy_current_buffer


/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;

static int yy_n_chars;		/* number of characters read into yy_ch_buf */


int yyleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1;		/* whether we need to initialize */
static int yy_start = 0;	/* start state number */

/* Flag which is used to allow yywrap()'s to do buffer switches
 * instead of setting up a fresh yyin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

void yyrestart YY_PROTO(( FILE *input_file ));

void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )

YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));

static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));

#define yy_new_buffer yy_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_at_bol = at_bol; \
	}

#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)


#define yywrap() 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext

static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	yytext_ptr = yy_bp; \
	yyleng = (int) (yy_cp - yy_bp); \
	yy_hold_char = *yy_cp; \
	*yy_cp = '\0'; \
	yy_c_buf_p = yy_cp;

#define YY_NUM_RULES 45
#define YY_END_OF_BUFFER 46
static yyconst short int yy_accept[379] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,   46,   43,
       43,   44,    1,   43,    1,   43,   43,   43,   43,   43,
       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
       43,   43,   43,   43,   43,    0,    1,    1,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    1,
        2,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,   19,    0,    0,
        0,   23,    0,   29,    0,   28,    0,   27,    0,   26,
        0,   21,    0,   25,    0,   24,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,   14,    0,
        0,    0,    0,    0,    0,   37,    0,    0,   40,    0,
        0,    0,   22,    0,    0,    0,    0,    0,    0,    0,
       20,    0,    0,    0,   20,    0,    0,    0,    0,    0,
       20,    0,    0,    0,    0,    0,    0,    0,    0,    4,

        3,    5,    0,    0,    0,    0,    0,    0,    0,    0,
       35,   36,   38,   39,   19,    0,    0,    0,    0,    0,
        0,    0,    0,   20,   20,    0,    0,    0,    0,    0,
        0,    6,    0,    0,    5,    5,    0,    0,    0,   30,
        0,   33,    0,    0,    0,    0,    0,    0,   20,   20,
        0,    0,    0,   20,   20,    0,    0,    0,    0,    0,
       13,    0,    0,    0,    5,    5,    0,    0,   31,    0,
       34,    0,   41,   42,    0,    0,   20,   20,   41,   42,
        0,    0,    0,    0,    6,    0,    0,    0,    0,    0,
        0,    0,   20,   20,    0,    0,    0,    0,    0,   15,

       16,    7,    0,    0,    0,   41,   42,    0,    0,    0,
        0,   12,   11,    0,   32,    0,    0,    0,    0,    0,
        7,    6,    6,    6,    6,    0,    6,    6,    6,    0,
        0,   10,    0,   10,    6,    6,    6,    0,    0,    0,
        0,    0,    6,    6,    6,    0,    0,    0,   10,    9,
        6,    6,    6,    0,    0,   20,    0,    6,    6,    6,
        0,    0,   10,    0,    6,    6,    6,    6,   18,    0,
        8,    0,    0,    0,    0,    8,   17,    0
    } ;

static yyconst int yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    5,    1,    6,    7,    1,    1,    1,    1,    1,
        1,    1,    8,    9,   10,    1,    1,   11,   12,   13,
       11,   11,   11,   11,   11,   11,   11,   14,    1,    1,
       15,    1,    1,    1,   16,   17,   18,   19,   17,   17,
       17,   17,   17,   17,   17,   17,   20,   17,   21,   22,
       17,   17,   17,   17,   17,   23,   17,   24,   17,   17,
       25,    1,   26,    1,    1,    1,   27,   28,   29,   30,

       31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
       41,   42,   36,   43,   44,   45,   46,   47,   36,   48,
       49,   36,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1
    } ;

static yyconst int yy_meta[50] =
    {   0,
        1,    2,    3,    4,    5,    6,    4,    1,    1,    1,
        1,    1,    1,    1,    1,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    1,    1,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5
    } ;

static yyconst short int yy_base[406] =
    {   0,
        0,    6,   49,   30,   40,   53,   57,   61,  880, 1311,
       75, 1311,    0,  105,  870,  132,  134,   24,  139,    1,
      841,    5,  828,  825,   40,  177,  810,  812,  801,  782,
      775,  154,   55,  158,  772,  765,  775,  162,    6,  178,
      758,  755,  767,  170,   63,  106,    0,    0,    0,  222,
        0,  159,  211,   85,  764,   18,  752,  753,  110,  771,
     1311,  200,  234,  185,  239,  190,  243,  255,  259,  271,
      275,  287,  244,  260,  276,  288,  727,  738,  715,  708,
      693,  694,  208,  687,  227,  677,    0,  679,  682,  665,
      658,  652,  647,  654,  636,  637,  634,    0,  273,  304,

      628,  626,  615,  593,  589,  594,    0,  148,  305,  582,
      577,  583,  562,  555,  552,    0,  190,  311,    0,  317,
      335,  283,  318, 1311,  349,  313,  353,  356,  368,  363,
      380,  375,  392,  387,  404,  399,  416,  418,  423,  436,
      339,  438,  442,  417,  424,  448,  453,  465,  467,  531,
      538,  528,  329,  525,  529,  472,  354,  484, 1311,  516,
      486,  511,  521,  499,  497, 1311,  455,  449, 1311,  437,
      437,  467,  481,  493,  497,  510,  498,  524,  526,  541,
      543,  549,  556,  567,  573,  542,  427,  421,  525,  578,
      512,  514,    0,  590,  421,  413,  444,  592,  404, 1311,

      589,  601,    0,  413,  606,  614,  618,  626,  382,  374,
     1311, 1311, 1311, 1311, 1311,  630,  634,  645,  651,  632,
      407,  657,  646,  664,  671,  370,  369,  677,  397,  371,
      682,  695,    0,   88,  697,  709,  390,  364,  714,  717,
      702, 1311,  729,  730,  731,  357,  743,  745,  735, 1311,
      751,    8,   91,  759,  761,  340,  343,  766,  361,  343,
      771,  371,  327,  323,  766,  798,  583,  802,  776,  757,
     1311,  803,  814,  815,  205,  241,  820,  826, 1311, 1311,
      831,  336,  328,  832, 1311,  673,  149,  833,  839,  845,
      163,  263,  846,  854,  856,  307,  334,   37,  870, 1311,

     1311,  882,    0,  884,  851,  332,  326,  888,  298,  299,
      278, 1311,  893,  302,  866,  894,  905,  229,  215,  910,
     1311,  916,  921,  923,  935,  951,  963,  937,  975,  188,
      173,  929,    0,  965,  977,  983,  989,  994, 1000, 1024,
     1006, 1018, 1030, 1042, 1044,  153,  141,  140, 1032, 1008,
     1050, 1056, 1058, 1066, 1079, 1096, 1102,    0, 1108, 1110,
      113,   97, 1311, 1081, 1116, 1122, 1124, 1129, 1311,   78,
     1135,    0,   46,   73,   47, 1311, 1311, 1311, 1157, 1163,
     1169, 1175, 1181, 1186, 1191, 1197, 1203, 1208, 1214, 1220,
     1226, 1232, 1237, 1243, 1248, 1253, 1259, 1264, 1270, 1276,

     1282, 1288, 1293, 1299, 1305
    } ;

static yyconst short int yy_def[406] =
    {   0,
      379,  379,  379,    2,  379,    2,  379,    2,  378,  378,
      378,  378,  380,  378,  381,  378,  378,  382,  382,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,   14,  378,  378,  378,  378,  378,   14,  378,  378,
      378,  378,  378,   14,  378,  378,  380,  380,   14,  378,
       17,  382,  382,  378,  378,  378,  378,  378,  378,  381,
      378,  383,  383,  378,  378,  384,  378,  378,  378,  378,
      378,  378,  382,  385,  386,  382,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,   26,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,   32,  378,  378,

      378,  378,  378,  378,  378,  378,   38,  378,  378,  378,
      378,  378,  378,  378,  378,   44,  378,  383,  387,  378,
      378,  378,  384,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  382,  385,  386,
      388,  378,  385,  378,  378,  386,  378,  389,  382,  378,
      378,  378,  378,  378,  378,  378,  378,  390,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  387,  378,  378,  385,  385,  378,  386,  386,  386,
      388,  389,  388,  391,  389,  378,  378,  378,  378,  378,
      389,  389,  392,  382,  378,  378,  378,  393,  378,  378,

      378,  390,  394,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  385,  386,  386,  391,  392,
      392,  391,  392,  389,  389,  378,  378,  382,  378,  378,
      378,  393,  395,  378,  378,  390,  394,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  386,  386,  385,  378,
      392,  392,  392,  389,  389,  378,  378,  382,  378,  378,
      378,  395,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  386,  386,  392,  392,  389,  389,  378,  378,
      382,  378,  378,  378,  378,  378,  378,  396,  378,  378,
      392,  392,  389,  389,  382,  378,  378,  378,  378,  378,

      378,  396,  397,  378,  378,  392,  392,  386,  378,  378,
      378,  378,  378,  397,  378,  393,  398,  378,  378,  399,
      378,  400,  393,  393,  398,  401,  393,  398,  398,  378,
      378,  399,  402,  399,  400,  393,  393,  401,  395,  401,
      395,  403,  393,  398,  398,  378,  378,  402,  399,  399,
      393,  393,  386,  395,  395,  403,  403,  392,  398,  398,
      378,  378,  378,  404,  393,  393,  398,  398,  378,  378,
      404,  405,  378,  405,  378,  378,  378,    0,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,

      378,  378,  378,  378,  378
    } ;

static yyconst short int yy_nxt[1361] =
    {   0,
      378,   11,   12,  378,   11,  378,   13,   14,   12,  378,
       14,  378,   15,  250,   16,   17,   16,   16,   16,   77,
       78,   18,   18,   18,   18,   18,   18,   19,   18,   18,
       20,   32,   74,   21,   32,   22,   23,   75,   74,   80,
       24,   34,   12,   82,   34,  104,   13,   81,  275,   25,
       26,   12,   80,   26,   38,   13,   27,   38,   40,   12,
       81,   40,   44,   13,  311,   44,   28,   84,  312,   29,
       35,   85,  377,   33,   31,   27,   46,   36,  376,   46,
       86,   47,   84,   39,   37,   28,   85,   41,   29,  375,
       36,   45,   30,   31,   42,   86,  250,   37,   42,   96,

       82,   43,  113,   77,   78,   43,   49,   46,  373,   49,
       46,   47,   47,   50,   51,   50,   50,   50,  263,  264,
       52,   52,   52,   52,   52,   52,   53,   52,   52,   54,
      370,  276,   55,   62,   56,   57,   62,   84,  369,   58,
       50,   85,   50,   50,   50,  363,   63,   74,   59,   64,
       86,   65,   75,   74,   66,   98,   67,   68,   98,  100,
      300,  301,  100,  107,   47,   76,  107,   74,  250,  362,
       69,  116,   75,   74,  116,   70,   71,   72,   87,  109,
       88,   87,  109,   47,   47,   82,  120,  104,  101,  120,
       89,  123,  108,   90,  123,  102,  361,   99,   92,  102,

      117,   62,  103,   88,   62,  119,  103,  111,  110,  156,
      250,  306,  156,   89,  112,  111,   90,  347,  346,   74,
       91,   92,  112,   62,   75,   74,   62,   82,  158,  113,
       50,  158,   50,   50,   50,  378,   63,   76,  378,  119,
      121,  331,  291,  121,  125,  137,  250,  125,  138,  122,
      122,  122,  139,  126,  126,  126,  127,  140,  141,  127,
      129,  142,  330,  129,  143,  128,  128,  128,  250,  130,
      130,  130,  131,  144,  159,  131,  133,  145,  292,  133,
      146,  132,  132,  132,  147,  134,  134,  134,  135,  137,
      148,  135,  138,  122,  122,  122,  139,  136,  136,  136,

       84,  140,  141,  307,   85,  100,  109,  321,  100,  109,
       47,   47,  378,   86,  312,  378,  378,   96,  120,  123,
      319,  120,  123,  126,  126,  126,  318,  173,  173,  173,
      198,  250,  149,  198,  101,  110,  121,  250,  310,  121,
      182,  102,  111,  183,  184,  122,  122,  122,  103,  112,
      125,  309,  185,  125,  127,  158,  297,  127,  158,  126,
      126,  126,  296,  128,  128,  128,  128,  128,  128,  129,
      287,  286,  129,  130,  130,  130,  285,  283,  130,  130,
      130,  131,  282,  280,  131,  132,  132,  132,  279,  272,
      132,  132,  132,  133,  267,  266,  133,  134,  134,  134,

      260,  259,  134,  134,  134,  135,  257,  256,  135,  136,
      136,  136,  250,  246,  136,  136,  136,  137,  186,  137,
      137,  186,  138,  245,  174,  145,  139,  175,  145,  144,
      148,  140,  141,  176,  176,  176,  144,  177,  148,  142,
      178,  238,  142,  142,  147,  231,  143,  234,  231,  145,
      148,  144,  146,  230,  189,  144,  147,  189,  187,  229,
      188,  227,  148,  190,  190,  190,  192,  226,  137,  192,
      193,  138,  215,  156,  214,  139,  156,  179,  213,  180,
      140,  141,  201,  201,  201,  158,  212,  205,  158,  203,
      205,  173,  173,  173,  174,  194,  211,  174,  174,  177,

      206,  175,  177,  190,  190,  190,  144,  176,  176,  176,
      144,  137,  148,  378,  216,  192,  378,  378,  192,  193,
      176,  176,  176,  144,  141,  177,  189,  145,  178,  189,
      146,  210,  147,  209,  147,  190,  190,  190,  148,  187,
      148,  188,  145,  186,  142,  146,  186,  143,   74,  147,
      182,  208,  207,  182,  193,  148,  185,  182,  204,  200,
      183,  184,  185,  199,  197,  179,  217,  180,  220,  185,
      221,  222,   74,  221,  186,  196,  195,  186,  378,  145,
      223,  218,  145,  187,  288,  188,  171,  288,  190,  190,
      190,  137,  148,  198,  138,  170,  198,  233,  139,  201,

      201,  201,  235,  140,  141,  235,  378,  205,  169,  115,
      205,  236,  236,  236,  224,  239,  225,  114,  239,  241,
      206,  113,  241,  228,  240,  240,  240,  243,  168,  167,
      243,  137,  242,  220,  216,  145,  220,  250,  146,  166,
      244,  106,  147,  144,  141,  223,  145,  251,  148,  146,
      251,  250,  220,  147,  221,  222,  249,  221,  220,  148,
      221,  222,  249,  221,  223,  378,  105,  104,  378,  378,
      223,  247,  378,  165,  299,  378,  378,  299,  137,  164,
      163,  138,  248,  231,  162,  139,  231,  252,  161,  253,
      140,  141,  261,  261,  261,  258,  378,   97,  235,  378,

      378,  235,   96,  241,  254,   95,  241,  265,  265,  265,
      235,  255,   94,  235,  378,  239,  242,   93,  239,  236,
      236,  236,  160,  157,  240,  240,  240,  240,  240,  240,
      243,  268,  270,  243,  268,  270,  142,  155,  154,  143,
      269,  269,  269,  244,  145,  271,  145,  146,  144,  146,
      153,  147,  251,  147,  152,  251,  250,  148,  270,  148,
      378,  270,  378,  378,  378,  378,  378,  137,  151,  150,
      138,  271,  284,   61,  139,  284,  265,  265,  265,  140,
      141,  261,  261,  261,   83,  274,  269,  269,  269,   82,
       79,  273,  252,  115,  253,  114,  277,  113,  278,  235,

      281,  106,  235,  268,  289,  105,  268,  289,  265,  265,
      265,  104,  269,  269,  269,  145,  145,  290,  146,  146,
       97,  378,  147,  147,  378,  378,   96,  378,  148,  148,
      378,  378,  137,  284,  288,  138,  284,  288,  303,  139,
      289,   95,   94,  289,  140,  141,  304,  378,   93,  304,
      378,  378,  305,  290,  305,  378,   83,  137,  378,  378,
      138,  315,  315,  315,  139,   82,  294,   79,  293,  308,
      141,  299,   61,  295,  299,  298,  315,  315,  315,  378,
      313,  313,  313,  378,  378,  304,  378,  378,  304,  316,
      378,  305,  317,  305,  320,  316,  147,  320,  316,  233,

      378,  378,  148,  313,  313,  313,  316,  378,  322,  317,
      326,  320,  378,  327,  320,  333,  378,  192,  378,  322,
      192,  193,  378,  378,  378,  378,  378,  378,  378,  179,
      378,  180,  378,  378,  378,  323,  145,  324,  145,  146,
       75,  146,   75,  327,  378,  327,  328,  378,  329,  322,
      378,  322,  339,  334,  262,  340,   75,  262,  378,  341,
      378,  336,  378,  337,  189,  342,  378,  189,  378,  378,
      378,  378,  378,  343,  343,  343,  145,  344,  378,  146,
       75,  378,  378,  327,  378,  378,  378,  378,  378,  322,
      378,  378,  349,  378,  378,  339,  350,  262,  340,  353,

      262,  339,  341,  378,  339,  285,  378,  354,  342,  364,
      354,  285,  364,  378,  342,  345,  355,  355,  355,  357,
      351,  262,  357,  358,  262,  339,  352,  262,  340,  353,
      262,  145,  341,  378,  145,  378,  378,  378,  342,  378,
      343,  343,  343,  145,  322,  145,  146,   75,  146,   75,
      327,  378,  327,  378,  378,  378,  322,  378,  322,  145,
      378,  378,  146,  378,  378,  378,  147,  354,  350,  378,
      354,  285,  148,  378,  378,  378,  355,  355,  355,  359,
      339,  360,  364,  339,  285,  364,  372,  378,  378,  355,
      355,  355,  378,  342,  378,  378,  366,  262,  365,  262,

      262,  285,  262,  357,  378,  262,  357,  358,  262,  145,
      378,  145,  146,   75,  146,   75,  327,  378,  327,  378,
      378,  378,  322,  378,  322,  145,  378,  378,  146,   75,
      145,  378,  327,  146,   75,  378,  378,  327,  322,  378,
      378,  378,  378,  322,  378,  378,  378,  378,  378,  378,
      368,  378,  378,  378,  378,  378,  367,   10,   10,   10,
       10,   10,   10,   48,   48,  378,   48,   48,   48,   60,
       60,   60,   60,   60,   60,   73,  378,  378,  378,   73,
       73,  118,  118,  378,  378,  118,  118,  124,  378,  378,
      124,   74,   74,  378,  378,   74,   74,   75,   75,  378,

      378,   75,   75,  172,  172,  378,  172,  172,  181,  181,
      378,  378,  181,  181,  191,  191,  378,  378,  191,  191,
      202,  202,  378,  378,  202,  202,  219,  219,  378,  219,
      219,  219,  221,  221,  378,  221,  221,  232,  232,  378,
      378,  232,  232,  237,  237,  378,  237,  237,  262,  262,
      378,  262,  262,  302,  302,  378,  378,  302,  302,  314,
      314,  378,  314,  314,  325,  325,  378,  378,  325,  325,
      332,  332,  378,  378,  332,  332,  335,  335,  378,  378,
      335,  335,  338,  338,  378,  338,  338,  338,  348,  348,
      378,  348,  348,  356,  356,  378,  356,  356,  356,  371,

      371,  378,  378,  371,  371,  374,  374,  378,  374,  374,
        9,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378
    } ;

static yyconst short int yy_chk[1361] =
    {   0,
        0,    1,    1,    0,    1,    0,    1,    2,    2,    0,
        2,    0,    2,  252,    2,    2,    2,    2,    2,   20,
       20,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    4,   18,    2,    4,    2,    2,   18,   18,   22,
        2,    5,    5,   39,    5,   39,    5,   22,  252,    2,
        3,    3,   56,    3,    6,    3,    4,    6,    7,    7,
       56,    7,    8,    7,  298,    8,    4,   25,  298,    4,
        5,   25,  375,    4,    4,    3,   11,    5,  374,   11,
       25,   11,   33,    6,    5,    3,   33,    7,    3,  373,
        6,    8,    3,    3,    7,   33,  253,    6,    8,   33,

       45,    7,   45,   54,   54,    8,   14,   46,  370,   14,
       46,   14,   46,   14,   14,   14,   14,   14,  234,  234,
       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
      362,  253,   14,   16,   14,   14,   16,   59,  361,   14,
       16,   59,   16,   16,   16,  348,   16,   19,   14,   17,
       59,   17,   19,   19,   17,   32,   17,   17,   32,   34,
      287,  287,   34,   38,   34,   19,   38,   52,  291,  347,
       17,   44,   52,   52,   44,   17,   17,   17,   26,   40,
       32,   26,   40,   26,   40,  108,   64,  108,   34,   64,
       32,   66,   38,   32,   66,   34,  346,   32,   32,   38,

       44,   62,   34,   26,   62,   62,   38,   44,   40,   83,
      275,  291,   83,   26,   44,   40,   26,  331,  330,   53,
       26,   26,   40,   50,   53,   53,   50,  117,   85,  117,
       50,   85,   50,   50,   50,   63,   50,   53,   63,   63,
       65,  319,  275,   65,   67,   73,  276,   67,   73,   65,
       65,   65,   73,   67,   67,   67,   68,   73,   73,   68,
       69,   74,  318,   69,   74,   68,   68,   68,  292,   69,
       69,   69,   70,   74,   85,   70,   71,   75,  276,   71,
       75,   70,   70,   70,   75,   71,   71,   71,   72,   76,
       75,   72,   76,  122,  122,  122,   76,   72,   72,   72,

       99,   76,   76,  292,   99,  100,  109,  314,  100,  109,
      100,  109,  118,   99,  311,  118,  118,   99,  120,  123,
      310,  120,  123,  126,  126,  126,  309,  120,  120,  120,
      153,  307,   76,  153,  100,  109,  121,  306,  297,  121,
      141,  100,  109,  141,  141,  121,  121,  121,  100,  109,
      125,  296,  141,  125,  127,  157,  283,  127,  157,  125,
      125,  125,  282,  127,  127,  127,  128,  128,  128,  129,
      264,  263,  129,  130,  130,  130,  262,  260,  129,  129,
      129,  131,  259,  257,  131,  132,  132,  132,  256,  246,
      131,  131,  131,  133,  238,  237,  133,  134,  134,  134,

      230,  229,  133,  133,  133,  135,  227,  226,  135,  136,
      136,  136,  221,  210,  135,  135,  135,  137,  144,  138,
      137,  144,  138,  209,  139,  145,  138,  139,  145,  137,
      137,  138,  138,  139,  139,  139,  139,  140,  145,  142,
      140,  204,  142,  143,  140,  197,  143,  199,  197,  146,
      140,  142,  146,  196,  147,  143,  146,  147,  144,  195,
      144,  188,  146,  147,  147,  147,  148,  187,  149,  148,
      148,  149,  172,  156,  171,  149,  156,  140,  170,  140,
      149,  149,  156,  156,  156,  158,  168,  161,  158,  158,
      161,  173,  173,  173,  174,  149,  167,  174,  175,  177,

      161,  175,  177,  174,  174,  174,  174,  175,  175,  175,
      175,  176,  177,  191,  176,  192,  191,  191,  192,  192,
      176,  176,  176,  176,  176,  178,  189,  179,  178,  189,
      179,  165,  178,  164,  179,  189,  189,  189,  178,  177,
      179,  177,  180,  186,  181,  180,  186,  181,  181,  180,
      182,  163,  162,  182,  182,  180,  181,  183,  160,  155,
      183,  183,  182,  154,  152,  178,  179,  178,  184,  183,
      184,  184,  184,  184,  185,  151,  150,  185,  185,  190,
      184,  180,  190,  186,  267,  186,  115,  267,  190,  190,
      190,  194,  190,  198,  194,  114,  198,  198,  194,  201,

      201,  201,  202,  194,  194,  202,  202,  205,  113,  112,
      205,  202,  202,  202,  185,  206,  185,  111,  206,  207,
      205,  110,  207,  194,  206,  206,  206,  208,  106,  105,
      208,  216,  207,  220,  216,  217,  220,  220,  217,  104,
      208,  103,  217,  216,  216,  220,  218,  223,  217,  218,
      223,  223,  219,  218,  219,  219,  219,  219,  222,  218,
      222,  222,  222,  222,  219,  224,  102,  101,  224,  224,
      222,  217,  225,   97,  286,  225,  225,  286,  228,   96,
       95,  228,  218,  231,   94,  228,  231,  223,   93,  223,
      228,  228,  231,  231,  231,  228,  232,   92,  235,  232,

      232,  235,   91,  241,  224,   90,  241,  235,  235,  235,
      236,  225,   89,  236,  236,  239,  241,   88,  239,  236,
      236,  236,   86,   84,  239,  239,  239,  240,  240,  240,
      243,  244,  245,  243,  244,  245,  249,   82,   81,  249,
      244,  244,  244,  243,  247,  245,  248,  247,  249,  248,
       80,  247,  251,  248,   79,  251,  251,  247,  270,  248,
      254,  270,  255,  254,  254,  255,  255,  258,   78,   77,
      258,  270,  261,   60,  258,  261,  265,  265,  265,  258,
      258,  261,  261,  261,   58,  248,  269,  269,  269,   57,
       55,  247,  251,   43,  251,   42,  254,   41,  255,  266,

      258,   37,  266,  268,  272,   36,  268,  272,  266,  266,
      266,   35,  268,  268,  268,  273,  274,  272,  273,  274,
       31,  277,  273,  274,  277,  277,   30,  278,  273,  274,
      278,  278,  281,  284,  288,  281,  284,  288,  288,  281,
      289,   29,   28,  289,  281,  281,  290,  293,   27,  290,
      293,  293,  290,  289,  290,  294,   24,  295,  294,  294,
      295,  305,  305,  305,  295,   23,  278,   21,  277,  295,
      295,  299,   15,  281,  299,  284,  315,  315,  315,    9,
      299,  299,  299,  302,    0,  304,  302,  302,  304,  308,
        0,  304,  308,  304,  313,  316,  308,  313,  316,  316,

        0,    0,  308,  313,  313,  313,  317,    0,  316,  317,
      317,  320,    0,  317,  320,  320,    0,  322,    0,  317,
      322,  322,  323,    0,  324,  323,  323,  324,  324,  308,
      332,  308,    0,  332,  332,  316,  325,  316,  328,  325,
      325,  328,  328,  325,    0,  328,  317,    0,  317,  325,
        0,  328,  326,  320,  326,  326,  326,  326,    0,  326,
        0,  323,    0,  324,  327,  326,  334,  327,  327,  334,
      334,    0,    0,  327,  327,  327,  329,  328,  335,  329,
      329,  335,  335,  329,  336,    0,    0,  336,  336,  329,
      337,    0,  334,  337,  337,  338,  334,  338,  338,  338,

      338,  339,  338,    0,  339,  339,    0,  341,  338,  350,
      341,  341,  350,  350,  339,  329,  341,  341,  341,  342,
      336,  342,  342,  342,  342,  340,  337,  340,  340,  340,
      340,  343,  340,  349,  343,  343,  349,  349,  340,    0,
      343,  343,  343,  344,  343,  345,  344,  344,  345,  345,
      344,  351,  345,    0,  351,  351,  344,  352,  345,  353,
      352,  352,  353,    0,    0,    0,  353,  354,  349,    0,
      354,  354,  353,    0,    0,    0,  354,  354,  354,  344,
      355,  345,  364,  355,  355,  364,  364,    0,    0,  355,
      355,  355,    0,  355,    0,    0,  352,  356,  351,  356,

      356,  356,  356,  357,    0,  357,  357,  357,  357,  359,
        0,  360,  359,  359,  360,  360,  359,  365,  360,    0,
      365,  365,  359,  366,  360,  367,  366,  366,  367,  367,
      368,    0,  367,  368,  368,    0,  371,  368,  367,  371,
      371,    0,    0,  368,    0,    0,    0,    0,    0,    0,
      360,    0,    0,    0,    0,    0,  359,  379,  379,  379,
      379,  379,  379,  380,  380,    0,  380,  380,  380,  381,
      381,  381,  381,  381,  381,  382,    0,    0,    0,  382,
      382,  383,  383,    0,    0,  383,  383,  384,    0,    0,
      384,  385,  385,    0,    0,  385,  385,  386,  386,    0,

        0,  386,  386,  387,  387,    0,  387,  387,  388,  388,
        0,    0,  388,  388,  389,  389,    0,    0,  389,  389,
      390,  390,    0,    0,  390,  390,  391,  391,    0,  391,
      391,  391,  392,  392,    0,  392,  392,  393,  393,    0,
        0,  393,  393,  394,  394,    0,  394,  394,  395,  395,
        0,  395,  395,  396,  396,    0,    0,  396,  396,  397,
      397,    0,  397,  397,  398,  398,    0,    0,  398,  398,
      399,  399,    0,    0,  399,  399,  400,  400,    0,    0,
      400,  400,  401,  401,    0,  401,  401,  401,  402,  402,
        0,  402,  402,  403,  403,    0,  403,  403,  403,  404,

      404,    0,    0,  404,  404,  405,  405,    0,  405,  405,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "./cfg.l"
#define INITIAL 0
#line 2 "./cfg.l"
/*
 * Cfg file reader, Greg Lee, 8/93.
 * Adapted from Adagio for KMidi 12/99.
 *	$Id: cfg.cpp,v 1.9 2000/08/08 18:21:55 faure Exp $
 */
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "instrum.h"
#include "playmidi.h"
#include "readmidi.h"
#include "output.h"
#include "controls.h"
#include "tables.h"
#include "version.h"

#define YY_ALWAYS_INTERACTIVE 0
#define YY_NEVER_INTERACTIVE 1

#define YY_INPUT(buf,result,max_size) \
	 result = fread( buf, 1, max_size, yyin );

extern int set_play_mode(char *cp);
static int prescanning;
static char doing_drums = 0;
static char doing_sf = 0;
static int patchno = -1;
static int i, j;
static char *patchname;
static char cfg_flag = 1;
static int tone_bank;
static void set_patchno(char *m);

static char *s_dirname = 0;
static char *sfname = 0;

static int current_toneset = 0;
static int current_drumset = 0;

static int cfg_condition = -1;

static ToneBank *bank=0;
static int banknum=0;
static int rcf_count=1;
static int font_type=FONT_NORMAL;


#define MAX_INCLUDE_DEPTH 40
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
static int include_stack_ptr = 0;

static void new_toneset(int n);
static void new_patch(const char *vname, int num);

#define YY_NO_UNPUT 1
#define P 1
#define K 2
#define S 3


/* Macros after this point can all be overridden by user definitions in
 * section 1.
 */

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap YY_PROTO(( void ));
#else
extern int yywrap YY_PROTO(( void ));
#endif
#endif

#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif

#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif

#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif

#if YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#endif

#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif

#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines.  This will fail
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
 * or sizeof(void*) != sizeof(int).
 */
#endif
#endif

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif

/* Copy whatever the last rule matched to the standard output. */

#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif

/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
	if ( yy_current_buffer->yy_is_interactive ) \
		{ \
		int c = '*', n; \
		for ( n = 0; n < max_size && \
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( yyin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
		  && ferror( yyin ) ) \
		YY_FATAL_ERROR( "input in flex scanner failed" );
#endif

/* No semi-colon after return; correct usage is to write "yyterminate();" -
 * we don't want an extra ';' after the "return" because that will cause
 * some compilers to complain about unreachable statements.
 */
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif

/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif

/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif

/* Code executed at the beginning of each rule, after yytext and yyleng
 * have been set up.
 */
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif

#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
		yy_current_buffer->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

YY_DECL
	{
	register yy_state_type yy_current_state;
	register char *yy_cp = NULL, *yy_bp = NULL;
	register int yy_act;

#line 71 "./cfg.l"



	if ( yy_init )
		{
		yy_init = 0;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

		if ( ! yy_start )
			yy_start = 1;	/* first start state */

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( ! yy_current_buffer )
			yy_current_buffer =
				yy_create_buffer( yyin, YY_BUF_SIZE );

		yy_load_buffer_state();
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
		yy_cp = yy_c_buf_p;

		/* Support of yytext. */
		*yy_cp = yy_hold_char;

		/* yy_bp points to the position in yy_ch_buf of the start of
		 * the current run.
		 */
		yy_bp = yy_cp;

		yy_current_state = yy_start;
		yy_current_state += YY_AT_BOL();
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				yy_last_accepting_state = yy_current_state;
				yy_last_accepting_cpos = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
				if ( yy_current_state >= 379 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
		while ( yy_current_state != 378 );
		yy_cp = yy_last_accepting_cpos;
		yy_current_state = yy_last_accepting_state;

yy_find_action:
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;


do_action:	/* This label is used only to access EOF actions. */


		switch ( yy_act )
	{ /* beginning of action switch */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = yy_hold_char;
			yy_cp = yy_last_accepting_cpos;
			yy_current_state = yy_last_accepting_state;
			goto yy_find_action;

case 1:
YY_RULE_SETUP
#line 73 "./cfg.l"
;
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 74 "./cfg.l"
;
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 76 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 2;
	cfg_condition = atoi(yytext+i);
}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 82 "./cfg.l"
{
	cfg_condition = 0;
}
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 85 "./cfg.l"
{
	int sf_oldbank, sf_newbank = banknum;
	int i = 0, j;
	while (isspace(yytext[i])) i++;
	if (yytext[i+1] == 'f') i += 2;
	else i += 3;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == '"') {
		i++;
		for (j = i; j < yyleng && yytext[j] != '"'; j++) ;
		j--;
	}
	else for (j = i; j < yyleng && !isspace(yytext[j]); j++) ;
	sfname = strncpy( (char *)malloc(j-i+1), yytext+i, j-i );
	sfname[j-i] = '\0';
	if (doing_drums) sf_newbank += 256;
	sf_oldbank = sf_newbank;
	if (j < yyleng) {
		while (j < yyleng && isspace(yytext[j])) j++;
		if (j < yyleng && isdigit(yytext[j])) sf_oldbank = atoi(yytext+j);
	}
	init_soundfont(sfname, sf_oldbank, sf_newbank, rcf_count);
}
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 108 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == 'd') i += 3;
	else i += 9;
	while (isspace(yytext[i])) i++;
	s_dirname = strcpy( (char *)malloc(strlen(yytext+i)+1), yytext+i );
	add_to_pathlist(s_dirname, rcf_count);
	free(s_dirname);
}
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 118 "./cfg.l"
{
	char *fname;
	int i = 0;
	FILE *save_yyin;

	while (isspace(yytext[i])) i++;
	i += 6;
	while (isspace(yytext[i])) i++;

	 if (prescanning && cfg_condition >= 0 && cfg_condition < 30 &&
		rcf_count==1 && !cfg_names[cfg_condition])
	  {
	    cfg_names[cfg_condition] = (char *)safe_malloc(strlen(yytext+i)+1);
	    strcpy(cfg_names[cfg_condition], yytext+i);
	  }

    if (!prescanning && (cfg_condition < 0 || cfg_condition == cfg_select)) {


        if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
		 "Probable source loop in configuration files");
		return (-1);
        }
        include_stack[include_stack_ptr++] =
                YY_CURRENT_BUFFER;

	fname = strcpy( (char *)malloc(strlen(yytext+i)+1), yytext+i );

	save_yyin = yyin;
	yyin = NULL;

	yyin = open_file(fname, 1, OF_VERBOSE, rcf_count);

	if (yyin == NULL) {
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
		 "Source file %s not found\n", fname);
		include_stack_ptr--;
	}

	if (yyin == NULL) yyin = save_yyin;
	else {
            cfg_condition = -1;
	    rcf_count++;
            yy_switch_to_buffer(
                yy_create_buffer( yyin, YY_BUF_SIZE ) );
	}
    }
    cfg_condition = -1;
}  
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(P):
case YY_STATE_EOF(K):
case YY_STATE_EOF(S):
#line 169 "./cfg.l"
{
        if ( --include_stack_ptr < 0 ) {
                yyterminate();
        }
        else {
		if (yyin) close_file(yyin);
                yy_delete_buffer( YY_CURRENT_BUFFER );
		rcf_count--;
                yy_switch_to_buffer(
                     include_stack[include_stack_ptr] );
        }
}
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 182 "./cfg.l"
{
	char *bank_name = NULL;
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 1;
	new_toneset(current_drumset);
	font_type=FONT_SBK;
    if (!bank->name) {
	while (isspace(yytext[i])) i++;
	while (isdigit(yytext[i])) i++;
	while (isspace(yytext[i])) i++;
	if (yytext[i+1] == 'f') i += 2; else i += 3;
	while (isspace(yytext[i])) i++;
	patchname = yytext + i;
	if (patchname[0] == '"') {
		bank_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
		bank_name[strlen(patchname)-2] = '\0';
	}
	else bank_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
	bank->name = bank_name;
    }

}
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 208 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 1;
	new_toneset(current_drumset);
	font_type=FONT_SBK;
}
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 218 "./cfg.l"
{
	char *bank_name = NULL;
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset);
	font_type=FONT_NORMAL;
    if (!bank->name) {
	while (isspace(yytext[i])) i++;
	while (isdigit(yytext[i])) i++;
	while (isspace(yytext[i])) i++;
	patchname = yytext + i;
	if (patchname[0] == '"') {
		bank_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
		bank_name[strlen(patchname)-2] = '\0';
	}
	else bank_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
	bank->name = bank_name;
    }
}
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 241 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset);
	font_type=FONT_NORMAL;
}
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 251 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 4;
	current_toneset = atoi(yytext+i);
	doing_drums = 0;
	doing_sf = 1;
	new_toneset(current_toneset);
	font_type=FONT_SBK;
}
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 261 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 4;
	current_toneset = atoi(yytext+i);
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset);
	font_type=FONT_NORMAL;
}
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 271 "./cfg.l"
{
	current_toneset = SFXBANK;
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset);
	font_type=FONT_NORMAL;
}
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 278 "./cfg.l"
{
	current_drumset = SFXDRUM1;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_toneset);
	font_type=FONT_NORMAL;
	bank->name = "drumsfx1";
}
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 286 "./cfg.l"
{
	current_drumset = SFXDRUM2;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_toneset);
	font_type=FONT_NORMAL;
	bank->name = "drumsfx2";
}
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 295 "./cfg.l"
{
	doing_drums = 0;
}
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 298 "./cfg.l"
{
	doing_drums = 1;
	current_drumset = current_toneset;
}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 303 "./cfg.l"
{
	const char *gm_name = NULL;
	char *vc_name = NULL;
	patchno = atoi(yytext);
	tone_bank = 0;
	if (patchno >= 0) {
		i = 0;
		while (isspace(yytext[i])) i++;
		while (isdigit(yytext[i])) i++;
		if (yytext[i] == ',') {
			i++;
			tone_bank = atoi(yytext + i);
			while (isdigit(yytext[i])) i++;
		}
		else {
			if (doing_drums) tone_bank = current_drumset;
			else tone_bank = current_toneset;
		}
		new_toneset(tone_bank);

		while (isspace(yytext[i])) i++;
		if (!cfg_flag && yytext[i] == '=') i++;
		if ( (patchname = strrchr(yytext + i, '\\')) == NULL)
			patchname = yytext + i;
		else patchname++;
		if (patchname[0] == '"') {
			vc_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
			vc_name[strlen(patchname)-2] = '\0';
		}
		else vc_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
		if (patchno < 128) gm_name = gm_voice[doing_drums? patchno+128 : patchno].vname;
		else {
		    ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Bad patch number %d in cfg file.", patchno);
		}
		if (gm_name == NULL) gm_name = (doing_drums)? "drum":"instr";

	        ctl->cmsg(CMSG_INFO, VERB_DEBUG, "config: voice %s[%d,%d] = patch %s",
			gm_name, patchno, tone_bank, vc_name);

		new_patch(vc_name, patchno);

	}
	BEGIN(P);
}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 348 "./cfg.l"
{
	const char *gm_name = NULL;
	char *vc_name = NULL;
	int i;
	set_patchno(yytext);
	tone_bank = 0;
	if (patchno < 256) {
		i = 0;
		while (yytext[i] != '=' && yytext[i] != ',') i++;
		if (yytext[i] == ',') {
			i++;
			tone_bank = atoi(yytext + i);
		}
		else {
			if (doing_drums) tone_bank = current_drumset;
			else tone_bank = current_toneset;
		}

		while (yytext[i] != '=') i++;
		i++;
		while (isspace(yytext[i])) i++;
		if ( (patchname = strrchr(yytext + i, '\\')) == NULL)
			patchname = yytext + i;
		else patchname++;
		if (patchname[0] == '"') {
			vc_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
			vc_name[strlen(patchname)-2] = '\0';
		}
		else vc_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
		gm_name = gm_voice[patchno].vname;
		if (gm_name == NULL) gm_name = (doing_drums)? "drum":"instr";

	        ctl->cmsg(CMSG_INFO, VERB_DEBUG, "config: voice %s[%d,%d] = patch %s",
			gm_name, patchno, tone_bank, vc_name);

	}
	else {
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Bad line \"%s ...\" in cfg file.", yytext);
	}
	new_patch(vc_name, patchno);
	
	BEGIN(P);
}
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 392 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j > 1 && j < MAX_VOICES) voices = j;
	} }
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 397 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j > 1 && j < MAX_AMPLIFICATION) amplification = j;
	} }
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 402 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j > 1 && j < MAX_CONTROL_RATIO) control_ratio = j;
	} }
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 407 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j < 100) j *= 1000;
		if (j > MIN_OUTPUT_RATE && j < MAX_OUTPUT_RATE) play_mode->rate = j;
	} }
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 413 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		max_patch_memory = j * 1000000;
	} }
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 418 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 3) current_interpolation = j;
	} }
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 423 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 2) opt_expression_curve = j;
	} }
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 428 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 2) opt_volume_curve = j;
	} }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 433 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		i+=2;
		while(isspace(yytext[i])) i++;
		if (set_play_mode(yytext+i)) /* error */;
	} }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 440 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') i++;
	bank->tone[patchno].amp = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 446 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') i++;
	bank->tone[patchno].note = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 452 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') i++;
	bank->tone[patchno].tuning = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 458 "./cfg.l"
BEGIN(K);
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 459 "./cfg.l"
BEGIN(S);
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 461 "./cfg.l"
{
		  bank->tone[patchno].strip_loop=0;
	BEGIN(P);
}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 465 "./cfg.l"
{
		  bank->tone[patchno].strip_tail=0;
	BEGIN(P);
}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 469 "./cfg.l"
{
		  bank->tone[patchno].strip_envelope=0;
	BEGIN(P);
}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 473 "./cfg.l"
{
		  bank->tone[patchno].strip_loop=1;
	BEGIN(P);
}
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 477 "./cfg.l"
{
		  bank->tone[patchno].strip_tail=1;
	BEGIN(P);
}
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 481 "./cfg.l"
{
		  bank->tone[patchno].strip_envelope=1;
	BEGIN(P);
}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 485 "./cfg.l"
{
	set_patchno(yytext);
	if (patchno < 256) gm_voice[patchno].flags &= ~SOLO_MASK;
}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 489 "./cfg.l"
{
	set_patchno(yytext);
	if (patchno < 256) gm_voice[patchno].flags |= SOLO_MASK;
}
	YY_BREAK
case 43:
#line 495 "./cfg.l"
case 44:
YY_RULE_SETUP
#line 495 "./cfg.l"
{
	patchno = -1;
	BEGIN(0);
}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 499 "./cfg.l"
ECHO;
	YY_BREAK

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;

		/* Undo the effects of YY_DO_BEFORE_ACTION. */
		*yy_cp = yy_hold_char;
		YY_RESTORE_YY_MORE_OFFSET

		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed yyin at a new source and called
			 * yylex().  If so, then we have to assure
			 * consistency between yy_current_buffer and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			yy_n_chars = yy_current_buffer->yy_n_chars;
			yy_current_buffer->yy_input_file = yyin;
			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
			}

		/* Note that here we test for yy_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since yy_c_buf_p will
		 * already have been incremented past the NUL character
		 * (since all states make transitions on EOB to the
		 * end-of-buffer state).  Contrast this with the test
		 * in input().
		 */
		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			{ /* This was really a NUL. */
			yy_state_type yy_next_state;

			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state();

			/* Okay, we're now positioned to make the NUL
			 * transition.  We couldn't have
			 * yy_get_previous_state() go ahead and do it
			 * for us because it doesn't know how to deal
			 * with the possibility of jamming (and we don't
			 * want to build jamming into it because then it
			 * will run more slowly).
			 */

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = yytext_ptr + YY_MORE_ADJ;

			if ( yy_next_state )
				{
				/* Consume the NUL. */
				yy_cp = ++yy_c_buf_p;
				yy_current_state = yy_next_state;
				goto yy_match;
				}

			else
				{
				yy_cp = yy_last_accepting_cpos;
				yy_current_state = yy_last_accepting_state;
				goto yy_find_action;
				}
			}

		else switch ( yy_get_next_buffer() )
			{
			case EOB_ACT_END_OF_FILE:
				{
				yy_did_buffer_switch_on_eof = 0;

				if ( yywrap() )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * yytext, we can now set up
					 * yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * YY_NULL, it'll still work - another
					 * YY_NULL will get returned.
					 */
					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

				else
					{
					if ( ! yy_did_buffer_switch_on_eof )
						YY_NEW_FILE;
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
				yy_c_buf_p =
					yytext_ptr + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_match;

			case EOB_ACT_LAST_MATCH:
				yy_c_buf_p =
				&yy_current_buffer->yy_ch_buf[yy_n_chars];

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_find_action;
			}
		break;
		}

	default:
		YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	} /* end of action switch */
		} /* end of scanning one token */
	} /* end of yylex */


/* yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */

static int yy_get_next_buffer()
	{
	register char *dest = yy_current_buffer->yy_ch_buf;
	register char *source = yytext_ptr;
	register int number_to_move, i;
	int ret_val;

	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( yy_current_buffer->yy_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
			{
			/* We matched a single character, the EOB, so
			 * treat this as a final EOF.
			 */
			return EOB_ACT_END_OF_FILE;
			}

		else
			{
			/* We matched some text prior to the EOB, first
			 * process it.
			 */
			return EOB_ACT_LAST_MATCH;
			}
		}

	/* Try to read more data. */

	/* First move last chars to start of buffer. */
	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;

	for ( i = 0; i < number_to_move; ++i )
		*(dest++) = *(source++);

	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
		/* don't do the read, it's not guaranteed to return an EOF,
		 * just force an EOF
		 */
		yy_current_buffer->yy_n_chars = yy_n_chars = 0;

	else
		{
		int num_to_read =
			yy_current_buffer->yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
			YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else

			/* just a shorter name for the current buffer */
			YY_BUFFER_STATE b = yy_current_buffer;

			int yy_c_buf_p_offset =
				(int) (yy_c_buf_p - b->yy_ch_buf);

			if ( b->yy_is_our_buffer )
				{
				int new_size = b->yy_buf_size * 2;

				if ( new_size <= 0 )
					b->yy_buf_size += b->yy_buf_size / 8;
				else
					b->yy_buf_size *= 2;

				b->yy_ch_buf = (char *)
					/* Include room in for 2 EOB chars. */
					yy_flex_realloc( (void *) b->yy_ch_buf,
							 b->yy_buf_size + 2 );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = 0;

			if ( ! b->yy_ch_buf )
				YY_FATAL_ERROR(
				"fatal error - scanner input buffer overflow" );

			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = yy_current_buffer->yy_buf_size -
						number_to_move - 1;
#endif
			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
			yy_n_chars, num_to_read );

		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	if ( yy_n_chars == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			yyrestart( yyin );
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
			yy_current_buffer->yy_buffer_status =
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	yy_n_chars += number_to_move;
	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;

	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];

	return ret_val;
	}


/* yy_get_previous_state - get the state just before the EOB char was reached */

static yy_state_type yy_get_previous_state()
	{
	register yy_state_type yy_current_state;
	register char *yy_cp;

	yy_current_state = yy_start;
	yy_current_state += YY_AT_BOL();

	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
		{
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			yy_last_accepting_state = yy_current_state;
			yy_last_accepting_cpos = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 379 )
				yy_c = yy_meta[(unsigned int) yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
		}

	return yy_current_state;
	}


/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
	{
	register int yy_is_jam;
	register char *yy_cp = yy_c_buf_p;

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		yy_last_accepting_state = yy_current_state;
		yy_last_accepting_cpos = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
		if ( yy_current_state >= 379 )
			yy_c = yy_meta[(unsigned int) yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
	yy_is_jam = (yy_current_state == 378);

	return yy_is_jam ? 0 : yy_current_state;
	}


#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
	{
	register char *yy_cp = yy_c_buf_p;

	/* undo effects of setting up yytext */
	*yy_cp = yy_hold_char;

	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = yy_n_chars + 2;
		register char *dest = &yy_current_buffer->yy_ch_buf[
					yy_current_buffer->yy_buf_size + 2];
		register char *source =
				&yy_current_buffer->yy_ch_buf[number_to_move];

		while ( source > yy_current_buffer->yy_ch_buf )
			*--dest = *--source;

		yy_cp += (int) (dest - source);
		yy_bp += (int) (dest - source);
		yy_current_buffer->yy_n_chars =
			yy_n_chars = yy_current_buffer->yy_buf_size;

		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
			YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	*--yy_cp = (char) c;


	yytext_ptr = yy_bp;
	yy_hold_char = *yy_cp;
	yy_c_buf_p = yy_cp;
	}
#endif	/* ifndef YY_NO_UNPUT */


#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
	{
	int c;

	*yy_c_buf_p = yy_hold_char;

	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
		{
		/* yy_c_buf_p now points to the character we want to return.
		 * If this occurs *before* the EOB characters, then it's a
		 * valid NUL; if not, then we've hit the end of the buffer.
		 */
		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			/* This was really a NUL. */
			*yy_c_buf_p = '\0';

		else
			{ /* need more input */
			int offset = yy_c_buf_p - yytext_ptr;
			++yy_c_buf_p;

			switch ( yy_get_next_buffer() )
				{
				case EOB_ACT_LAST_MATCH:
					/* This happens because yy_g_n_b()
					 * sees that we've accumulated a
					 * token and flags that we need to
					 * try matching the token before
					 * proceeding.  But for input(),
					 * there's no matching to consider.
					 * So convert the EOB_ACT_LAST_MATCH
					 * to EOB_ACT_END_OF_FILE.
					 */

					/* Reset buffer status. */
					yyrestart( yyin );

					/* fall through */

				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap() )
						return EOF;

					if ( ! yy_did_buffer_switch_on_eof )
						YY_NEW_FILE;
#ifdef __cplusplus
					return yyinput();
#else
					return input();
#endif
					}

				case EOB_ACT_CONTINUE_SCAN:
					yy_c_buf_p = yytext_ptr + offset;
					break;
				}
			}
		}

	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
	*yy_c_buf_p = '\0';	/* preserve yytext */
	yy_hold_char = *++yy_c_buf_p;

	yy_current_buffer->yy_at_bol = (c == '\n');

	return c;
	}


#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
	{
	if ( ! yy_current_buffer )
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );

	yy_init_buffer( yy_current_buffer, input_file );
	yy_load_buffer_state();
	}


#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
	{
	if ( yy_current_buffer == new_buffer )
		return;

	if ( yy_current_buffer )
		{
		/* Flush out information for old buffer. */
		*yy_c_buf_p = yy_hold_char;
		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	yy_current_buffer = new_buffer;
	yy_load_buffer_state();

	/* We don't actually know whether we did this switch during
	 * EOF (yywrap()) processing, but the only time this flag
	 * is looked at is after yywrap() is called, so it's safe
	 * to go ahead and always set it.
	 */
	yy_did_buffer_switch_on_eof = 1;
	}


#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
	{
	yy_n_chars = yy_current_buffer->yy_n_chars;
	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
	yyin = yy_current_buffer->yy_input_file;
	yy_hold_char = *yy_c_buf_p;
	}


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
	{
	YY_BUFFER_STATE b;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
	}


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
	{
	if ( ! b )
		return;

	if ( b == yy_current_buffer )
		yy_current_buffer = (YY_BUFFER_STATE) 0;

	if ( b->yy_is_our_buffer )
		yy_flex_free( (void *) b->yy_ch_buf );

	yy_flex_free( (void *) b );
	}


#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif

#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif


	{
	yy_flush_buffer( b );

	b->yy_input_file = file;
	b->yy_fill_buffer = 1;

#if YY_ALWAYS_INTERACTIVE
	b->yy_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
	b->yy_is_interactive = 0;
#else
	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
	}


#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
#else
void yy_flush_buffer( b )
YY_BUFFER_STATE b;
#endif

	{
	if ( ! b )
		return;

	b->yy_n_chars = 0;

	/* We always need two end-of-buffer characters.  The first causes
	 * a transition to the end-of-buffer state.  The second causes
	 * a jam in that state.
	 */
	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

	b->yy_buf_pos = &b->yy_ch_buf[0];

	b->yy_at_bol = 1;
	b->yy_buffer_status = YY_BUFFER_NEW;

	if ( b == yy_current_buffer )
		yy_load_buffer_state();
	}


#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
char *base;
yy_size_t size;
#endif
	{
	YY_BUFFER_STATE b;

	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return 0;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );

	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
	b->yy_buf_pos = b->yy_ch_buf = base;
	b->yy_is_our_buffer = 0;
	b->yy_input_file = 0;
	b->yy_n_chars = b->yy_buf_size;
	b->yy_is_interactive = 0;
	b->yy_at_bol = 1;
	b->yy_fill_buffer = 0;
	b->yy_buffer_status = YY_BUFFER_NEW;

	yy_switch_to_buffer( b );

	return b;
	}
#endif


#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
	{
	int len;
	for ( len = 0; yy_str[len]; ++len )
		;

	return yy_scan_bytes( yy_str, len );
	}
#endif


#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
#else
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *bytes;
int len;
#endif
	{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;

	/* Get memory for full buffer, including space for trailing EOB's. */
	n = len + 2;
	buf = (char *) yy_flex_alloc( n );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

	for ( i = 0; i < len; ++i )
		buf[i] = bytes[i];

	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;

	b = yy_scan_buffer( buf, n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );

	/* It's okay to grow etc. this buffer, and we should throw it
	 * away when we're done.
	 */
	b->yy_is_our_buffer = 1;

	return b;
	}
#endif


#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
	{
	if ( yy_start_stack_ptr >= yy_start_stack_depth )
		{
		yy_size_t new_size;

		yy_start_stack_depth += YY_START_STACK_INCR;
		new_size = yy_start_stack_depth * sizeof( int );

		if ( ! yy_start_stack )
			yy_start_stack = (int *) yy_flex_alloc( new_size );

		else
			yy_start_stack = (int *) yy_flex_realloc(
					(void *) yy_start_stack, new_size );

		if ( ! yy_start_stack )
			YY_FATAL_ERROR(
			"out of memory expanding start-condition stack" );
		}

	yy_start_stack[yy_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
	}
#endif


#ifndef YY_NO_POP_STATE
static void yy_pop_state()
	{
	if ( --yy_start_stack_ptr < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN(yy_start_stack[yy_start_stack_ptr]);
	}
#endif


#ifndef YY_NO_TOP_STATE
static int yy_top_state()
	{
	return yy_start_stack[yy_start_stack_ptr - 1];
	}
#endif

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

#ifdef YY_USE_PROTOS
static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
	{
	(void) fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
	}



/* Redefine yyless() so it works in section 3 code. */

#undef yyless
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		yytext[yyleng] = yy_hold_char; \
		yy_c_buf_p = yytext + n; \
		yy_hold_char = *yy_c_buf_p; \
		*yy_c_buf_p = '\0'; \
		yyleng = n; \
		} \
	while ( 0 )


/* Internal utility routines. */

#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
yyconst char *s2;
int n;
#endif
	{
	register int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
	}
#endif

#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
#else
static int yy_flex_strlen( s )
yyconst char *s;
#endif
	{
	register int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
	}
#endif


#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
	{
	return (void *) malloc( size );
	}

#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
yy_size_t size;
#endif
	{
	/* The cast to (char *) in the following accommodates both
	 * implementations that use char* generic pointers, and those
	 * that use void* generic pointers.  It works with the latter
	 * because both ANSI C and C++ allow castless assignment from
	 * any pointer type to void*, and deal with argument conversions
	 * as though doing an assignment.
	 */
	return (void *) realloc( (char *) ptr, size );
	}

#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
	{
	free( ptr );
	}

#if YY_MAIN
int main()
	{
	yylex();
	return 0;
	}
#endif
#line 499 "./cfg.l"


static void new_toneset(int n)
{
	banknum=n;

	if (!doing_drums) {
	  if (!tonebank[n]) {
		tonebank[n]=(ToneBank *)safe_malloc(sizeof(ToneBank));
	      	memset(tonebank[n], 0, sizeof(ToneBank));
	  }
	  bank=tonebank[n];
	}
	else {
	  if (!drumset[n]) {
		drumset[n]=(ToneBank *)safe_malloc(sizeof(ToneBank));
	      	memset(drumset[n], 0, sizeof(ToneBank));
	  }
	  bank=drumset[n];
	}
}

static void new_patch(const char *vname, int num)
{
	if (bank->tone[num].name) return;
	bank->tone[num].name=vname;
	bank->tone[num].note=bank->tone[num].amp=bank->tone[num].pan=
	  bank->tone[num].strip_loop=bank->tone[num].strip_envelope=
	    bank->tone[num].sf_ix=
	    bank->tone[num].strip_tail=bank->tone[num].last_used=-1;
	bank->tone[num].font_type=font_type;
	bank->tone[num].tuning=0;
	bank->tone[num].layer=0;
}

static void set_patchno(char *m)
{
	int i,j,w,y;
	const char *vn;
	y = w = 0;
	while (isspace(m[w])) w++;
	for (i = 0; i < 256; i++) {
		vn = gm_voice[i].vname;
		if (vn == NULL) continue;
		for (j = 0; m[j+w] && vn[j+y] && m[j+w] == vn[j+y]; j++)
		    if (vn[j+y+1] && isspace(vn[j+y+1]) && m[j+w+1] && !isspace(m[j+w+1]) ) y++ ;
		if (!m[j+w] || m[j+w] == '=' || m[j+w] == ',' || m[j+w] == ':') break;
		if (!vn[j+y] && isspace(m[j+w])) break;
	}
	if (i < 256 && vn != NULL) patchno = i;
	else patchno = 256;
}


char *current_config_file = 0;

int read_config_file(const char *name, int prescan)
{
	int retvalue;
	prescanning = prescan;
	include_stack_ptr = 0;
	rcf_count = 1;

	if (prescanning) {
	   current_config_file = (char *)safe_malloc(strlen(name)+1);
	   strcpy(current_config_file, name);
	}

	yyin = open_file(name, 1, OF_VERBOSE, rcf_count);
	if (!yyin) return -1;

	current_toneset = current_drumset = 0;
	doing_drums = doing_sf = 0;
	if (!(retvalue = yylex())) {
	   if (prescan) got_a_configuration = 1;
	   else got_a_configuration = 2;
	}
	close_file(yyin);
	return retvalue;
}
