home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 October / Ahoy_Magazine_85-10_1985_Double_L.d64 / maestro (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  8KB  |  245 lines

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