#include #include #include #include #include #include #define WAITFACTOR 140 int main() { nice(-1); unsigned int length; scanf("%i",&length); printf("Sample length: %i\n", length); int i = 0; int s; int sample[length]; while((scanf("%i",&s) != EOF) && (i < length)) { sample[i++] = s; } int *p; int fd = open("/dev/tty0", O_RDONLY); int value, arg, c; for(p = &sample[0]; p < &sample[0] + length; p ++) { value = *p; c = 0; arg = (value << 16) + 3000; ioctl(fd,KDMKTONE,arg); while(c++ < (WAITFACTOR * value)) {} arg = ((100 - value) << 16) + 0; ioctl(fd,KDMKTONE,arg); while(c++ < (WAITFACTOR * 100)) {} } return 0; }