Sorry, you have to place it within the while loop, because the engine has to control each frame whether you are hitting the key or not.
Put in the brackets of the if-condition the following to avoid that the sound will start several times while your finger is still on the key:

while(key_cud == 1) {wait(1);}

You still have to learn very much, you have to look into the manual again and again to get an idea how each detail is working.
And, study also the articles of the issues of the AUM Magazine.

Last edited by Pappenheimer; 01/03/09 03:48. Reason: addtional remarks