home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 3 #2
/
Commodore_Disk_User_Vol.3_2_1989_-.d64
/
demo4
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
1KB
|
42 lines
90 rem piano keyboard using musibasic
95 rem note the use of the new commands
100 print"[147] [194] [194] [194] "
110 print" [194] [194] [194] "
120 print" [194] [194] [194] "
130 print" [194] [194] [194] [194] [194] [194] [194] [194] [194] [194] [194] [194] "
140 print" q[194]w[194]e[194]r[194]t[194]y[194]u[194]i[194]o[194]p[194]@[194]*[194]^"
150 print"'space' for solo or polyphonic"
160 print"'f1,f3,f5,f7' octave selection"
170 print"'f2,f4,f6,f8' waveform"
180 print"hang on, setting up frequency table..."
190 dim f(26):dim k(255)
200 (NULL)
210 f1=7040:fori=1to26:f(27-i)=f1*5.8+30:f1=f1/2^(1/12):next
220 k$="q2w3er5t6y7ui9o0p@-*\^"
230 fori=1tolen(k$):k(asc(mid$(k$,i)))=i:next
240 print"[145] "
250 ad=0:sr=249:wv=16:w=0:m=1:oc=4:v=1
260 fori=1to3:(NULL) i,ad,sr
270 (NULL) i,2048:next
280 (NULL) 15
300 geta$:ifa$=""then300
310 fr=f(k(asc(a$)))/m:iffr=zthen:goto500
320 (NULL) v,z,z
330 (NULL) v,8:(NULL) v,0
340 (NULL) v,fr
360 (NULL) v,ad,sr
370 (NULL) v,wv+1
380 ifp=1then:v=v+1:ifv=4then:v=1
400 goto300
500 ifa$="[133]"then:m=1:oc=4:goto300
510 ifa$="[134]"then:m=2:oc=3:goto300
520 ifa$="[135]"then:m=4:oc=2:goto300
530 ifa$="[136]"then:m=8:oc=1:goto300
540 ifa$="[137]"then:w=0:wv=16:goto300
550 ifa$="[138]"then:w=1:wv=32:goto300
560 ifa$="[139]"then:w=2:wv=64:goto300
570 ifa$="[140]"then:w=3:wv=128:goto300
580 ifa$=" "then:p=1-p:(NULL) 2,0:(NULL) 3,0:goto300
590 ifa$="[147]"then200
600 goto300