home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 October
/
Ahoy_Magazine_85-10_1985_Double_L.d64
/
maestro
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
8KB
|
245 lines
3 poke56334,peek(56334)and254
4 forx=36609to40959:pokex,z:next
6 poke55,4:poke56,109:clr:goto10
9 n%(k,o)=fn h(fo):n%(k,z)=fn l(fo):fo=fo*r:return
10 poke53280,0:poke53281,1:poke646,0:print"[147]":gosub2000:gosub3000
14 q=54272:r=1.0594631:fo=43.65:sk=65439:do=53248:ky=197
15 sh=653:f1=.064068:f2=16.4015:f3=256:o=1:w=16:ji(0)=-1:ji(1)=-1:ji(2)=-1:t=2
16 q1=q+7:q2=q+14:q3=q+o:q4=q+8:q5=q+15:q6=q+4:q7=q+11:q8=q+18:e1=q6:e2=q7:e3=q8
17 th=119:fh=401:si=1450:c$=chr$(13):w1=w:w2=w:w3=w:sr=240
20 l1=27909:l2=29359:l3=30809:h1=32259:h2=33709:h3=35159:o1=36609:o2=38059
22 o3=39509:ov=0:hv=0:lv=0
28 dimm%(400,2):dimr%(400,2)
30 dimn%(64,1):dimch%(64)
40 def fn h(fo)=int(fo*f1)
50 def fn l(fo)=int(fo*f2)-(f3*int(fo*f1))
55 fori=zto64:readj,k:ch%(i)=j:ifj>zandj<>ththengosub9
58 next
60 fori=qto54295:pokei,z:next:pokei,15
70 pokeq+6,sr:pokeq+13,sr:pokeq+20,sr
71 forx=0to9:readt$(x):next:goto608
140 ov=o1+v*si
142 forx=ztok(v):pokeov+x,z:next:k(v)=-1:ji(v)=-1:jj=z:kk=z:c=z:k(3)=z:return
150 geta$:ifa$<>""then150
160 print"[147]get ready to play ...";:forx=otofh:next:print"go!"
170 pokeq+5,ad:pokeq+6,sr
295 pokeq6,w+o:u=49152
300 syssk:ifpeek(sh)=othen360
305 ifu=dothen363
310 x=peek(ky):pokeq,n%(x,z):pokeq3,n%(x,1):pokeu,n%(x,z):pokeu+1,n%(x,o)
320 u=u+t:goto300
360 ifsthen365
362 return
363 ifsthen365
364 goto295
365 print"[147]here's what you just played:"
372 fori=49152tou-tstept
373 syssk:ifpeek(sh)=tthen381
375 pokeq,peek(i):pokeq3,peek(i+o)
380 forj=oto35:next:next
381 pokeq6,w:return
386 print"notes: ";
390 syssk:ifpeek(sh)=othenreturn
400 geta$:ifa$=""then390
401 ifpeek(sh)=tthen411
402 x=peek(ky):printchr$(ch%(x));
405 pokeq,n%(x,z):pokeq3,n%(x,o):pokeq6,w+1:fori=otof3:next:pokeq6,w
410 m%(jj,v)=x:jj=jj+o:ifjj<fhthen390
411 ifjj>cthenjj=jj-o:print"[157] [157]";
412 goto390
420 ifji(v)<zthenforx=oto999:next:k(v)=-1:return
421 print:print" rhythm: ";
422 syssk:geta$:ifa$=""then422
425 ifpeek(sh)=tthen432
426 ifa$<"a"ora$>"z"then422
430 printa$;:r%(kk,v)=asc(a$)-64:kk=kk+o:ifkk<=ji(v)then422
431 goto435
432 ifkk>cthenkk=kk-o:print"[157] [157]";
434 goto422
435 k=k(v)+o:hv=h1+v*si:lv=l1+v*si:ov=o1+v*si
436 forj=ctoji(v)
437 forx=otor%(j,v)-o:pokehv+k,n%(m%(j,v),o):pokelv+k,n%(m%(j,v),z)
438 pokeov+k,o:k=k+o:ifk=sithenreturn
439 next
440 ifr%(j,v)<=othen450
444 pokehv+k,n%(m%(j,v),o):pokelv+k,n%(m%(j,v),z):pokeov+k,z:k=k+o
450 next:return
470 forx=oto999:next:gosub2000
520 fori=ztok(s-o)
525 syssk:ifpeek(sh)=othen600
530 pokeq,peek(l1+i):pokeq1,peek(l2+i):pokeq2,peek(l3+i)
540 pokeq3,peek(h1+i):pokeq4,peek(h2+i):pokeq5,peek(h3+i)
550 pokee1,peek(o1+i)+w1:pokee2,peek(o2+i)+w2:pokee3,peek(o3+i)+w3
560 forx=ztoe:next:next
600 pokeq6,z:pokeq7,z:pokeq8,z:forx=ztof3:next:return
608 geta$:ifa$<>""then608
609 print"[147]":poke53280,6:poke53281,1:printtab(5)"*** s e l e c t i o n s ***"
610 printtab(10)"0-musical keyboard"
615 printtab(10)"1-play it again!"
620 printtab(10)"2-compose a tune"
625 printtab(10)"3-look at music"
630 printtab(10)"4-music editor"
632 printtab(10)"5-select instrument"
635 printtab(10)"6-listen to music"
640 printtab(10)"7-save music on disk"
642 printtab(10)"8-get music from disk"
644 printtab(10)"9-look at disk index"
645 printtab(10)"x-quit program"
646 printtab(10)"your choice [0-x]?";
650 syssk:geta$:ifa$=""then650
652 ifa$="x"then1350
654 s=val(a$):ifs=0anda$<>"0"then650
660 on-(s=0)-2*(s=1)-3*(s=2)-4*(s=3)-5*(s=4)gosub150,150,676,710,800
665 on-(s=5)-2*(s=6)-3*(s=7)-4*(s=8)-5*(s=9)gosub1150,900,1000,1050,1100
670 goto608
676 print"[147] how many voices (1,2,3) ?";
678 syssk:ifpeek(sh)thenreturn
679 geta$:ifa$=""then678
681 b=val(a$):ifb>3orb=zthen678
682 forv=ztot:gosub140:next
685 forv=ztob-o:print"[147] input voice"v+o
686 jj=z:kk=z
688 gosub386:ji(v)=jj-o:gosub420:k(v)=k-o:s=v+o:gosub920:next:return
710 print"[147] which voice (1,2,3) ?";
712 syssk:ifpeek(sh)=othenreturn
715 geta$:ifa$=""then712
718 v1=val(a$):ifv1>3orv1=zthen712
719 v=v1-o:ifji(v)>=zthen721
720 print"[147] no music assigned to voice";v1:forx=oto2000:next:return
721 print"[147]voice"v1:print"notes: ";:forj=ztoji(v)
724 printchr$(ch%(m%(j,v)));:next:print:print
735 print" rhythm: ";:forj=ztoji(v):printchr$(r%(j,v)+64);:next
739 syssk:ifpeek(sh)=othenreturn
740 goto739
800 print"[147]edit which voice (1,2,3) ?";
803 syssk:ifpeek(sh)=1thenreturn
805 geta$:ifa$=""then803
806 v1=val(a$):ifv1>3orv1=zthen805
808 v=v1-o:ifji(v)>=zthen810
809 print"[147] no music assigned to voice";v1:forx=oto2000:next:goto823
810 print"[147]the notes currently are:":print" notes: ";
816 forj=ztoji(v):printchr$(ch%(m%(j,v)));:next:print
817 print" if ok type <space> ":print" 'b' to start from beginning"
818 print" 'a' to continue adding notes"
819 syssk:geta$:ifa$=""then819
820 ifa$="a"then850
821 ifa$=" "thentji=ji(v):goto826
822 ifa$<>"b"then817
823 print" input the notes as they should be."
824 print:gosub140:gosub386:tji=jj-o
825 ifji(v)<zthen840
826 print:print" the rhythm currently is":print:print" rhythm: ";
827 forj=ztoji(v):printchr$(r%(j,v)+64);:next:iftji<>ji(v)then840
832 print:print" if ok type <space> ":print" otherwise 'r'"
833 geta$:ifa$<>""then833
834 syssk:geta$:ifa$=""then834
835 ifa$=" "thenk(v)=-1:c=z:kk=z:gosub435:k(v)=k-o:return
840 ji(v)=tji:print:print" input the rhythm as it should be."
842 c=z:kk=z:k(v)=-1:gosub420
845 k(v)=k-o:return
850 jj=ji(v)+o:kk=jj:c=jj:gosub386:ji(v)=jj-o
860 ifjj>kkthengosub420:k(v)=k-o
870 s=v+o:gosub920:return
900 print"[147] type number of voice to be played ";
910 print:print" or type <4> for all voices at once "
912 syssk:ifpeek(sh)thenreturn
914 geta$:ifa$=""then912
916 s=val(a$):ifs>4ors=zthen912
918 prints:ifs<4andji(s-o)=-1thenv1=s:goto720
920 e1=-1*(s=4ors=o)*(q6-820)+820:e2=-1*(s=4ors=t)*(q7-820)+820
924 e3=-1*(s=4ors=3)*(q8-820)+820:k(3)=k(z):ifk(o)>k(3)thenk(3)=k(o)
928 ifk(2)>k(3)thenk(3)=k(2)
935 print"[147] indicate tempo (0-9) "
938 syssk
940 geta$:ifa$=""then938
945 e=val(a$)*10:ife=zanda$<>"0"then935
965 gosub470:return
1000 poke56334,peek(56334)or1:a$="":b$=""
1005 print"[147] insert formatted diskette"
1010 input" name your piece";a$:ifa$=""then1042
1016 input" recommended tempo";b$:ifb$=""then1042
1018 e=val(b$):ife=zandb$<>"0"then1016
1020 open15,8,15,"i0":open5,8,5,"@0:"+a$+",s,w"
1030 print#5,e;c$;ji(z);c$;ji(o);c$;ji(t)
1036 forv=ztot:forx=ztoji(v):print#5,m%(x,v);c$;r%(x,v):next:next
1040 close5:close15
1041 print" "a$" saved on disk"
1042 poke56334,peek(56334)and254:forx=zto999:next:return
1050 forv=ztot:gosub140:next
1052 poke56334,peek(56334)oro:a$="":input"[147] name of piece";a$
1054 open15,8,15,"i0":open5,8,5,"0:"+a$+",s,r":input#5,e,ji(z),ji(o),ji(t)
1060 forv=ztot:forx=ztoji(v):input#5,m%(x,v),r%(x,v):next:next
1062 poke56334,peek(56334)and254
1065 input#15,e$
1066 ifval(e$)>zthenprint" "a$" not on disk":forx=zto999:next:goto 1074
1067 print" "a$" loaded from disk":c=z:print" recommended tempo:";e
1068 forv=ztot:k(v)=-1
1070 print" compiling voice"v+1:ifji(v)>-1thengosub435:k(v)=k-o
1073 next
1074 close5:close15:return
1100 poke56334,peek(56334)or1:print"[147] this disk contains:":print
1110 open15,8,15,"i0":open5,8,5,"$"
1114 forj=1to254:get#5,a$:next
1117 forx=oto8:get#5,d$,a$,a$:ifstthen1145
1130 b$="":forj=oto16:get#5,a$:ifa$<>chr$(160)thenb$=b$+a$
1133 next:ifasc(d$+chr$(z))=129thenprint,b$
1140 forj=1to11:get#5,a$:next:ifx<8thenget#5,a$,a$
1142 next:goto1117
1145 close5:close15:a$="":input" <return> to return";a$
1146 poke56334,peek(56334)and254:return
1150 print"[147]":forx=qtoq+23:pokex,z:next
1151 forx=ztot:ifji(x)<zandxthen1313
1159 print" choose desired sound for voice:";x+o
1160 print" press a number key ... ";
1161 syssk:ifpeek(sh)then1313
1162 geta$:ifa$=""then1161
1163 s=val(a$):ifs=0anda$<>"0"then1161
1164 printt$(s):forj=ztofh:next
1166 on-(s=0)-2*(s=1)-3*(s=2)-4*(s=3)-5*(s=4)goto1200,1210,1220,1230,1240
1167 on-(s=5)-2*(s=6)-3*(s=7)-4*(s=8)-5*(s=9)goto1250,1260,1270,1280,1290
1200 w=16:ad=144:sr=243:goto1300
1210 w=16:ad=0:sr=240:goto1300
1220 w=16:ad=88:sr=195:goto1300
1230 w=32:ad=88:sr=95:goto1300
1240 w=32:ad=0:sr=240:goto1300
1250 w=128:ad=88:sr=195:goto1300
1260 w=64:ad=14:sr=86:hp=6:lp=2:goto1300
1270 w=64:ad=9:sr=90:hp=8:lp=8:goto1300
1280 w=64:ad=9:sr=90:hp=0:lp=255:goto1300
1290 w=16:ad=9:sr=80
1300 ifx=zthenw1=w
1310 ifx=othenw2=w
1311 ifx=tthenw3=w
1312 j=q+t+7*x:pokej,lp:pokej+o,hp:pokej+3,ad:pokej+4,sr
1313 next:s=10:return
1350 poke56334,peek(56334)or1:end
1400 data 97,12,120,23,62,20,35,31,36,28,37,39,38,36,60,47,51,44,87,55
1410 data 65,7,52,2,90,3,83,63,69,10,0,0,53,13,82,18,68,21,54,26,67,29
1500 data 70,34,84,37,88,42,55,45,89,50,71,53,56,1,66,6,72,62,85,9,86,14
1510 data 57,17,73,22,74,25,48,30,77,33,75,38,79,41,78,46,43,49,80,54,76,5,45,57
1600 data 46,56,58,59,64,8,44,11,92,16,42,19,59,24,115,27,0,0,61,32
1610 data 94,35,47,40,49,43,95,48,0,0,50,51,119,0,0,0,81,0,126,4,0,0
1700 dataaccordian,organ,clarinet,synthesizer,kazoo,drum,guitar,xylophone
1710 databanjo,piano
2000 print "[147] [213][201]"
2001 print " [199][203]"
2002 print " [163][163][163][163][163][163][163][163][206][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]
2003 [153] " tab(tab(tab(tab(tab(tab(tab((NULL)chr$tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(
2004 print " [163][163][163][163][163][163][167][213][199][201][163][163][163][163][163]m a e s t r o[163][163][163][163][163]"
2005 print " [163][163][163][163][163][163][167][202][199][170][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
2006 print " [163][163][163][163][163][163][163][205][199][206][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
2007 print " [199]"
2008 return
3000 print"
3001 [153]" thenusrusrusr(NULL)
3002 print"[156] [209] advanced [167] [183][208]
3003 [153]" (NULL). (NULL)
3004 print" [209] music
3005 [153]"
3006 print"[149] [209] editor [167] [167] [167]
3007 [153]" then then then
3008 print" [209] [209] [209]
3009 [153]:[153][163]8)"by william t. eveleth and"
3010 [153][163]12)"the ahoy! staff"
3011 [142]