Dead Simple Music

Hi,

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.


Thanks,
Stephen
closed account (3hM2Nwbp)
Hello, you may find this thread to be of interest:

http://www.cplusplus.com/forum/general/29137/

It has methods of detecting user input in a way that I believe that you are looking for.

Best regards,
Luc
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 :)
Topic archived. No new replies allowed.