I am trying to write a program that will loop infinitely until it is interrupted by a SPECIFIC key being pressed. Once pressed it will play a tone that corresponds to a note on the musical scale (8 notes).
I am unsure how to go about doing this.
I can get a single tone to loop infinitely or play each time i press the enter button, but i need it to play a different tone each time the corresponding key is pressed.
I am planning on using the Beep (x,y); function for this.
Actually trying to parse all the possibilities user can input at the command line is very *TOUGH*. In fact GUI can even be easier. However it requires one to learn a toolkit like say Qt and others. I think the closest that tread the middle line would be to use NCurses library. I think it enhances upon the old curses library.
NCurses allow one to write text user interface in a terminal independent manner. So for serious undertaking I would recommend NCurses.
Of cuz Luc Lieber do have some quick solution but the code is still terminal dependent. So Luc ever consider to switch to NCurses library instead ?
PS I know of NCurses library in this forum and thank you to that forum poster :)