May be I'm the only computer nerd here -- if so, sorry.
Below is a C program for a metronome on Linux. It should port to other
Unix. Just
paste the program into file metro.c
cc -o metro metro.c
./metro 48
assueming you want MM=48. It may port easily to Mac OS 10.
It skips every fourth beat, as a "metronome game", to help you check your
rhythm accuracy. You can diable this: remove the line labeled "skip
every fourth beat". Or you can modify it, say, to skip every 3rd beat.
Also, it will do very slow MM values (say, 10 or 5), much lower than
MM=40 which is the usual lower limit on hard metronomes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/time.h>
void MakeABeep(int junk) {
static int call=0;
call++;
if(call%4==0) return; /* skip every fourth beep */
printf("\007"); fflush(stdout);
}
int main(int nnn,char *aaa[]) {
double seconds;
int mm,sec,usec;
struct itimerval r;
int loop;
if(nnn!=2) { printf("Usage: %s MMrate\n",aaa[0]); exit(2); }
mm=atoi(aaa[1]);
seconds=60.0/mm;
sec=seconds; usec=(seconds-sec)*1e6;
signal(SIGALRM,MakeABeep);
r.it_value.tv_sec=sec; r.it_value.tv_usec=usec;
setitimer(ITIMER_REAL,&r,NULL);
for(loop=0;;loop++) {
printf("Beep number %5d.\n",loop);
setitimer(ITIMER_REAL,&r,NULL);
sleep(100);
}
}