home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #8 / Commodore_Disk_User_Vol.3_8_1990_-.d64 / p6 / p6.a7ae (.txt)
Encoding:
Commodore BASIC  |  1990-01-01  |  31.1 KB  |  995 lines

  1. 100 rem *** aleatory composer   ***
  2. 110 rem *** compatible with     ***
  3. 120 rem *** sid sequencer       ***
  4. 130 rem *** by v.h.berry c.1989 ***
  5. 140 gosub 50010:rem initialisation
  6. 150 gosub 35010:rem main menu
  7. 160 print"[147]aleatory composer"
  8. 170 print"by v.h.berry"
  9. 180 print"c.1989"
  10. 190 end
  11. 1000 rem composer
  12. 1010 gosub 2505:rem print screen
  13. 1020 gosub 2006:rem random note generator
  14. 1040 if rf=1 then au=au+1:gosub 2420:rem auto store on
  15. 1050 if rf=1 and au=ac then rf=-1:goto 1020
  16. 1055 if rf=1 then 1020
  17. 1060 get x$:if x$="" then 1060
  18. 1065 if x$=chr$(13) then gosub 2420:rem store note
  19. 1070 if x$=chr$(136) then return:rem f7=exit
  20. 1072 if x$=chr$(135) then gosub 7355:rem f5=seq on/off
  21. 1074 if x$=chr$(134) then gosub 2810:rem f3=help
  22. 1076 if x$=chr$(133) then rf=-rf:au=0:rem f1=auto off
  23. 1080 if x$="" then gosub 3210:rem reset note counters
  24. 1082 if x$="[147]" then gosub 3010:rem clear all channels
  25. 1084 if x$="s" then gosub 30510:rem set store counter
  26. 1086 if x$="f" then gosub 30010:goto 1010:rem change filename
  27. 1088 if x$="[144]" then os=1:gosub 3060:rem clear channel 1
  28. 1090 if x$="" then os=2:gosub 3060:rem clear channel 2
  29. 1092 if x$="" then os=3:gosub 3060:rem clear channel 3
  30. 1094 goto 1020
  31. 2000 rem random note generator
  32. 2005 rem select channel
  33. 2006 print"calculating note data                   "
  34. 2007 ifcs(1)+cs(2)+cs(3)<>100then print" channel probability: not equal to 100% [146]"
  35. 2010 x=int(rnd(0)*100)
  36. 2020 if x<=cs(1) then os=1:goto 2110
  37. 2030 if x<=cs(1)+cs(2) then os=2:goto 2110
  38. 2040 os=3
  39. 2100 rem select note number
  40. 2110 ct=int(rnd(0)*n(os))
  41. 2120 rem table select
  42. 2130 a=peek(pt+ct+(os-1)*256)
  43. 2200 rem select octave
  44. 2210 oc=0:vl=0:x=rnd(0)*100
  45. 2215 if oc>7 and vl<>100 then 2390
  46. 2220 vl=vl+peek(po+a*8+oc)
  47. 2230 if x>vl then oc=oc+1:goto 2215
  48. 2300 rem select note
  49. 2310 nn=0:vl=0:x=rnd(0)*100
  50. 2320 vl=vl+peek(pn+a*16+nn)
  51. 2330 if x>vl then nn=nn+1:goto 2320
  52. 2350 if nn=12 then nn=128:oc=0
  53. 2360 vl=nn+oc*16:ns=vl
  54. 2365 gosub 2605:rem print values
  55. 2370 return
  56. 2380 rem octave probability error
  57. 2390 print" octave probability : not equal to 100% [146]"
  58. 2392 rf=-1
  59. 2394 return
  60. 2400 rem store note
  61. 2420 poke ch+256*(os-1)+ct,ns
  62. 2430 return
  63. 2500 rem probability run screen
  64. 2505 poke 53280,0:poke 53281,0:print"[147]";
  65. 2510 print"file :"
  66. 2511 print"[176][192][192][192][192][192][192][192][192][192][192][192][192][174][176][192][192][192][192][192][192]";
  67. 2512 print"{$60}{$60}{$60}{$60}{$60}{$60}[174]"
  68. 2513 print"[221][221][221]store:      [146][221]"
  69. 2514 print"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]{$7d}     f1     [146]{$7d}"
  70. 2515 print"{$7d}{$7d}[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  71. 2516 print"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189][176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]"
  72. 2517 print"{$7d}    help    [146]{$7d}"
  73. 2518 print"[176]{$60}{$60}{$60}[178]{$60}{$60}{$60}[174]{$7d}     f3     [146]{$7d}"
  74. 2519 print"[221]new[221]old[221][173][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  75. 2520 print"[176]{$60}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179][176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]"
  76. 2521 print"{$7d}note{$7d}{$7d}{$7d}{$7d}seq. on/off [146]{$7d}"
  77. 2522 print"[173]{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[189]{$7d}     f5     [146]{$7d}"
  78. 2523 print"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  79. 2524 print"[176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]"
  80. 2525 print"{$7d}    exit    [146]{$7d}"
  81. 2526 print"{$7d}     f7     [146]{$7d}"
  82. 2527 print"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  83. 2530 return
  84. 2600 rem print random note data
  85. 2605 print"";n$
  86. 2606 print"";tab(29);str$(ac);" [146]"
  87. 2610 gosub 7585:rem colour subroutine
  88. 2620 print"[145][145]channel ";os
  89. 2630 print"note#     [157][157][157][157]";ct+1
  90. 2640 print"";
  91. 2650 gosub 2720:rem read note
  92. 2660 print"[146]";
  93. 2665 vl=peek(ch+(os-1)*256+ct)
  94. 2670 gosub 2720:rem read note
  95. 2680 if rf=-1 then print" press [return] to store data           [146]"
  96. 2685 if rf=1 then print" store  [157]";au+1;"[157] [146]"
  97. 2690 return
  98. 2700 rem note read
  99. 2720 if vl=128 then nl$="r  ":goto 2780:rem rest
  100. 2740 ov=int(vl/16):rem octave
  101. 2750 o$=str$(ov):o$=right$(o$,1)
  102. 2760 nl$=l$(vl-ov*16):rem note letter name
  103. 2770 nl$=nl$+o$:if len(nl$)=2 then nl$=nl$+" "
  104. 2780 print nl$;
  105. 2790 return
  106. 2800 rem help screen
  107. 2810 poke 53280,5:poke 53281,5:print"[147]";
  108. 2811 print" press [f7] to exit :                   [176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  109. 2812 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]{$7d}{$7d}{$7d}[f][146][144]changefilenam";
  110. 2813 print"e{$7d}{$7d}{$7d}{$7d}[s][146][144]se";
  111. 2814 print"tnumberofnotesstored{$7d}{$7d}";
  112. 2815 print"{$7d}{$7d}[home][146][144]resetnotecounters{$7d}{$7d}";
  113. 2816 print"{$7d}{$7d}[clr][146][144]clearallchannels{$7d}{$7d}";
  114. 2817 print"{$7d}{$7d}[ctrl] & [1][146][144]clearchannel1{$7d}{$7d}";
  115. 2818 print"{$7d}{$7d}[ctrl] & [2][146][144]clearchannel2";
  116. 2819 print"{$7d}{$7d}{$7d}{$7d}[ctrl] & [3][146][144]clear";
  117. 2820 print"channel3{$7d}{$7d}{$7d}[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  118. 2821 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  119. 2830 get x$:if x$<>chr$(136) then 2830
  120. 2840 gosub 2505:rem composer screen
  121. 2850 return
  122. 3000 rem clear all channels
  123. 3010 for os=1 to 3
  124. 3020 gosub 3060:rem clear channel
  125. 3030 next os
  126. 3035 os=1
  127. 3040 return
  128. 3050 rem clear channel
  129. 3060 for i=0 to n(os)-1
  130. 3070 poke ch+(os-1)*256+i,128
  131. 3080 next i
  132. 3090 poke ch+(os-1)*256+n(os),255
  133. 3100 return
  134. 3200 rem reset note counters
  135. 3210 for i=0 to 2
  136. 3220 poke fsid+i*7,0
  137. 3230 next i
  138. 3240 return
  139. 4000 rem edit probability tables
  140. 4010 gosub 20010:rem print edit table screen
  141. 4020 get x$:if x$=chr$(136) then return
  142. 4030 if x$=chr$(133) then sc=sc+1:gosub 20035:rem f1=next probability table
  143. 4035 if x$=chr$(137) then sc=sc-1:gosub 20035:rem f2=previous probability table
  144. 4040 if x$=chr$(134) then gosub 21010:rem f3 help
  145. 4050 if x$=chr$(135) then gosub 7355:rem f5=seq.on/off
  146. 4070 if x$="[219]" then vl=peek(po+sc*8+cy)+pe:gosub 5410:rem + octave probability
  147. 4080 if x$="[221]" then vl=peek(po+sc*8+cy)-pe:gosub 5410:rem - octave probability
  148. 4090 if x$="+" then vl=peek(pn+sc*16+cx)+pe:gosub 5210:rem + note probability
  149. 4100 if x$="-" then vl=peek(pn+sc*16+cx)-pe:gosub 5210:rem - note probability
  150. 4110 if x$="" then gosub 4510:cy=cy+1:gosub 5110:rem octave crsr +
  151. 4120 if x$="[145]" then gosub 4510:cy=cy-1:gosub 5110:rem octave crsr -
  152. 4130 if x$="" then gosub 4510:cx=cx+1:gosub 4660:rem note crsr +
  153. 4140 if x$="[157]" then gosub 4510:cx=cx-1:gosub 4660:rem note crsr -
  154. 4180 if x$="f" then gosub 30010:gosub 20010:rem change filename
  155. 4185 if x$="p" then gosub 30610:gosub 20010:rem change probability increment
  156. 4190 goto 4020
  157. 4500 rem move note & octave cursor
  158. 4510 if x$="" or x$="[157]" then gosub 4910:rem position note cursor
  159. 4520 if x$="" or x$="[145]" then gosub 5010:rem position octave cursor
  160. 4570 gosub 4810:rem read screen
  161. 4630 print"[157][157][157][146]";y$
  162. 4640 return
  163. 4650 rem print note cursor
  164. 4660 if cx>11 then cx=0
  165. 4670 if cx<0 then cx=11
  166. 4680 gosub 4910:rem position cursor
  167. 4710 gosub 4810:rem read screen
  168. 4780 print"[157][157][157]";y$;"[146]"
  169. 4790 return
  170. 4800 rem read screen
  171. 4810 y$=""
  172. 4820 open 1,3
  173. 4830 for i=1 to 3
  174. 4840 get#1,x$
  175. 4850 y$=y$+x$
  176. 4860 next i
  177. 4870 close 1
  178. 4880 return
  179. 4900 rem position note cursor
  180. 4910 print"[155]";
  181. 4920 a=cx:if cx>5 then a=cx-6:print:print"";
  182. 4930 for i=0 to a
  183. 4940 print"";
  184. 4950 next i
  185. 4960 return
  186. 5000 rem position octave cursor
  187. 5010 print"[155]";
  188. 5020 for i=0 to cy
  189. 5030 print"";
  190. 5040 next i
  191. 5050 return
  192. 5100 rem print octave cursor
  193. 5110 if cy>7 then cy=0
  194. 5120 if cy<0 then cy=7
  195. 5130 gosub 5010:rem position cursor
  196. 5140 gosub 4810:rem read screen
  197. 5150 print"[157][157][157]";y$;"[146]"
  198. 5160 return
  199. 5200 rem change note probability
  200. 5210 if vl<0 or vl>100 then 5280
  201. 5220 if x$="+" then i=peek(pn+sc*16+12)-pe
  202. 5230 if x$="-" then i=peek(pn+sc*16+12)+pe
  203. 5235 if i<0 or i>100 then 5280
  204. 5240 poke pn+sc*16+cx,vl
  205. 5250 poke pn+sc*16+12,i
  206. 5270 gosub 20060:rem print probability data
  207. 5280 return
  208. 5400 rem change octave probability
  209. 5410 if vl<0 or vl>100 then 5450
  210. 5420 j=0:for i=0 to 7:j=j+peek(po+sc*8+i):next i
  211. 5422 if x$="[219]" then j=j+pe
  212. 5430 if j<=100 then poke po+sc*8+cy,vl
  213. 5440 gosub 20060:rem print probability data
  214. 5450 return
  215. 7000 rem sid editor controls
  216. 7005 gosub 7610:rem print sid screen
  217. 7010 get x$:if x$="" then 7010
  218. 7015 if x$="[174]" then bit=1:gosub 7155:rem sync mod on/off
  219. 7020 if x$="[178]" then bit=2:gosub 7155:rem ring mod on/off
  220. 7025 if x$="" then bit=3:gosub 7155:rem test on/off
  221. 7030 if x$=chr$(20) then bit=4:gosub 7155:rem triangle on/off
  222. 7035 if x$="" then bit=5:gosub 7155:rem sawtooth on/off
  223. 7040 if x$="" then bit=6:gosub 7155:rem pulse on/off
  224. 7045 if x$="" then bit=7:gosub 7155:rem noise on/off
  225. 7050 if x$="a" then i=1:reg=5:gosub 7195:rem attack +
  226. 7055 if x$="[193]" then i=-1:reg=5:gosub 7195:rem attack -
  227. 7060 if x$="d" then i=1:reg=5:gosub 7225:rem decay +
  228. 7065 if x$="[196]" then i=-1:reg=5:gosub 7225:rem decay -
  229. 7070 if x$="s" then i=1:reg=6:gosub 7195:rem sustain +
  230. 7075 if x$="[211]" then i=-1:reg=6:gosub 7195:rem sustain -
  231. 7080 if x$="r" then i=1:reg=6:gosub 7225:rem release +
  232. 7085 if x$="[210]" then i=-1:reg=6:gosub 7225:rem release -
  233. 7090 if x$="p" or x$="[208]" then gosub 7270:rem pulse width +/-
  234. 7095 if x$="+" then i=-1:gosub 7325:rem increase tempo
  235. 7100 if x$="-" then i=1:gosub 7325:rem decrease tempo
  236. 7110 if x$="w" then gosub 31010:rem pulse width increment
  237. 7115 if x$="f" then gosub 30010:gosub 7610:rem change filename
  238. 7125 if x$=chr$(133) then os=os+1:gosub 7535:rem f1 next edit channel
  239. 7130 if x$=chr$(134) then gosub 7770:rem f3 help screen
  240. 7135 if x$=chr$(135) then gosub 7355:rem f5 music on/off
  241. 7140 if x$=chr$(136) then return:rem f7 exit sid editor
  242. 7145 goto 7010
  243. 7150 rem change sid control register
  244. 7155 if bit>3 then poke fsid+4+7*(os-1),(peek(fsid+4+7*(os-1))and 15)
  245. 7160 vl=peek(fsid+4+(os-1)*7)
  246. 7165 ifvland(2^bit)=2^bitthenpokefsid+4+7*(os-1),peek(fsid+4+7*(os-1))and(255-(2^bit))
  247. 7170 if(vland(2^bit))<>2^bitthenpokefsid+4+7*(os-1),peek(fsid+4+7*(os-1))or(2^bit)
  248. 7175 ce=os
  249. 7180 gosub 7370:rem print fsid values
  250. 7185 return
  251. 7190 rem change envelope
  252. 7195 vl=int(peek(fsid+reg+7*(os-1))/16)
  253. 7200 vl=vl+i:if vl=16 then vl=0
  254. 7205 if vl=-1 then vl=15
  255. 7210 vl=vl*16
  256. 7215 vl=vl+(peek(fsid+reg+7*(os-1)) and 15)
  257. 7220 goto 7245
  258. 7225 vl=peek(fsid+reg+7*(os-1))and 15
  259. 7230 vl=vl+i:if vl=16 then vl=0
  260. 7235 if vl=-1 then vl=15
  261. 7240 vl=vl+(peek(fsid+reg+7*(os-1)) and 240)
  262. 7245 poke fsid+reg+7*(os-1),vl
  263. 7250 ce=os
  264. 7255 gosub 7370:rem print fsid values
  265. 7260 return
  266. 7265 rem pulse width +/-
  267. 7270 if pw<0 then pw=pw*-1
  268. 7275 if x$="[208]" then pw=pw*-1
  269. 7280 vl=peek(fsid+3+7*(os-1))*256+peek(fsid+2+7*(os-1))+pw
  270. 7285 if vl>4095 then vl=vl-4095
  271. 7290 if vl<0 then vl=vl+4095
  272. 7295 poke fsid+3+7*(os-1),int(vl/256)
  273. 7300 poke fsid+2+7*(os-1),vl-((int(vl/256))*256)
  274. 7305 ce=os
  275. 7310 gosub 7370:rem print fsid values
  276. 7315 return
  277. 7320 rem tempo change
  278. 7325 vl=peek(49275):vl=vl+i:if vl=256 then vl=1
  279. 7330 if vl=0 then vl=255
  280. 7335 poke 49275,vl:poke 49276,0
  281. 7340 gosub 7510:rem print tempo value
  282. 7345 return
  283. 7350 rem sequencer on/off
  284. 7355 if mf=0 then mf=1:sys 49235:return
  285. 7360 mf=0:sys 49209:return
  286. 7365 rem print fsid data
  287. 7370 print"";
  288. 7375 t1=ce*10-5:print tab(t1);
  289. 7380 if ce=1 then print"";
  290. 7385 if ce=2 then print"[158]";
  291. 7390 if ce=3 then print"";
  292. 7395 vl=peek(fsid+4+7*(ce-1))
  293. 7400 if (vl and 8)=8 then print"off     ":goto 7425
  294. 7405 if (vl and 16)=16 then print"triangle"
  295. 7410 if (vl and 32)=32 then print"sawtooth"
  296. 7415 if (vl and 64)=64 then print"pulse   "
  297. 7420 if (vl and 128)=128 then print"noise   "
  298. 7425 print tab(t1);"    [157][157][157][157]";
  299. 7430 if (vl and 4)=4 then print"ring";
  300. 7435 print
  301. 7440 print tab(t1);"    [157][157][157][157]";
  302. 7445 if (vl and 2)=2 then print"sync";
  303. 7450 print
  304. 7455 print tab(t1);"      [157][157][157][157][157][157]";
  305. 7460 vl=int(((peek(fsid+3+7*(ce-1))*256+peek(fsid+2+7*(ce-1)))/40.95)+.5)
  306. 7465 print vl;"%"
  307. 7470 vl=peek(fsid+5+7*(ce-1))
  308. 7475 print tab(t1);"";en$(0,int(vl/16))
  309. 7480 print tab(t1);"";en$(1,(vl and 15))
  310. 7485 vl=peek(fsid+6+7*(ce-1))
  311. 7490 print tab(t1);"";en$(2,int(vl/16))
  312. 7495 print tab(t1);"";en$(3,(vl and 15))
  313. 7500 return
  314. 7505 rem print file name & tempo
  315. 7510 print"";n$
  316. 7515 print"             [157][157][157][157][157][157][157][157][157][157][157][157][157]";
  317. 7520 print (peek(49275)+1)/50;"seconds"
  318. 7525 return
  319. 7530 rem print edit channel
  320. 7535 if os>3 then os=1
  321. 7540 print"";tab(5);"        ";tab(15);"        ";tab(25);"        ";
  322. 7550 print
  323. 7555 print tab(os*10-5);"[145]* edit *"
  324. 7560 return
  325. 7565 rem colour subroutine
  326. 7580 if os>3 then os=1
  327. 7585 if os=1 then print""
  328. 7590 if os=2 then print"[158]"
  329. 7595 if os=3 then print""
  330. 7600 return
  331. 7605 rem sid editor screen
  332. 7610 print"[147]file:"
  333. 7615 print"[176][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][174]"
  334. 7620 print"[221][221][221][221]"
  335. 7625 print"[221] chan 1  [146][221][158] chan 2  [146][221] chan 3  [146][221]"
  336. 7630 print"[221][221][221][221]"
  337. 7635 print"[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179]"
  338. 7640 print"[221][221][221][221]"
  339. 7645 print"[221][221][221][221]"
  340. 7650 print"[221]mod osc 3[146][221][158]mod osc 1[146][221]mod osc 2[146][221]"
  341. 7655 print"[173][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][189]"
  342. 7660 print"pulsewidth"
  343. 7665 print"[176][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][174]"
  344. 7670 print"{$7d}{$7d}{$7d}{$7d}"
  345. 7675 print"[173][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][189]"
  346. 7680 print"envelope"
  347. 7685 print"[176][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][174]"
  348. 7690 print"[221]a:[146][221][158]a:[146][221]a:[146][221]"
  349. 7695 print"[221]d:[146][221][158]d:[146][221]d:[146][221]"
  350. 7700 print"[221]s:[146][221][158]s:[146][221]s:[146][221]"
  351. 7705 print"[221]r:[146][221][158]r:[146][221]r:[146][221]"
  352. 7710 print"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  353. 7715 print"tempo:"
  354. 7720 print"  edit chan [146]  help [146]  seq on/off [146]  exit [146]"
  355. 7725 print"      f1    [146]   f3  [146]      f5     [146]   f7  [146]"
  356. 7730 gosub 7510:rem print file name & tempo
  357. 7735 print"";
  358. 7740 gosub 7540:rem display edit channel
  359. 7745 for ce=1 to 3
  360. 7750 gosub 7370:rem print sid data
  361. 7755 next
  362. 7760 return
  363. 7765 rem help screens
  364. 7770 poke 53280,5:poke 53281,5:print"[147]";
  365. 7775 print" [f3] next screen : [f7] exit           [146]";
  366. 7780 print"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  367. 7785 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]{$7d}{$7d}{$7d}[146][144]sidsequencercont";
  368. 7790 print"rols[221][221][146][144][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][221][146]";
  369. 7795 print"[221]";
  370. 7800 print"{$7d}{$7d}[f][146][144]changefilename{$7d}{$7d}";
  371. 7805 print"[221]";
  372. 7810 print"[221][221][221][146][144]sequencerspeed";
  373. 7815 print"{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7d}{$7d}[+][146][144]incre";
  374. 7820 print"asetempo{$7d}{$7d}{$7d}{$7d}";
  375. 7825 print"[-][146][144]decreasetempo[221][221]";
  376. 7830 print"[221]";
  377. 7835 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][146]";
  378. 7840 get x$:if x$=chr$(136) then x$="":poke 53280,0:poke 53281,0:goto 7610
  379. 7845 if x$<>chr$(134) then 7840
  380. 7850 print"[147]";
  381. 7855 print" [f3] next screen : [f7] exit           [146]";
  382. 7860 print"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  383. 7865 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]{$7d}{$7d}{$7d}[146][144]editchannelcontr";
  384. 7870 print"ols{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7d}{$7d}[ctr";
  385. 7875 print"l] & [o][146][144]voiceon/off{$7d}{$7d}";
  386. 7880 print"{$7d}{$7d}[146][144]selectwaveform{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  387. 7885 print"{$60}{$60}{$7d}{$7d}[146][144]hold[ctrl][146][144]&press:{$7d}{$7d}";
  388. 7890 print"{$7d}{$7d}[t][146][144]trianglewave";
  389. 7895 print"{$7d}{$7d}[s][146][144]sawtoothwave{$7d}{$7d}[p][146][144]pulse";
  390. 7900 print"wave{$7d}{$7d}[n][146][144]noise{$7d}{$7d}";
  391. 7905 print"{$7d}{$7d}[146][144]pulsewidth";
  392. 7910 print"{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7d}{$7d}[shift] & [p][146][144]";
  393. 7915 print"decreasewidth{$7d}{$7d}[p][146][144]increasewidth{$7d}{$7d}";
  394. 7920 print"[w][146][144]setwidthincrement{$7d}{$7d}";
  395. 7925 print"{$7d}[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  396. 7930 get x$:if x$=chr$(136) then x$="":poke 53280,0:poke 53281,0:goto 7610
  397. 7935 if x$<>chr$(134) then 7930
  398. 7940 print"[147]";
  399. 7945 print" [f3] next screen : [f7] exit           [146]";
  400. 7950 print"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  401. 7955 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]{$7d}{$7d}{$7d}[146][144]editchannelcontr";
  402. 7960 print"ols{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7d}{$7d}[146][144]se";
  403. 7965 print"lectenvelope{$7d}{$7d}";
  404. 7970 print"{$7d}{$7d}[146][144]increaseordecreaseaparameter:{$7d}{$7d}";
  405. 7975 print"{$7d}{$7d}[a] or [shift] & [a][146][144]attack{$7d}{$7d}[d] or [";
  406. 7980 print"shift] & [d][146][144]decay{$7d}{$7d}[s] or [shift] & [s][146][144]sustain";
  407. 7985 print"{$7d}{$7d}[r] or [shift] & [r][146][144]release{$7d}{$7d}";
  408. 7990 print"{$7d}{$7d}[146][144]modulation{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}";
  409. 7995 print"{$60}{$60}{$60}{$60}{$7d}{$7d}[commodore] & [r][146][144]ringmodon/off";
  410. 8000 print"{$7d}{$7d}[commodore] & [s][146][144]synchronizeon/off{$7d}{$7d}";
  411. 8005 print"{$7d}[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  412. 8010 get x$:if x$=chr$(136) then x$="":poke 53280,0:poke 53281,0:goto 7610
  413. 8015 if x$<>chr$(134) then 8010
  414. 8020 goto 7770
  415. 9000 rem edit definitions
  416. 9010 gosub 10010:rem print screen
  417. 9020 rem ctrl section
  418. 9030 get x$:if x$=chr$(136) then return
  419. 9040 if x$=chr$(133) then os=os+1:gosub 10310:rem f1 next channel
  420. 9050 if x$=chr$(134) then gosub 11010:rem f3 help
  421. 9060 if x$=chr$(135) then gosub 7355:rem f5 seq.on/off
  422. 9070 if x$="+" then vl=peek(pt+ne+(os-1)*256)+1:gosub 10510:rem + table#
  423. 9080 if x$="-" then vl=peek(pt+ne+(os-1)*256)-1:gosub 10510:rem - table#
  424. 9090 if x$="n" then ne=ne+1:gosub 10180:rem + note#
  425. 9100 if x$="[206]" then ne=ne-1:gosub 10180:rem - note#
  426. 9110 if x$="o" then vl=pe:gosub 10410:rem + channel occurance
  427. 9120 if x$="[207]" then vl=-pe:gosub 10410:rem - channel occurance
  428. 9125 if x$="p" then gosub 30610:gosub 10010:rem probability increment
  429. 9130 if x$="f" then gosub 30010:gosub 10010:rem filename
  430. 9135 if x$="" then gosub 10610:rem note limits
  431. 9140 goto 9030
  432. 10000 rem edit definitions screen
  433. 10010 poke 53280,0:poke 53281,0:print"[147]";
  434. 10020 print"[176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}[178]{$60}{$60}{$60}{$60}[178]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[178]{$60}{$60}{$60}{$60}[174]"
  435. 10030 print"{$7d}channel{$7d}help{$7d}seq.on/off{$7d}exit{$7d}"
  436. 10040 print"{$7d}  f1   {$7d} f3 {$7d}    f5    {$7d} f7 {$7d}"
  437. 10050 print"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}{$60}[189]"
  438. 10060 print"file:"
  439. 10070 print"[176]{$60}{$60}{$60}{$60}{$60}{$60}[178]{$60}{$60}{$60}{$60}{$60}{$60}[178]{$60}{$60}{$60}{$60}{$60}{$60}[174]"
  440. 10080 print"[176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]{$7d}{$7d}{$7d}"
  441. 10090 print"[221]channel[221]1[221][158]2[221]3[221]"
  442. 10100 print"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$60}{$60}{$60}[179]"
  443. 10110 print"{$7d}notelimit{$7d}{$7d}{$7d}{$7d}"
  444. 10120 print"[171][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][219][192][192][192][192][192][192][219][192][192][192][192][192][192][179]"
  445. 10122 print"[221]occurance%[221][221][221][221]"
  446. 10124 print"[171][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][177][192][192][192][192][192][192][177][192][192][192][192][192][192][179]"
  447. 10130 print"{$7d}note#:{$7d}tablenumber{$7d}"
  448. 10140 print"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$60}{$60}{$60}[178]{$60}{$60}{$60}{$60}{$60}{$60}[178]{$60}{$60}{$60}{$60}{$60}{$60}[179]"
  449. 10150 print"{$7d}{$7d}{$7d}{$7d}"
  450. 10160 print"[173]{$60}{$60}{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}{$60}{$60}{$60}[177]{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  451. 10170 print"";n$
  452. 10180 ce=os
  453. 10182 if ne>255 then ne=255
  454. 10184 if ne<0 then ne=0
  455. 10190 for os=1 to 3
  456. 10200 gosub 7585:rem colour subroutine
  457. 10210 print"";tab(14+(os-1)*7);"    [157][157][157][157]";n(os)
  458. 10220 print tab(14+(os-1)*7);"    [157][157][157][157]";cs(os)
  459. 10230 print tab(14+(os-1)*7);"    [157][157][157][157]";peek(pt+ne+(os-1)*256)+1
  460. 10240 next os
  461. 10300 rem print edit cursor
  462. 10305 os=ce
  463. 10310 print"                  [145]"
  464. 10315 if os>3 then os=1
  465. 10320 print tab(13+(os-1)*7);"*edit*"
  466. 10330 print tab(8);"    [157][157][157][157]";ne+1
  467. 10340 return
  468. 10400 rem change channel occurance
  469. 10410 if vl+cs(1)+cs(2)+cs(3)>100 then 10440
  470. 10415 if cs(os)+vl<0 then 10440
  471. 10420 cs(os)=cs(os)+vl
  472. 10430 gosub 10180:rem print screen
  473. 10440 return
  474. 10500 rem change probability table
  475. 10510 if vl<0 or vl>15 then 10540
  476. 10520 poke pt+ne+(os-1)*256,vl
  477. 10530 gosub 10180:rem print values
  478. 10540 return
  479. 10600 rem change note limit
  480. 10610 poke 53280,5:poke 53281,5
  481. 10612 if mf=1 then gosub 7355:rem seq off
  482. 10613 gosub 3210:rem reset note counters
  483. 10614 poke ch+n(os)+(os-1)*256,128
  484. 10615 gosub 7585:rem colour subroutine
  485. 10620 print"[147] enter new note limit (0-255)         [146]";
  486. 10630 print
  487. 10640 print"channel    :";os
  488. 10650 print"note limit :";n(os)
  489. 10660 print"[144][176][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][178][192][192][192][192][192][192][178][192][192][192][192][192][192][174]"
  490. 10670 print"[221]channel[221]1[144][221][158]2[144][221]3[144][221]"
  491. 10680 print"[171][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][219][192][192][192][192][192][192][219][192][192][192][192][192][192][179]"
  492. 10690 print"[221]notelimit[221][221][221][221]"
  493. 10700 print"[173][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][177][192][192][192][192][192][192][177][192][192][192][192][192][192][189]"
  494. 10710 ce=os
  495. 10720 for os=1 to 3
  496. 10730 gosub 7585:rem colour subroutine
  497. 10740 print"";tab(14+(os-1)*7);"    [157][157][157][157]";n(os)
  498. 10750 next os
  499. 10760 os=ce
  500. 10765 print""
  501. 10770 l=3:t1=14+(os-1)*7:rs=0:gosub 32040:rem input subroutine
  502. 10780 if a>0 then n(os)=val(y$):y$=""
  503. 10785 gosub 3060:rem clear channel
  504. 10790 gosub 10010:rem print screen
  505. 10800 return
  506. 11000 rem help screen
  507. 11010 poke 53280,5:poke 53281,5:print"[147]";
  508. 11011 print" press [f7] to exit :                   [176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  509. 11012 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]{$7d}{$7d}{$7d}[f][146][144]changefilenam";
  510. 11013 print"e{$7d}{$7d}{$7d}{$7d}[p][146][144]ch";
  511. 11014 print"angeprobabilityincrement{$7d}{$7d}";
  512. 11015 print"{$7d}{$7d}[ctrl] & [l][146][144]changenotelimit{$7d}{$7d}";
  513. 11016 print"{$7d}{$7d}[+] or [-][146][144]+/-tablenumber{$7d}{$7d}";
  514. 11017 print"{$7d}{$7d}[o] or [shift] & [o][146][144]+/-channel%{$7d}{$7d}";
  515. 11018 print"{$7d}{$7d}[n] or [shift] & [n][146][144]+/-note";
  516. 11019 print"number{$7d}{$7d}{$7d}[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  517. 11020 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[189]"
  518. 11025 get x$:if x$<>chr$(136) then 11025
  519. 11030 gosub 10010:rem edit screen
  520. 11040 return
  521. 20000 rem print probability table
  522. 20010 poke 53280,0:poke 53281,0:print"[147]";
  523. 20011 print"[176][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][174]"
  524. 20012 print"[221] table# [146][221] help [146][221] seq.on/off [146][221] exit [146][221]"
  525. 20013 print"[221]  f1/2  [146][221]  f3  [146][221]     f5     [146][221]  f7  [146][221]"
  526. 20014 print"[173][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][189]"
  527. 20015 print"[155]probabilitytable:"
  528. 20016 print"file:"
  529. 20017 print"[176]{$60}{$60}{$60}[178]{$60}{$60}{$60}[178]{$60}{$60}{$60}[178]{$60}{$60}{$60}[178]{$60}{$60}{$60}[178]{$60}{$60}{$60}[178]{$60}{$60}{$60}[174]"
  530. 20018 print"[221][155]nts[221][155]c[221][155]c#[221][155]d[221][155]d#[221][155]e[221][155]f[221]"
  531. 20019 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179][176]{$60}{$60}{$60}[174]"
  532. 20020 print"[221][155]%[221][221][221][221][221][221][221][221][155]rt%[221]"
  533. 20021 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179][171]{$60}{$60}{$60}[179]"
  534. 20022 print"[221][155]nts[221][155]f#[221][155]g[221][155]g#[221][155]a[221][155]a#[221][155]b[221][221][221]"
  535. 20023 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179][173]{$60}{$60}{$60}[189]"
  536. 20024 print"[221][155]%[221][221][221][221][221][221][221]"
  537. 20025 print"[173]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[189]"
  538. 20026 print"[176][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][174]"
  539. 20027 print"[221][155]8ve[221][155]0[221][155]1[221][155]2[221][155]3[221][155]4[221][155]5[221][155]6[221][155]7[221]"
  540. 20028 print"[171][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][179]"
  541. 20029 print"[221][155]%[221][221][221][221][221][221][221][221][221]"
  542. 20030 print"[173][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][189]"
  543. 20035 if sc>15 then sc=0
  544. 20036 if sc<0 then sc=15
  545. 20040 print"   [157][157][157]";sc+1
  546. 20050 print"";n$
  547. 20060 print"";
  548. 20070 for i=0 to 5
  549. 20075 if peek(pn+sc*16+i)=0 then x$="  0":goto 20100
  550. 20080 x$=str$(peek(pn+sc*16+i))
  551. 20085 if len(x$)=4 then x$=right$(x$,3)
  552. 20090 if len(x$)<3 then x$=" "+x$:goto 20090
  553. 20100 print x$;"";
  554. 20110 next i
  555. 20115 print:print"";
  556. 20120 for i=6 to 11
  557. 20125 if peek(pn+sc*16+i)=0 then x$="  0":goto 20150
  558. 20130 x$=str$(peek(pn+sc*16+i))
  559. 20135 if len(x$)=4 then x$=right$(x$,3)
  560. 20140 if len(x$)<3 then x$=" "+x$:goto 20140
  561. 20150 print x$;"";
  562. 20160 next i
  563. 20162 if peek(pn+sc*16+12)=0 then x$="  0":goto 20170
  564. 20164 x$=str$(peek(pn+sc*16+12))
  565. 20166 if len(x$)=4 then x$=right$(x$,3)
  566. 20168 if len(x$)<3 then x$=" "+x$:goto 20168
  567. 20170 print"";x$
  568. 20172 print"";
  569. 20176 for i=0 to 7
  570. 20178 if peek(po+sc*8+i)=0 then x$="  0":goto 20200
  571. 20180 x$=str$(peek(po+sc*8+i))
  572. 20185 if len(x$)=4 then x$=right$(x$,3)
  573. 20190 if len(x$)<3 then x$=" "+x$:goto 20190
  574. 20200 print x$;"";
  575. 20210 next i
  576. 20215 print
  577. 20220 gosub 4660:rem note cursor
  578. 20230 gosub 5110:rem octave cursor
  579. 20240 return
  580. 21000 rem help screen
  581. 21010 poke 53280,5:poke 53281,5:print"[147]";
  582. 21011 print" press [f7] to exit :                   [176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  583. 21012 print"{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[174]{$7d}{$7d}{$7d}[f][146][144]changefilenam";
  584. 21013 print"e{$7d}{$7d}{$7d}{$7d}[p][146][144]ch";
  585. 21014 print"angeprobabilityincrement{$7d}{$7d}";
  586. 21015 print"{$7d}{$7d}[146][144]notecursor:{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  587. 21016 print"{$7d}{$7d}[crsr left/right][146][144]movecursor{$7d}{$7d}";
  588. 21017 print"{$7d}{$7d}[+][146][144]+cursorvalue";
  589. 21018 print"{$7d}{$7d}{$7d}{$7d}[-][146][144]-cursor";
  590. 21019 print"value{$7d}{$7d}{$7d}{$7d}[146][144]octavecursor";
  591. 21020 print":{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7d}{$7d}";
  592. 21021 print"[crsr up/down][146][144]movecursor{$7d}{$7d}";
  593. 21022 print"{$7d}{$7d}[shift] & [+][146][144]+cursorvalue{$7d}{$7d}";
  594. 21023 print"{$7d}{$7d}[shift] & [-][146][144]-cursorvalue{$7d}{$7d}";
  595. 21024 print"{$7d}[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  596. 21025 print"[192][189]"
  597. 21030 get x$:if x$<>chr$(136) then 21030
  598. 21040 gosub 20010:rem edit screen
  599. 21050 return
  600. 30000 rem input new filename
  601. 30010 poke 53280,5:poke 53281,5
  602. 30020 print"[147] enter new filename : press [return]  [146]";
  603. 30030 print
  604. 30040 print"file : ";n$
  605. 30050 print""
  606. 30060 l=14:t1=5:rs=1:gosub 32040:rem input subroutine
  607. 30070 if a>0 then n$=y$:y$=""
  608. 30080 poke 53280,0:poke 53281,0
  609. 30090 return
  610. 30500 rem note store value
  611. 30510 poke 53280,5:poke 53281,5
  612. 30520 print"[147] enter note store# : press [return]     [146]";
  613. 30530 print
  614. 30540 print"note storage value : ";ac;""
  615. 30550 l=3:t1=10:rs=0:gosub 32040:rem input subroutine
  616. 30560 if a>0 then ac=val(y$):y$=""
  617. 30580 gosub 2505:rem sid screen
  618. 30590 return
  619. 30600 rem probability increment value
  620. 30610 poke 53280,5:poke 53281,5
  621. 30620 print"[147] enter increment value : press [return] [146]";
  622. 30630 print
  623. 30640 print"probability increment : ";pe;""
  624. 30650 l=2:t1=10:rs=0:gosub 32040:rem input subroutine
  625. 30660 if a>0 then pe=val(y$):y$=""
  626. 30670 return
  627. 31000 rem pulse width increment
  628. 31010 poke 53280,5:poke 53281,5
  629. 31020 print"[147] enter % increment : press [return]     [146]";
  630. 31030 print
  631. 31040 print"pulse width increment : ";int(pw/40.95+.5);"%"
  632. 31050 l=2:t1=10:rs=0:gosub 32040:rem input subroutine
  633. 31060 pw=val(y$)*40.95:y$=""
  634. 31070 poke 53280,0:poke 53281,0
  635. 31080 gosub 7610:rem sid screen
  636. 31090 return
  637. 32000 rem input restriction subroutine
  638. 32010 rem l=length of input
  639. 32020 rem t1=tabulation of routine
  640. 32030 rem rs=character restrictions
  641. 32040 a=0:y$="":sp=1
  642. 32050 print tab(t1+l+1):print"[145][174][157][189][145]";:for x=0 to l+1:print"[157][157] ";:next:print"[145][176][157][173][145][144][164][157]";
  643. 32060 get x$:if x$="" then 32060
  644. 32070 if x$=chr$(160) or x$=" " or x$=chr$(20) or x$=chr$(13) then 32130
  645. 32080 if rs=0 then if x$=>"0" and x$=<"9" then 32130
  646. 32090 if rs=1 and x$=>chr$(35) and x$=<chr$(93) then 32130
  647. 32100 goto 32060
  648. 32110 if a=l-1 then print"[157][157]";
  649. 32120 goto 32060
  650. 32130 if x$=chr$(20) and a=0 then 32060
  651. 32140 if x$=chr$(13) and right$(y$,1)=" " then y$=left$(y$,len(y$)-1):a=a-1
  652. 32150 if x$=chr$(13) then print:return
  653. 32160 a=a+1:if x$<>chr$(32) then sp=0
  654. 32170 if a>l and x$<>chr$(20) then x$="":a=a-1
  655. 32180 if a<1 then x$="":a=0
  656. 32190 if x$=chr$(20) then print tab(a)"[157][164] [157][157]";:a=a-2:y$=left$(y$,len(y$)-1):goto 32110
  657. 32200 if x$=chr$(32) and sp=1 then x$="":a=a-1
  658. 32210 if x$=chr$(32) then sp=sp+1
  659. 32220 y$=y$+x$:print x$;:if a<l then print"[164][157]";
  660. 32230 goto 32060
  661. 35000 rem main menu
  662. 35010 poke 53280,0:poke 53281,0
  663. 35015 print"[147] move cursor up & down:press [return]   [146]"
  664. 35020 print"*** aleatory composer ***"
  665. 35030 print"v.h.berry c.1989"
  666. 35040 print"        [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  667. 35060 print"            edit definitions"
  668. 35065 print"            edit tables     "
  669. 35070 print"            edit sound      "
  670. 35075 print"            run composer    "
  671. 35080 print"            disk menu       "
  672. 35090 print"            exit program    "
  673. 35100 print
  674. 35110 print"        [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  675. 35120 print"":t1=10:ll=5:gosub 39010:rem menu system routine
  676. 35130 y$="":if a=5 then return
  677. 35140 on a+1 gosub 9010,4010,7005,1010,37020
  678. 35150 goto 35010
  679. 37000 rem disk menu
  680. 37020 print"[147] move cursor up & down:press [return]   [146]"
  681. 37030 print"***   disk menu   ***"
  682. 37040 print"file : ";n$
  683. 37050 print"        [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  684. 37060 print"            new filename    "
  685. 37070 print"            directory       "
  686. 37080 print"            disk change     "
  687. 37090 print"            load file       "
  688. 37100 print"            save file       "
  689. 37110 print"            scratch file    "
  690. 37115 print"            disk validate   "
  691. 37120 print"            exit menu       "
  692. 37130 print
  693. 37140 print"        [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  694. 37150 print"":t1=10:t2=12:ln=13:ll=7:gosub 39010:rem menu system routine
  695. 37160 if a=7 then return
  696. 37165 if mf=1 then gosub 7355:rem turn off sequencer
  697. 37170 on a+1 gosub 30010,45010,44110,37210,37210,37210,44210
  698. 37175 y$=""
  699. 37180 goto 37020
  700. 37200 rem file menu
  701. 37210 print"[147] move cursor up & down:press [return]   [146]"
  702. 37220 print"***   ";y$;"   ***"
  703. 37230 print"file : ";n$
  704. 37235 print"select file type"
  705. 37240 print"        [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  706. 37250 print"            music file      "
  707. 37260 print"            sound file      "
  708. 37270 print"            probability file"
  709. 37280 print"            disk menu       "
  710. 37285 print
  711. 37290 print"        [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  712. 37295 a$=mid$(y$,1,2)
  713. 37300 print"":t1=10:ll=3:gosub 39010:rem menu system routine
  714. 37310 if a=3 then return
  715. 37320 if a$="lo" then on a+1 gosub 40010,42010,43510
  716. 37322 if a$="sa" then on a+1 gosub 41010,43010,43805
  717. 37324 if a$="sc" then gosub 44310
  718. 37330 return
  719. 38500 rem directory menu
  720. 38505 if dy*12>fi then dy=0
  721. 38510 print"[147] move cursor up & down:press [return]   [146]"
  722. 38520 print"***disk directory***"
  723. 38525 print"blocks free : ";bf
  724. 38530 print"        [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  725. 38540 print"            ";n$;""
  726. 38550 for i=12*dy to 11+(12*dy)
  727. 38555 if i>fi then print:goto 38570
  728. 38560 print"            ";fi$(i)
  729. 38570 next i
  730. 38575 print"            next page"
  731. 38580 print"        [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  732. 38590 print"":t1=10:ll=13:gosub 39010:rem menu system routine
  733. 38592 if a=13 then dy=dy+1:goto 38505
  734. 38593 if a=0 then 38600
  735. 38594 if len(fi$((a-1)+12*dy))<3 then 38600
  736. 38595 n$=left$(fi$((a-1)+12*dy),len(fi$((a-1)+12*dy))-2)
  737. 38600 return
  738. 39000 rem menu system routine
  739. 39010 rem ll=lower limit of cursor travel
  740. 39020 rem ln=length of string returned(y$)
  741. 39030 rem t1=tabulation of ">" cursor
  742. 39040 rem t2=tabulation of start of string
  743. 39050 rem a=(option selected-1)
  744. 39060 a=0:print tab(t1);">"
  745. 39070 get x$:if x$="" then 39070
  746. 39080 if a=ll and x$=chr$(17) then a=a-1:print"[145][145]"
  747. 39090 if a=0 and x$=chr$(145) then a=a+1:print
  748. 39100 if x$=chr$(17) then a=a+1:print tab(t1);"[145] [157]>"
  749. 39110 if x$=chr$(145) then a=a-1:print tab(t1);"[145] [157][145]>"
  750. 39120 if x$=chr$(13) then print tab(t2);"[145]";:goto 39140
  751. 39130 goto 39070
  752. 39140 open 1,3:for x=1 to ln:get#1,x$:y$=y$+x$:next:close 1
  753. 39150 return
  754. 40000 rem load music file
  755. 40010 x$=".1":i=0
  756. 40020 n=0
  757. 40030 open 15,8,15
  758. 40040 open 2,8,2,n$+x$+",s,r"
  759. 40050 input#15,en,er$,tr,se
  760. 40060 if en<>0 then print"[147] load[146]";:goto 44010
  761. 40070 print" loading music file :                [146]";
  762. 40080 input#2,a
  763. 40090 poke ch+i*256+n,a
  764. 40100 if a<>255 then n=n+1:goto 40080
  765. 40110 n(i+1)=n
  766. 40120 close 2
  767. 40130 close 15
  768. 40140 if i=0 then i=1:x$=".2":goto 40020
  769. 40150 if i=1 then i=2:x$=".3":goto 40020
  770. 40160 return
  771. 41000 rem save music file
  772. 41010 x$=".1":i=0
  773. 41020 n=0
  774. 41030 open 15,8,15
  775. 41040 open 2,8,2,n$+x$+",s,w"
  776. 41050 input#15,en,er$,tr,se
  777. 41060 if en<>0 then print"[147] save[146]";:goto 44010
  778. 41070 print" saving music file :                 [146]";
  779. 41080 a=peek(ch+i*256+n)
  780. 41090 print#2,a
  781. 41100 if a<>255 then n=n+1:goto 41080
  782. 41110 close 2
  783. 41120 close 15
  784. 41130 if i=0 then i=1:x$=".2":goto 41020
  785. 41140 if i=1 then i=2:x$=".3":goto 41020
  786. 41150 return
  787. 42000 rem load fsid registers
  788. 42010 open 15,8,15
  789. 42020 open 2,8,2,n$+".s,s,r"
  790. 42030 input#15,en,er$,tr,se
  791. 42040 if en<>0 then print"[147] load[146]";:goto 44010
  792. 42050 print" loading sound file :                [146]";
  793. 42060 input#2,a
  794. 42070 poke 49275,a
  795. 42080 for ce=0 to 2
  796. 42090 for reg=0 to 6
  797. 42100 input#2,a
  798. 42110 poke fsid+reg+7*ce,a
  799. 42120 next reg,ce
  800. 42130 close 2
  801. 42140 close 15
  802. 42150 return
  803. 43000 rem save fsid registers
  804. 43010 open 15,8,15
  805. 43020 open 2,8,2,n$+".s,s,w"
  806. 43030 input#15,en,er$,tr,se
  807. 43040 if en<>0 then print"[147] save[146]";:goto 44010
  808. 43050 print" saving sound file :                 [146]";
  809. 43060 a=peek(49275)
  810. 43070 print#2,a
  811. 43080 for ce=0 to 2
  812. 43090 for reg=0 to 6
  813. 43100 a=peek(fsid+reg+ce*7)
  814. 43110 print#2,a
  815. 43120 next reg,ce
  816. 43130 close 2
  817. 43140 close 15
  818. 43150 return
  819. 43500 rem load probabilty tables
  820. 43510 open 15,8,15
  821. 43520 open 2,8,2,n$+".p,s,r"
  822. 43530 input#15,en,er$,tr,se
  823. 43540 if en<>0 then print"[147] load[146]";:goto 44010
  824. 43550 print" loading probability file :          [146]";
  825. 43560 for ce=1 to 3
  826. 43565 poke ch+n(ce)+(ce-1)*256,128
  827. 43570 input#2,n(ce)
  828. 43575 poke ch+n(ce)+(ce-1)*256,255
  829. 43580 input#2,cs(ce)
  830. 43590 for i=0 to n(ce)-1
  831. 43600 input#2,a
  832. 43610 poke pt+i+(ce-1)*256,a
  833. 43620 next i,ce
  834. 43630 for i=0 to 15
  835. 43632 vl=0
  836. 43635 for j=0 to 11
  837. 43640 input#2,a
  838. 43650 poke pn+j+i*16,a
  839. 43655 vl=vl+a
  840. 43660 next j
  841. 43670 poke pn+12+i*16,100-vl
  842. 43680 for j=0 to 7
  843. 43690 input#2,a
  844. 43700 poke po+j+i*8,a
  845. 43710 next j,i
  846. 43720 close 2
  847. 43730 close 15
  848. 43735 gosub 3210:gosub 3010:rem reset sid counter & clear all channels
  849. 43740 return
  850. 43800 rem save probability file
  851. 43805 open 15,8,15
  852. 43810 open 2,8,2,n$+".p,s,w"
  853. 43815 input#15,en,er$,tr,se
  854. 43820 if en<>0 then print"[147] save[146]";:goto 44010
  855. 43825 print" saving probability file :           [146]";
  856. 43830 for ce=1 to 3
  857. 43835 print#2,n(ce)
  858. 43840 print#2,cs(ce)
  859. 43845 for i=0 to n(ce)-1
  860. 43850 print#2,peek(pt+i+(ce-1)*256)
  861. 43855 next i,ce
  862. 43860 for i=0 to 15
  863. 43865 for j=0 to 11
  864. 43870 print#2,peek(pn+j+i*16)
  865. 43875 next j
  866. 43880 for j=0 to 7
  867. 43885 print#2,peek(po+j+i*8)
  868. 43890 next j,i
  869. 43900 close 2
  870. 43905 close 15
  871. 43910 return
  872. 44000 rem file error routine
  873. 44010 close 2:close 15
  874. 44020 print" error : press [return]          [146]";:print
  875. 44030 print"file : ";n$
  876. 44040 print"error # : ";en:print"";er$:print"tr = ";tr;" : se = ";se
  877. 44050 get x$:if x$<>chr$(13) then 44050
  878. 44060 return
  879. 44100 rem initialise disk
  880. 44110 open 15,8,15,"i"
  881. 44120 print" initialise disk :                   [146]";
  882. 44130 close 15
  883. 44140 return
  884. 44200 rem validate disk
  885. 44210 open 15,8,15,"v"
  886. 44220 print" validate disk :                     [146]";
  887. 44230 close 15
  888. 44240 return
  889. 44300 rem scratch file
  890. 44310 open 15,8,15
  891. 44320 print" scratch file :                      [146]";
  892. 44330 if a=1 then print#15,"s:"+n$+".s":goto 44380
  893. 44340 if a=2 then print#15,"s:"+n$+".p":goto 44380
  894. 44350 print#15,"s:"+n$+".1"
  895. 44360 print#15,"s:"+n$+".2"
  896. 44370 print#15,"s:"+n$+".3"
  897. 44380 close 15
  898. 44390 return
  899. 45000 rem disk directory read
  900. 45010 i=0:fi$(i)=""
  901. 45020 open 1,8,0,"$0"
  902. 45030 get#1,x$,x$
  903. 45040 get#1,x$,x$
  904. 45050 get#1,x$,a$
  905. 45060 vl=0
  906. 45070 if x$<>"" then vl=asc(x$)
  907. 45080 if a$<>"" then vl=vl+asc(a$)*256
  908. 45090 bf=vl
  909. 45100 get#1,x$:if st<>0 then 45210
  910. 45110 if x$<>chr$(34) then 45100
  911. 45120 get#1,x$:if x$<>chr$(34) then fi$(i)=fi$(i)+x$:goto 45120
  912. 45130 get#1,x$:if x$=chr$(32) then 45130
  913. 45140 if right$(fi$(i),2)=".1" then fi$(i)=left$(fi$(i),len(fi$(i))-1)+"m":i=i+1
  914. 45150 if right$(fi$(i),2)=".s" then i=i+1
  915. 45155 if right$(fi$(i),2)=".p" then i=i+1
  916. 45160 if i=37 then 45210
  917. 45170 a$="":fi$(i)=""
  918. 45180 a$=a$+x$:get#1,x$:if x$<>"" then 45180
  919. 45190 if st=0 then 45040
  920. 45200 close 1
  921. 45210 fi=i:dy=0
  922. 45220 close 1
  923. 45230 goto 38505
  924. 50000 rem initialisation
  925. 50010 if peek(51712)=1 then 50110:rem machine code present
  926. 50020 rem load machine code
  927. 50030 poke 53280,5:poke 53281,5
  928. 50040 print"[147][176][174]"
  929. 50050 print"aleatory composer"
  930. 50060 print"v.h.berryc.1989"
  931. 50070 print"[173][189]"
  932. 50080 print"loadingmachinecode"
  933. 50090 i=i+1:if i=1 then load"sequencer mc",8,1
  934. 50095 if i=2 then load"data table mc",8,1
  935. 50100 if i=3 then load "note table mc",8,1
  936. 50110 dim en$(3,15):rem envelope data
  937. 50112 dim fi$(36)
  938. 50114 dim l$(11):rem note letter names
  939. 50115 dim cs(3),n(3):rem occurance% & notes#
  940. 50116 pn=49664:rem note probability table address
  941. 50117 po=49920:rem octave probability table address
  942. 50118 pt=50176:rem probability table index address
  943. 50120 ch=51968:rem music data address
  944. 50130 sid=54272:rem sid address
  945. 50140 fsid=49175:rem false sid data address
  946. 50150 nh=51712:rem note table high byte
  947. 50160 nl=51840:rem note table low byte
  948. 50170 mf=0:rf=-1:rem music & record flag
  949. 50190 ac=100:rem default auto store counter
  950. 50200 pw=409:rem pulse width increment=10%
  951. 50205 pe=5:rem probability increment
  952. 50210 n$="music file"
  953. 50220 rem read envelope data
  954. 50230 for i=0 to 3
  955. 50250 for j=0 to 15
  956. 50260 read x$
  957. 50270 en$(i,j)=x$
  958. 50280 next j,i
  959. 50282 rem read note letter names
  960. 50284 for i=0 to 11
  961. 50286 read x$
  962. 50288 l$(i)=x$
  963. 50289 next
  964. 50500 rem set default limits
  965. 50510 n(1)=40:n(2)=24:n(3)=64:rem number of notes in each channel
  966. 50520 gosub 3010:rem clear all channels
  967. 50525 gosub 3210:rem reset sid counter
  968. 50530 os=1:rem edit voice 1
  969. 50550 poke 53280,0:poke 53281,0
  970. 50560 return
  971. 60000 rem attack data
  972. 60010 data "  2 ms","  8 ms"," 16 ms"," 24 ms"
  973. 60020 data " 38 ms"," 56 ms"," 68 ms"," 80 ms"
  974. 60030 data "100 ms","250 ms","500 ms","800 ms"
  975. 60040 data "1   s ","3   s ","5   s ","8   s "
  976. 60050 rem decay data
  977. 60060 data "  6 ms"," 24 ms"," 48 ms"," 72 ms"
  978. 60070 data "114 ms","168 ms","204 ms","240 ms"
  979. 60080 data "300 ms","750 ms","1.5 s ","2.4 s "
  980. 60090 data "3   s ","9   s ","15  s ","24  s "
  981. 60100 rem sustain data
  982. 60110 data "  0 %","  7 %"," 13 %"," 20 %"
  983. 60120 data " 27 %"," 33 %"," 40 %"," 47 %"
  984. 60130 data " 53 %"," 60 %"," 67 %"," 73 %"
  985. 60140 data " 80 %"," 87 %"," 93 %","100 %"
  986. 60150 rem release data
  987. 60160 data "  6 ms"," 24 ms"," 48 ms"," 72 ms"
  988. 60170 data "114 ms","168 ms","204 ms","240 ms"
  989. 60180 data "300 ms","750 ms","1.5 s ","2.4 s "
  990. 60190 data "3   s ","9   s ","15  s ","24  s "
  991. 60200 rem note letter name data
  992. 60210 data "c","c#","d","d#"
  993. 60220 data "e","f","f#","g"
  994. 60230 data "g#","a","a#","b"
  995.