problem with while loop using getch function
I'm writting a program that is supposed to play music and i'm having difficulty with turning the music on/off.
To start the music the user has the press the O key, and to turn it off they press the M key, using on_off = getch(). The music is played by using the random function to select a midi_note, and then looped using the while loop.
I can get the O button to start the loop, but then can't get the m button to stop it. I'm assuming this is because getch has already assigned O to the on_off.
Is there a way around this? Sorry, but i'm a bit of a n00b when it comes to programming