' FOR-5.BAS
' This program uses the SOUND statement inside a
'   FOR loop to generate sound effects.

CLS

PRINT , "SOUND-EFFECTS GENERATOR"
PRINT , "Please choose the sound you'd like to hear"
PRINT , "from the following menu:"
PRINT
PRINT , "1.  Ray gun"
PRINT , "2.  European siren"
PRINT , "3.  Takeoff!"
PRINT
INPUT "              Please enter 1, 2, or 3:  ", choice%
PRINT

SELECT CASE choice%
    CASE 1                      ' ray gun
        FOR i% = 1 TO 50
            SOUND 850, .3
            SOUND 800, .3
            SOUND 825, .3
        NEXT i%
    CASE 2                      ' european siren
        FOR i% = 1 TO 5
            SOUND 500, 10
            SOUND 450, 10
        NEXT i%
    CASE 3                      ' takeoff!
        FOR i% = 500 TO 2500
            SOUND i%, .03       ' uses value of i% for sound
        NEXT i%
END SELECT


