home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 101.img / QB45-1.ZIP / DEMO1.BAS < prev    next >
BASIC Source File  |  1987-09-29  |  2KB  |  57 lines

  1. 5 DEFINT A-Z
  2. 10 ' BASICA/GWBASIC Version of Sound Effects Demo Program
  3. 15 '
  4. 20 ' Sound effect menu
  5. 25 Q = 2
  6. 30 WHILE Q >= 1
  7. 35     CLS
  8. 40     PRINT "Sound effects": PRINT
  9. 45     COLOR 15, 0: PRINT "  B"; : COLOR 7, 0: PRINT "ouncing"
  10. 50     COLOR 15, 0: PRINT "  F"; : COLOR 7, 0: PRINT "alling"
  11. 55     COLOR 15, 0: PRINT "  K"; : COLOR 7, 0: PRINT "laxon"
  12. 60     COLOR 15, 0: PRINT "  S"; : COLOR 7, 0: PRINT "iren"
  13. 65     COLOR 15, 0: PRINT "  Q"; : COLOR 7, 0: PRINT "uit"
  14. 70     PRINT : PRINT "Select: ";
  15. 75     Q$ = INPUT$(1): Q = INSTR("BFKSQbfksq", Q$) ' Get valid key
  16. 80     IF Q = 0 GOTO 75
  17. 85     CLS     ' Take action based on key
  18. 90     ON Q GOSUB 100, 200, 300, 400, 500, 100, 200, 300, 400, 500
  19. 95 WEND
  20. 100 ' Bounce - loop two sounds down at decreasing time intervals
  21. 105    HTONE = 32767: LTONE = 246
  22. 110    PRINT "Bouncing . . ."
  23. 115    FOR COUNT = 60 TO 1 STEP -2
  24. 120       SOUND LTONE - COUNT / 2, COUNT / 20
  25. 125       SOUND HTONE, COUNT / 15
  26. 130    NEXT COUNT
  27. 135 RETURN
  28. 200 ' Fall - loop down from a high sound to a low sound
  29. 205    HTONE = 2000: LTONE = 550: DELAY = 500
  30. 210    PRINT "Falling . . ."
  31. 215    FOR COUNT = HTONE TO LTONE STEP -10
  32. 220       SOUND COUNT, DELAY / COUNT
  33. 225    NEXT COUNT
  34. 230 RETURN
  35. 300 ' Klaxon - alternate two sounds until a key is pressed
  36. 305    HTONE = 987: LTONE = 329
  37. 310    PRINT "Oscillating . . ."
  38. 315    PRINT " . . . press any key to end."
  39. 320    WHILE INKEY$ = ""
  40. 325       SOUND HTONE, 5: SOUND LTONE, 5
  41. 330    WEND
  42. 335 RETURN
  43. 400 ' Siren - loop a sound from low to high to low
  44. 405    HTONE = 780: RANGE = 650
  45. 410    PRINT "Wailing . . ."
  46. 415    PRINT " . . . press any key to end."
  47. 420    WHILE INKEY$ = ""
  48. 425       FOR COUNT = RANGE TO -RANGE STEP -4
  49. 430          SOUND HTONE - ABS(COUNT), .3
  50. 435          COUNT = COUNT - 2 / RANGE
  51. 440       NEXT COUNT
  52. 445    WEND
  53. 450 RETURN
  54. 500 ' Quit
  55. 505 END
  56.  
  57.