// Print a graphic map between the grand staff and midi note values. // Integer argument is n for n sharps and -n for n flats. // This is nearly ready for the obfuscated C contest. #include #include int main(int argc, char * * argv){int key = atoi(argv[1]); {int j = 30; while(j--){ int nn = ((j+21)*12+key)/7-1; int no = ((j+21)*12 )/7-1; printf("%s %d%c\n", !(j&1)?" ":abs(abs(j-15)-6) < 5?"-----":"- ", nn, nn==no?' ':'.');}} return 0;}