home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Greatest Hits / rerun-greatest-hits-vol-i.d64 / songfest (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  7KB  |  218 lines

  1. 0 rem:musicom 64:copyright 1985 by joe kaczynski
  2. 5 clr:s=54272:forl=stos+24:pokel,0:next
  3. 10 dimh%(2,1450),l%(2,1450),c%(2,1450),d(3),r(3),v(3),fq(11):z=0
  4. 15 fora=0to11:readfq(a):next:poke53281,0
  5. 20 poke53280,2:print"[147][154]                                      [146]"
  6. 25 print"          welcome to songfest         [146]"
  7. 30 print"[154]                                      [146]"
  8. 35 print"menu[146]"
  9. 40 print"r[154]= read [150]preprogrammed song from disk"
  10. 45 print"p= play song once"
  11. 50 print"c= continuous [150]play    spacebar [150]to end[146]"
  12. 55 print"i= input notes of your own song"
  13. 60 print"a= add [150]notes to song"
  14. 65 print"m= modify [153]waveform, a/d, s/r"
  15. 70 print"s= sound [150]change during playback"
  16. 75 print"e= error correction [153]after input"
  17. 80 print"k= [153]keyboard synthesizer"
  18. 85 print"q= quit and exit program"
  19. 90 geta$:ifa$=""then90
  20. 95 gosub165
  21. 100 ifa$="r"thengosub525:ifva%=3then375:goto20
  22. 105 ifa$="p"then155
  23. 110 ifa$="c"then155
  24. 115 ifa$="i"then195
  25. 120 ifa$="a"thenz=2:i=im:d=im:goto240
  26. 125 ifa$="m"thenz=1:gosub195:goto20
  27. 130 ifa$="s"thengosub825:goto20
  28. 135 ifa$="e"thenz=3:goto645
  29. 140 ifa$=chr$(81)thenend
  30. 145 ifa$="k"thenprint"[147]":goto895
  31. 150 goto20
  32. 155 ifim<>0then375
  33. 160 goto20
  34. 165 ifa$<>"r"anda$<>"i"anda$<>"p"thenreturn
  35. 170 ifa$="p"andim=0thenreturn
  36. 175 print"[147][153]how many voices would you like?[146]"
  37. 180 input"                        (1,2,or 3)";va%
  38. 185 ifva%>3orva%<1thenprint"please reenter (1 2 or 3)[146]":goto175
  39. 190 vb%=va%-1:return
  40. 195 fork=0tovb%
  41. 200 print"[147]parameters for voice"k"are now:w/f-"v(k)", a/d-"d(k)",s/r-"r(k)
  42. 205 print"[153]enter new parameters for voice #"k":"
  43. 210 input"[153]w/f(17,33,65)";v(k)
  44. 215 ifv(k)=65theninput"hi pulse(0-15)";hp(k):input"lo pulse(0-255)";lp(k)
  45. 220 input"[150]a/d(0to255)";d(k)
  46. 225 input"s/r(0to255)";r(k)
  47. 230 ifz=1thennext:z=0:return
  48. 235 next
  49. 240 fork=0tovb%:ifz=2theni=d:goto250
  50. 245 i=0:d=0
  51. 250 print"[147]record measure #[160](closest to note,only)"
  52. 255 print"before going to next voice or for note  error correction[146]"
  53. 260 print"[153]voice #"k"    [150]enter notes"
  54. 265 print"[153]enter 0,0,0 to go to next voice"
  55. 270 ifz=3thenz=0:goto20
  56. 275 gosub710
  57. 280 ifk=2andi=imthend=im
  58. 285 ifnm=0andk<>0andi<>imthenprint"[147][150]error in entry.  redo last series"
  59. 290 ifnm=0andk<>0andi<>imtheni=d:im=d:fort=1to2000:next:goto240
  60. 295 ifnm=0then365
  61. 300 b=i/16
  62. 305 wa=v(k):ifnm<0thennm=-nm:wa=1
  63. 310 dr%=nm/128:oc%=(nm-128*dr%)/16
  64. 315 nt=nm-128*dr%-16*oc%
  65. 320 fr=fq(nt)
  66. 325 if oc%=7then335
  67. 330 forj=6tooc%step-1:fr=fr/2:next
  68. 335 hf%=fr/256:lf%=fr-hf%*256
  69. 340 ifdr%=1thenh%(k,i)=hf%:l%(k,i)=lf%:c%(k,i)=wa:i=i+1:c=i/16
  70. 345 ifdr%=1thenprint"[145][153]meas."b"[153]to"c:goto270
  71. 350 forj=1todr%-1:h%(k,i)=hf%:l%(k,i)=lf%:c%(k,i)=wa:i=i+1:next
  72. 355 h%(k,i)=hf%:l%(k,i)=lf%:c%(k,i)=wa-1
  73. 360 i=i+1:c=i/16:print"[145][153]meas."b"[153]to"c:goto270
  74. 365 ifk=0thenim=i
  75. 370 next:z=0:goto20
  76. 375 rem song words
  77. 380 ifim<>0then390
  78. 385 goto395
  79. 390 print"[147][153] now playing  ";ns$
  80. 395 pokes+18,0:pokes+4,0:pokes+11,0
  81. 400 onva%goto415,410,405
  82. 405 pokes+19,d(2):pokes+20,r(2):pokes+16,lp(2):pokes+17,hp(2)
  83. 410 pokes+12,d(1):pokes+13,r(1):pokes+9,lp(1):pokes+10,hp(1)
  84. 415 pokes+5,d(0):pokes+6,r(0):pokes+2,lp(0):pokes+3,hp(0)
  85. 420 pokes+2??{$7f}a(NULL)stepa1$=""
  86. 430 fori=0toim
  87. 435 geta1$:ifa1$=" "thenpokes+24,0:goto20
  88. 440 onva%goto455,450,445
  89. 445 pokes+14,l%(2,i):pokes+15,h%(2,i):pokes+18,c%(2,i)
  90. 450 pokes+7,l%(1,i):pokes+8,h%(1,i):pokes+11,c%(1,i)
  91. 455 pokes,l%(0,i):pokes+1,h%(0,i):pokes+4,c%(0,i)
  92. 460 onva%goto465,470,475
  93. 465 forr=1to28:next
  94. 470 forr=1to28:next
  95. 475 next
  96. 480 ifa$="c"then155
  97. 485 pokes+24,0
  98. 490 print"[147][153]do you wish to write the song to disk?                  y/n "
  99. 495 geta$:ifa$=""then495
  100. 500 ifa$="y"thengosub585
  101. 505 goto20
  102. 510 data34334,36376,38539,40830
  103. 515 data43258,45830,48556,51443
  104. 520 data54502,57743,61176,64814
  105. 525 print"[147]":poke53280,4
  106. 530 print"[147] choose a song and enter the[153] name only [144] (without quotes)"
  107. 535 input"[153]name of song";ns$
  108. 540 x$=","
  109. 545 open2,8,2,"00:"+ns$+",s,r":ti$="000000"
  110. 550 print"[147][153] loading  ";ns$:print"please wait[146]"
  111. 555 input#2,im:ifim=0then580
  112. 560 fork=0tovb%:input#2,v(k),d(k),r(k),lp(k),hp(k):next
  113. 565 fori=1toim:fork=0tovb%:input#2,h%(k,i),l%(k,i),c%(k,i):next
  114. 570 print"[158]";ti$:next
  115. 575 ifim<>0thenclose2:return
  116. 580 print"[147][150]file not found [146]":close2:goto535
  117. 585 print"[147]":print"[153]insert disk into drive":print"enter s to save"
  118. 590 print"[150]enter n if you change your mind"
  119. 595 geta3$:ifa3$=""then595
  120. 600 ifa3$="n"then20
  121. 605 ifa3$="s"then615
  122. 610 goto595
  123. 615 x$=",":input"[147]name of song";ns$
  124. 620 open2,8,2,"00:"+ns$+",s,w
  125. 625 [153]"saving song to diskwait":[152]2,im
  126. 630 [129]k[178]0[164]vb%:[152]2,v(k)x$d(k)x$r(k)x$lp(k)x$hp(k):[130]
  127. 635 [129]i[178]1[164]im:[129]k[178]0[164]vb%:[152]2,h%(k,i)x$l%(k,i)x$c%(k,i):[130]:[130]
  128. 640 [160]2:[142]
  129. 645 [143] change note and octave
  130. 650 [153]"loadprintenter voice(0,1,or 2)";:[133]k
  131. 655 [139]k[177]2[167][153]"load                                          loadloadload":[137]650
  132. 660 [153]"loadprintenter measure # for note"
  133. 665 [153]"you wish to  change"
  134. 670 [133]"printenter this numberwait";e1
  135. 675 e2[178][181](e1):e[178]e2:[139]e[179]0[167]e[178]0
  136. 680 f[178](e1[171]e2)[172]16
  137. 685 i[178]16[172]e[170]f
  138. 690 [153]"loadprintenter new note, octave, and duration# "
  139. 695 [153]"do not wait defchange the duration #."
  140. 700 [133]np$,no,nd
  141. 705 [141]715:[137]305
  142. 710 [133]"defn,printo,contd";np$,no,nd
  143. 715 [139]np$[178]"0"[167]nm[178]0:[142]
  144. 720 [139]np$[178]"s"[167]nm[178][171]128[172]nd:[142]
  145. 725 [139]np$[178]"c"[167]np[178]0
  146. 730 [139]np$[178]"c#"[167]np[178]1
  147. 735 [139]np$[178]"d&"[167]np[178]1
  148. 740 [139]np$[178]"d"[167]np[178]2
  149. 745 [139]np$[178]"d#"[167]np[178]3
  150. 750 [139]np$[178]"e&"[167]np[178]3
  151. 755 [139]np$[178]"e"[167]np[178]4
  152. 760 [139]np$[178]"f"[167]np[178]5
  153. 765 [139]np$[178]"f#"[167]np[178]6
  154. 770 [139]np$[178]"g&"[167]np[178]6
  155. 775 [139]np$[178]"g"[167]np[178]7
  156. 780 [139]np$[178]"g#"[167]np[178]8
  157. 785 [139]np$[178]"a&"[167]np[178]8
  158. 790 [139]np$[178]"a"[167]np[178]9
  159. 795 [139]np$[178]"a#"[167]np[178]10
  160. 800 [139]np$[178]"b&"[167]np[178]10
  161. 805 [139]np$[178]"b"[167]np[178]11
  162. 810 [139]np$[178]"c&"[167]np[178]11
  163. 815 nm[178]128[172]nd[170]16[172]no[170]np
  164. 820 [142]
  165. 825 [153]"load"
  166. 830 [153]"printpress f1..f3..f5..f7"
  167. 835 [153]"for unusual harmonics"
  168. 840 [161] b$:[139]b$[178]""[167]840
  169. 845 [151]s[170]24,15
  170. 850 [139] b$[178]"input"[167][151]s[170]5,9:[151]s[170]6,90:[151]s[170]12,8:[151]s[170]13,9
  171. 855 [139]b$[178]"input"[167][151]s[170]19,6:[151]s[170]20,69:[137]425
  172. 860 [139]b$[178]"dim"[167][151]s[170]5,63:[151]s[170]6,240:[151]s[170]12,113:[151]s[170]13,53
  173. 865 [139]b$[178]"dim"[167][151]s[170]19,119:[151]s[170]20,7:[137]425
  174. 870 [139]b$[178]"read"[167][151]s[170]5,36:[151]s[170]6,197:[151]s[170]12,53:[151]s[170]13,53:[151]s[170]10,6
  175. 875 [139]b$[178]"read"[167][151]s[170]19,119:[151]s[170]20,7:[137]425
  176. 880 [139]b$[178]"let"[167][151]s[170]5,15:[151]s[170]6,240:[151]s[170]12,10:[151]s[170]13,167:[151]s[170]10,0
  177. 885 [139]b$[178]"let"[167][151]s[170]19,119:[151]s[170]20,240:[137]425
  178. 890 [142]
  179. 895 [156]:[151]53280,11:[153]"loadkeyboard functionwait"
  180. 900 [153]"printf1..f3..f5..f7..select octaves"
  181. 905 [153]"contf2..f4..f6..select waveforms."
  182. 910 [153]"print#f8..maintains a note till next note"
  183. 915 [153]"is played"
  184. 920 [153]"printpressing spacebar selects solo or"
  185. 925 [153]"polyphonic sound."
  186. 930 [153]"fornotes and corresponding key chart"
  187. 935 [153]"printnote..c c# d d# e f f# g g# a a# b c"
  188. 940 [153] "key...q 2  w 3  e r 5  t 6  y 7  u i "
  189. 945 [153]"printnotes cont. c# d d# e f f# g g# a"
  190. 950 [153]"keys  cont. 9  o 0  p @ -  * \  ^"
  191. 955 [153]"press  print z for main programwait"
  192. 960 s[178]54272:[134]x(26):[134]y(255):[129]i[178]0[164]28:[151]s[170]i,0:[130]
  193. 965 x1[178]7040:[129]i[178]1[164]26:x(27[171]i)[178]x1