#include #include #include #include #include int main(int argc, char *argv[]) { int notesa[] = {554, 494, 440, 440, 554, 494, 494, 554, 494, 440, 440, 440, 440, 554, 494, 494, 554, 494, 554, 554, 494, 440, 440, 554, 494, 494, 554, 494, 440, 440, 440, 440, 554, 494, 494, 554, 494, 554, 554 }; int notesb[] = {740, 740, 740, 740, 740, 660, 660, 660, 660, 588, 588, 588, 588, 588, 660, 660, 660, 660, 660, 740, 740, 740, 740, 740, 660, 660, 660, 660, 588, 588, 588, 588, 588, 660, 660, 660, 660, 660, 740 }; int times[] = {90, 90, 180, 180, 180, 180, 180, 90, 270, 90, 90, 180, 180, 180, 180, 180, 90, 90, 180, 90, 90, 180, 180, 180, 180, 180, 90, 270, 90, 90, 180, 180, 180, 180, 180, 90, 90, 180, 360 }; int i, j, notetic, arg; int fd = open("/dev/tty0", O_RDONLY); int arptime = 30; int btime = arptime << 16; for(i = 0; i < 39; i++) { notetic = (times[i]/arptime)-1; for(j = 0; j < notetic; j++) { arg = (1193180/notesa[i]); ioctl(fd,KIOCSOUND,arg); usleep(arptime*1000); arg = (1193180/notesb[i]); ioctl(fd,KIOCSOUND,arg); usleep(arptime*1000); } ioctl(fd,KIOCSOUND,0); usleep(arptime * 900); } }