#include #include #define MYNAME "ctronome" #define VERSION "0.5.5" #define CREDITS "homepage: http://ctronome.kign.org/\n" /* set up these three variables to your system */ static char *metronomewav1 = "/usr/local/share/ctronome/metronome1.wav\0"; static char *metronomewav2 = "/usr/local/share/ctronome/metronome2.wav\0"; static char *dspdev = "/dev/dsp\0"; /* means: 1/4, 1/8 etc. */ static int default_base_note = 4; char *programfile; #define HELP "usage: ctronome \n\ valid parameters are:\n\ -b beat per minute\n\ -t beat per tact\n\ -p program file\n\ -c play tact/program times then exit\n\ -w1 wav to use for first beat of tact\n\ -w2 wav to use for other beat of tact\n\ -d dsp device\n\ -h display this help screen\n\ -v print version\n\ e.g: ctronome -b 60 -t 4\n\ for defaults/limits and required WAV format see README\n" /* my lazy type definitions */ typedef uint32_t DWORD; typedef uint16_t WORD; typedef uint8_t BYTE; typedef DWORD dword; typedef WORD word; typedef BYTE byte; word dsp_channels; dword dsp_speed; word dsp_format; byte dsp_depth; static int count = 1; /* tact counter */ static int pcount = 1; /* repeat tact/program pcount times then exit 0 = endless */ static int pdecrease = 0; static int bpm[2] = {60,4}; /* 60 bpm is given for 1/4 notes */ static int bpt[2] = {1,4}; /* beat per tact */ static byte slash = 47; /* the / character */ static byte hashmark = 35; /* the # character */ static byte space = 32; /* the character */ int dsp_init(byte *,word,word,dword); void next_program(FILE *); /* process the next line of program */ void parm_init(int, char *[]); void dsp_close(byte); void dsp_write(byte, byte *, dword); byte debug;