home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1989 February
/
1989-02.d64
/
sndwedge.demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
66 lines
10 rem copyright 1989 compute! publications, inc. - all rights reserved
20 poke53280,11:poke53281,11:print"[147][144] copyright 1989 compute! pub., inc."
30 printtab(11)"all rights reserved":fori=1to1750:nexti
40 print"[147]15"
50 rem define bell sound
60 b$="[133]2 255 10207 0 9 0 0 5 "
70 rem define gunshot
80 g$="[134]4 24278 0 0 15 10 1 "
90 rem define explosion
100 e$="[135]4 536 1 0 15 12 10 "
110 rem define harp
120 h1$="[133]2 9 0 15 7 "
130 h2$="[134]2 9 7 0 0 "
140 rem note that frequency isn't included in the harp
150 rem definition. it's added later, and changes along with the length
160 print"printing b$ rings a bell...";b$
170 print"g$ is a gunshot...";g$
180 fori=1to1000:nexti
190 print"e$ is an explosion!";e$
200 fori=1to2000:nexti
210 restore
220 print "";h1$;"0 1 ";h2$;:rem set up the harp
230 reada,b,l:ifa<0then260
240 print"[133]";a;"[134]";b;"";l;"[134]";:rem play the harps
250 goto230
260 print"[133]1":fori=1to1000:nexti
270 b$="15 ":rem clear registers-volume up
280 b$=b$+"[133]":rem select voice 1 and clear it
290 b$=b$+"0 9 0 0 ":rem set envelope
300 b$=b$+"3 255 ":rem pulse waveform-pulse rate 255
310 b$=b$+"5 ":rem half-second
320 b$=b$+"18188 ":rem c# in fifth octave
330 b$=b$+"":rem play the note
340 rem now printing b$ plays the note
350 print"";:rem momentarily deactivate the wedge to change colors
360 print"[147][144]":gosub510
370 print"[147][134]2 0 0 15 0 0 1":rem set up voice 2 and turn it on
380 forb=0to2*(NULL)step(NULL)/100
390 x=sin(b)*8191+16384:rem generate a sine wave
400 print""int(x);"*";:rem change frequency and print an asterisk
410 nextb
420 print:print"1":rem turn off voice 2
430 gosub510
440 c$="[133]1 3 0 15 15 2145 10 ":rem 3rd octave c
450 e$="[134]1 3 0 15 15 2703 10 ":rem 3rd octave e
460 g$="[135]1 3 0 15 15 3215 10 ":rem 3rd octave g
470 printc$""e$""g$"";:rem play each note with a 1 sec delay
480 print"[133]4190 [134]5406 [135]6430"
490 printc$"[136]";:rem play all three voices together
500 fori=1to5000:nexti:print"that's it!":end:rem turn off wedge
510 print"press any key..."b$
520 geta$:ifa$=""then520
530 return
540 data 4050,4817,4
550 data 4050,4817,4
560 data 4050,4817,4
570 data 3215,5407,8
580 data 3215,5407,4
590 data 3608,5728,4
600 data 3608,5407,4
610 data 3608,4817,4
620 data 2864,4241,4
630 data 2864,4817,4
640 data 2864,5407,4
650 data -1,0,0