home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 May
/
1986-05.d64
/
read-a-tune
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
98 lines
10 print"[147]loading ml...":fori=1to255:a$=a$+" ":next:ns=125:dimm$(ns),n$(ns)
20 fori=49152to49290:reada:pokei,a:ck=ck+a:next:rem load key note player
30 ifck<>15135thenprint"error in data statements.":stop
40 data 162,49,160,234,173,97,192,73,1,141
50 data 97,192,240,4,162,27,160,192,120,142
60 data 20,3,140,21,3,88,96,164,197,185
70 data 129,235,56,233,65,48,27,201,15,176
80 data 23,168,169,64,141,4,212,185,67,192
90 data 190,82,192,141,1,212,142,0,212,169
100 data 65,141,4,212,76,49,234,28,31,16
110 data 18,21,22,25,33,37,42,44,50,12
120 data 14,15,49,165,195,209,31,96,30,135
130 data 162,62,193,60,143,24,210,0
140 data 32,253,174,32,139,176,160,1,177,71
150 data 133,2,200,177,71,133,3,162,1,32
160 data 198,255,160,0,32,207,255,145,2,201
170 data 46,240,4,200,76,122,192,200,132,4,96
180 fori=54272to54296:pokei,0:next:poke54275,5:poke54296,12
190 rl=54272:rh=54273:dimh(15),l(15):fori=1to15:readh(i),l(i):next:remnote data
200 data 28,49,31,165,16,195,18,209,21,31,22,96
210 data 25,30,33,135,37,162,42,62,44,193,50,60,12,143,14,24,15,210
220 poke53281,15:poke53280,4
230 ifenthenprint"[147]":close15:end
240 print"[147][144] the 64 read-a-tune music system! [146]"
250 print,"1=write a song":print,"2=play back your song"
260 print,"3=recall your songs":print,"4=save your songs"
270 print,"5=12th street rag":print,"6=yankee doodle"
280 print,"7=some really fast scales!":print,"8=end of program"
290 print,"select one:"
300 d$="hbahbahbahbahbaahbahhahbaaereedrhbahbahbahbahbaahbahhahbaaeeffgg"
310 d$=d$+"hbahbahbahbahbaahbahhahbaaereedrffgaggababhihbaghhgaageecccrhhhr."
320 e$="hrhrirjrhrjrirgrhrhrirjrhhhhbbgghrhrirjrkrjrirhrbrgrarbrhhhrhhhr"
330 e$=e$+"aaabaaggaabbhhhrgggaggffeeffgggraaabaaggaabbhhaagghhbbiihhhrhhhr."
340 f$="hhhhgrgraaaaggggrrrrbbbbhhhhcccrr."
350 g$="mnocdefgabhijkllrrlkjihbagfedconmmrrcdefgabhbagfedccrrcdefgabhbagfedc."
360 getq$:ifq$=""then360
370 q=val(q$):onqgoto510,700,860,850,400,410,390,420
380 goto360
390 print"[147][144] some really fast scales!":print""g$:sp=1:goto430
400 print"[147][144]"," twelfth street rag ":print""d$:sp=9:goto430
410 print"[147][144]"," yankee doodle":print""e$:sp=28:goto430
420 print"[147]"," that's all![144]":print""f$:sp=4:en=1
430 x=0:poke54277,31:poke54276,64:poke54278,255
440 x=x+1:p=1094+x:pp=peek(p)
450 ifpp=18orpp=32thenpokerh,0:pokerl,0:goto490
460 ifpp=46thenpokerh,0:pokerl,0:poke54276,64:goto230
470 ifpp>15then440
480 poke54276,65:pokerh,h(pp):pokerl,l(pp)
490 fort=1tosp:next:pp=pp+128:pokep,pp:fort=1tosp:next
500 pp=pp-128:pokep,pp:goto440
510 n=n+1:ifn>nsthenprint"[147]too many tunes!":forde=1to1000:next:n=n-1:goto240
520 poke54277,25:poke54278,0
530 print"[147]so you're ready to write a song!"
540 print"[144]here are the notes:":print"m=low g n=low a o=low b"
550 print"c=mid c d=mid d e=mid e f=mid f"
560 print"g=mid g a=mid a b=mid b h=high c"
570 print"i=high d j=high e k=high f l=high g":print"r=rest"
580 print"enter title of song #"n":[156]"
590 n$(n)="":inputn$(n):ifn$(n)=""thenprint"[145]";:goto590
600 n$(n)=left$(n$(n),20):print"ok, enter [156]"n$(n)":"
610 print:p=0:sys49152
620 gett$:ift$=""then620
630 ift$=chr$(13)then650
640 printt$;:p=p+1:ifp<254then620
650 p=0:sys49152
660 p=p+1:ifpeek(1703+p)<>32thenp$=p$+chr$(peek(1703+p)+64):goto660
670 ifp$=""thenn=n-1:goto240
680 print"[147]song #[144]"n"called [156]"n$(n)":":m$(n)=p$+".":print""m$(n):p$=""
690 sp=33:goto430
700 ifn=0then230
710 u=0:r=4:gosub810:fori=1ton:if(i-u*16+u)/16=int((i-u*16+u)/16)then730
720 printtab(5-len(str$(i)))"[144]"i" [156]"n$(i):next
730 print"press m[146] for more":y$=">":gosub800
740 geta$:ifa$=""then740
750 ifa$=chr$(17)theny$=" ":gosub800:r=r-(r<>(i+2-u*15)):y$=">":gosub800
760 ifa$=chr$(145)theny$=" ":gosub800:r=r+(r<>4):y$=">":gosub800
770 ifa$=chr$(13)thensn=u*15+r-3:goto840
780 ifa$="m"andi<=nthenu=u+1:r=4:y$=">":gosub800:gosub810:goto720
790 goto740
800 poke214,r:print:print"[144] "y$:return
810 print"[147]locate arrow with cursor keys and"
820 print"press <return> to pick a tune.":print
830 printtab(2)"[144]song #"tab(15)"title":return
840 print"[147]a song called [156]"n$(sn)":":print""m$(sn):print"[144]":goto430
850 ifn=0then230
860 x$="":print"[147]enter filename: ";:inputx$:ifx$=""then240
870 x$="0:"+x$:ifq=4then910
880 open1,8,8,x$+",s,r":gosub950
890 input#1,n:fori=1ton:input#1,n$(i):next:fori=1ton
900 sys49250,a$:m$(i)=left$(a$,peek(4)):next:gosub950:close1:gosub950:goto240
910 close15:open15,8,15,"s"+x$:close15
920 o=0:open1,8,8,x$+",s,w":gosub950
930 print#1,n:fori=1ton:print#1,n$(i):next
940 fori=1ton:print#1,m$(i);:next:gosub950:close1:gosub950:goto240
950 ifo=0thenopen15,8,15:o=1
960 input#15,a,b$,c,d:ifathenprinta,b$,c,d:stop
970 return