home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 10
/
010.d81
/
beats
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
1KB
|
35 lines
10 rem program name beats
20 rem demonstrates beat frequencies
30 rem with the sid chip
40 rem david r. brooks, july 1984
45 poke650,255:rem repeat keys
50 print"[147]":print"press +[146] to widen interval"
60 print"press -[146] to narrow interval"
70 print"press f1[146] to raise cutoff freq"
80 print"press f3[146] to lower cutoff freq"
90 print"press return[146] to stop"
100 s=54272:rem sid reference location
110 forl=stos+24:pokel,0:next:rem clear sid
120 pokes+5,9:pokes+12,9:rem attack=0,decay=9
130 pokes+6,240:pokes+13,240:rem sustain=15,release=0
140 pokes+24,31:fl=158:rem volume=max, filter=lo pass, set initial cutoff
150 f1=int(261.63/.06097+.5):f2=int(392.00/.06097+.5):rem frequency pokes
160 h1=int(f1/256):h2=int(f2/256):rem hi register
170 l1=f1-h1*256:l2=f2-h2*256:rem lo register
180 pokes+1,h1:pokes,l1:rem poke frequency registers for voice 1
190 pokes+8,h2:pokes+7,l2:rem poke frequency registers for voice2
200 pokes+4,17:rem poke triangle waveform for voice 1
210 pokes+11,17:rem poke triangle waveform for voice 2
220 pokes+22,fl:pokes+21,0:pokes+23,3:rem poke cutoff freq, filter 1&2 on
230 poke198,0:wait198,1:getz$
240 ifz$=chr$(13)thenfori=stos+24:pokei,0:next:goto63000
245 rem +=43, -=45, 133=f1, 134=f3
250 ifz$=chr$(43)thenl2=l2+1:ifl2>255thenl2=255:goto190
260 ifz$=chr$(45)thenl2=l2-1:ifl2<0thenl2=0:goto190
270 ifz$=chr$(133)thenfl=fl+5:iffl>255thenfl=255:goto190
280 ifz$=chr$(134)thenfl=fl-5:iffl<0thenfl=0:goto190
300 goto190
63000 rem return to loadstar
63010 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
63020 poke631,13:poke632,13:poke198,2:end