[home] [<-back] [index] [next->]
____________________________________________________________________ [17:. - [ Fun with noise in QBASIC ] [niemand1] :. ] [niemand1@b0g.org] :. ] ____________________________________________________________________ Note: you need an internal PC speaker for this to work on your computer, otherwise nothing will happen and it will just be damn boring. Here is my program: 'Funny Sounds By: niemand1 4/27/2000 CLS DO frequency% = RND * 1000 IF frequency% < 37 THEN frequency% = 37 duration% = 1 SOUND frequency%, duration% LOOP UNTIL INKEY$ = CHR$(27) END What it does: CLS (clears text from DOS) DO (Begins a loop process) frequency% = RND * 1000 (Makes a random number between 1 and 1000) IF frequency% < 37 THEN frequency% = 37 (I'll explain this later) duration% = 1 (Value can be changed to make each sound longer) SOUND frequency%, duration% (Plays a sound of specified freq. and dur.) LOOP UNTIL INKEY$ = CHR$(27) (Loops until esc key is pressed) END This program makes a random number between 1 and 1000 and uses that number as a frequency to play through the computers PC speaker, then repeats the process until you hit the esc key. When run it makes a ton of annoying sounds that might drive your parents insane, when they start yelling, hit the esc key so you are not hit in the face. What can you do with this program? I have no fucking clue, but I just think it's a funny way to learn the sound command. The reason for the fourth line is this: If you try to play a sound in a frequency lower than 37 the program craps up because the computer won't allow sounds of those low frequencys. Why? I have no idea, but if you figure it out, e-mail me at niemand1@hotmail.com. You can change the value of the third line to do make lower frequency sounds only, or change it to as high as 32,767. If you set it for 32.767, you might get some high pitched sounds that annoy the hell out of animals sensitive to noise, not recommended to dog owners. If you set it for any higher than 32,767, the program will crap up because your computer can't handle sounds any higher pitched than that. You can change the value of duration% to make the short sounds play longer, but it does not sound as funny. Oh yeah, one more thing: I made this program messed up on 240 miligrams of DXM in case you were wondering where I get psychotic ideas like this. I thought it was pretty damn funny while I was tripping and saved it. b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@! b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@! b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@! b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@! b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!b0g!#@!