home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 February / 1989-02.d64 / sndwedge.demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  66 lines

  1. 10 rem copyright 1989 compute! publications, inc. - all rights reserved
  2. 20 poke53280,11:poke53281,11:print"[147][144]   copyright 1989 compute! pub., inc."
  3. 30 printtab(11)"all rights reserved":fori=1to1750:nexti
  4. 40 print"[147]15"
  5. 50 rem define bell sound
  6. 60 b$="[133]2 255 10207 0 9 0 0 5 "
  7. 70 rem define gunshot
  8. 80 g$="[134]4 24278 0 0 15 10 1 "
  9. 90 rem define explosion
  10. 100 e$="[135]4 536 1 0 15 12 10 "
  11. 110 rem define harp
  12. 120 h1$="[133]2 9 0 15 7 "
  13. 130 h2$="[134]2 9 7 0 0 "
  14. 140 rem note that frequency isn't included in the harp
  15. 150 rem definition. it's added later, and changes along with the length
  16. 160 print"printing b$ rings a bell...";b$
  17. 170 print"g$ is a gunshot...";g$
  18. 180 fori=1to1000:nexti
  19. 190 print"e$ is an explosion!";e$
  20. 200 fori=1to2000:nexti
  21. 210 restore
  22. 220 print "";h1$;"0 1 ";h2$;:rem set up the harp
  23. 230 reada,b,l:ifa<0then260
  24. 240 print"[133]";a;"[134]";b;"";l;"[134]";:rem play the harps
  25. 250 goto230
  26. 260 print"[133]1":fori=1to1000:nexti
  27. 270 b$="15 ":rem clear registers-volume up
  28. 280 b$=b$+"[133]":rem select voice 1 and clear it
  29. 290 b$=b$+"0 9 0 0 ":rem set envelope
  30. 300 b$=b$+"3 255 ":rem pulse waveform-pulse rate 255
  31. 310 b$=b$+"5 ":rem half-second
  32. 320 b$=b$+"18188 ":rem c# in fifth octave
  33. 330 b$=b$+"":rem play the note
  34. 340 rem now printing b$ plays the note
  35. 350 print"";:rem momentarily deactivate the wedge to change colors
  36. 360 print"[147][144]":gosub510
  37. 370 print"[147][134]2 0 0 15 0 0 1":rem  set up voice 2 and turn it on
  38. 380 forb=0to2*(NULL)step(NULL)/100
  39. 390 x=sin(b)*8191+16384:rem generate a sine wave
  40. 400 print""int(x);"*";:rem change frequency and print an asterisk
  41. 410 nextb
  42. 420 print:print"1":rem turn off voice 2
  43. 430 gosub510
  44. 440 c$="[133]1 3 0 15 15 2145 10 ":rem 3rd octave c
  45. 450 e$="[134]1 3 0 15 15 2703 10 ":rem 3rd octave e
  46. 460 g$="[135]1 3 0 15 15 3215 10 ":rem 3rd octave g
  47. 470 printc$""e$""g$"";:rem play each note with a 1 sec delay
  48. 480 print"[133]4190 [134]5406 [135]6430"
  49. 490 printc$"[136]";:rem play all three voices together
  50. 500 fori=1to5000:nexti:print"that's it!":end:rem turn off wedge
  51. 510 print"press any key..."b$
  52. 520 geta$:ifa$=""then520
  53. 530 return
  54. 540 data 4050,4817,4
  55. 550 data 4050,4817,4
  56. 560 data 4050,4817,4
  57. 570 data 3215,5407,8
  58. 580 data 3215,5407,4
  59. 590 data 3608,5728,4
  60. 600 data 3608,5407,4
  61. 610 data 3608,4817,4
  62. 620 data 2864,4241,4
  63. 630 data 2864,4817,4
  64. 640 data 2864,5407,4
  65. 650 data -1,0,0
  66.