home *** CD-ROM | disk | FTP | other *** search
/ Publication 11 / Publication_11_19xx_-_de_Side_B.d64 / bassist (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  10KB  |  343 lines

  1. 10 rem *********+*
  2. 20 rem * bassist *
  3. 40 rem ***********
  4. 50 :
  5. 60 rem
  6. 70 :
  7. 80 poke53280,0:poke53281,0:printchr$(14)chr$(8)"[147]"
  8. 90 ifz=0thenz=1:x$="":z$="":load"   bassist2",8,1
  9. 100 :
  10. 101 rem definitionen & init.
  11. 102 :
  12. 200 hm=100:dimh$(hm),hd%(hm),ha%(hm),hs%(hm),hg%(hm),f(11),p(4,2)
  13. 205 dims$(12,1),sp(6),sm(11),x$(16)
  14. 210 rem func.f.bit-muster (y=bit-muster,z=grundton,n=nr.1/2-ton ueber grundton):
  15. 212 deffn bs(n)=yorsm(n+z+(n+z>11)*12):rem funct. set bit
  16. 214 deffn bc(n)=yand4095-sm(n+z+(n+z>11)*12):rem funct. clear bit
  17. 216 deffn bt(n)=yandsm(n+z+(n+z>11)*12):rem funct. test bit
  18. 220 f=110:fori=0to11:f(i)=f:f=f*1.059463094:sm(i)=2^i:next:rem frequ.+bit-mask.
  19. 230 fori=0to6:readsp(i):next:rem skala-pointers (a...g)
  20. 240 forj=0to1:fori=0to12:reads$(i,j):nexti,j:rem #- & b-skalen
  21. 250 fori=0to4:forj=0to2:readp(i,j):nextj,i:rem parameter
  22. 260 c$=chr$(13):r=54272:rem adr.sid-reg.
  23. 265 mn$="   < mit 'f1' zurueck ins [205]enue >"
  24. 266 m0$="       [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  25. 267 m1$="       [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  26. 268 m2$="      [167] "
  27. 269 m3$="      [167]                         [165]"
  28. 270 ps$="  -[219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219]+"
  29. 275 l$="                                       "
  30. 280 fa=.943874:fk=6.378901:f6=1.019440644:fo=1.37:f1=150:f2=300:rem frequ.konst
  31. 290 ap=49152:fs=ap+22:rb=251:rp=252:rem adr.f.ass-prog
  32. 300 :
  33. 301 rem menue
  34. 302 :
  35. 310 gosub6950:z=32:print"[147][159]"m0$:printm3$
  36. 320 printm2$tab(13)"[194] [193] [211] [211] [201] [211] [212]"tab(z)"[165]":printm3$:printm1$:printm0$:printm3$
  37. 321 printm2$"1=[206]eueingabe/[197]ditieren"tab(z)"[165]":printm3$
  38. 322 printm2$"2=[193]bspeichern auf [196]isk"tab(z)"[165]":printm3$
  39. 323 printm2$"3=[197]inlesen von [196]isk"tab(z)"[165]":printm3$
  40. 324 printm2$"4=[208]lay [194]ass [211]olo"tab(z)"[165]":printm3$
  41. 325 printm2$"5=[208]lay [194]ass+[211]chlagzeug"tab(z)"[165]":printm3$
  42. 326 printm2$"6=[208]arameter-[197]instellung"tab(z)"[165]":printm3$
  43. 327 printm2$"7=[197]nde"tab(z)"[165]":printm3$:printm1$
  44. 330 getz$:ifz$<"1"orz$>"7"then330
  45. 340 z=val(z$):onzgosub8000,2000,3000,500,505,5000,900
  46. 350 poke198,0:goto300
  47. 390 end
  48. 500 :
  49. 501 rem play
  50. 502 :
  51. 504 kp=1:goto510
  52. 505 kp=0
  53. 510 print"[147]     "mt$:print""mn$""
  54. 520 tr%=1:az=1:fl=0:h=0:h$(ht+1)=h$(1):pr$=""
  55. 525 au=hd%(ht)-a4+1:ifau<1thenau=1
  56. 530 gosub6900:gosub1800
  57. 540 forw=1towa:hb=-1:hn=1:h4=0
  58. 550 hl=h:h=hn:hn=h+1:ifh>htthen850
  59. 555 ifh<hlthenpr$="[215]iederholung"
  60. 560 ifh>hl+1thenpr$="[197]nde [215]iederholung"
  61. 570 ifhn=hb+1thenhn=hw:hb=-1
  62. 580 ifh$(hn)="w"thenhb=hd%(hn):hw=hn+1:hn=hg%(hn)
  63. 590 forhd=1tohd%(h):h4=h4+1:ifh4>a4thenh4=1
  64. 600 :
  65. 601 rem ton bestimmen
  66. 602 :
  67. 605 ifh$(h)="[208]ause"then630
  68. 610 ifw<waorh<ht orhd<authen640
  69. 620 ifhd=authenta%=hg%(h):goto680:rem letzter takt bass aushalten
  70. 630 ta%=12:fw=0:goto720:rem pause
  71. 640 if(h4and1)orhd=hd%(h)then650
  72. 645 ifrnd(0)<p(3,0)then630
  73. 650 ifhd=1andhg%(h)<>hg%(hl)thenta%=hg%(h):goto680:rem neue harmonie beginnt
  74. 660 ifhd<>hd%(h)orhg%(h)=hg%(hn)then670:rem es folgt keine neue harmonie
  75. 662 ifh$(hn)="[208]ause"thenta%=hg%(h):goto680:rem pause folgt
  76. 665 sysap+12,ha%(h),ha%(hn),hg%(h),hg%(hn),tr%,ta%:goto680:rem ueberg.ton suchen
  77. 670 ifrnd(0)<p(4,0)thensysap+15,ha%(h),ta%:goto680:rem zufalls-ton
  78. 675 sysap+9,ha%(h),tr%,ta%:rem nae.akkordeig.ton suchen
  79. 680 f=f(ta%):iff=florf*fo<flandf+f<>flthenf=f+f:rem frequ.
  80. 690 tr%=1+2*(f<fl):iff<f1thentr%=1:rem trend bestimmen
  81. 695 iff>f2thentr%=-1:rem ...dabei eckfrequ. beachten
  82. 700 :
  83. 701 rem ton ausgeben
  84. 702 :
  85. 710 fl=f:fw=f*fu:rem frequ.in sid-wert umrechnen
  86. 720 if(hd>1orh$(h)=h$(hl))andh4>1then800
  87. 730 ifazthengosub1500:az=0
  88. 740 ifpeek(fs)then740:rem warte bis letzter ton v.irq-rout.behandelt ...
  89. 750 ifpr$>""thenprint:print:printpr$:pr$=""
  90. 760 print:printh$(h)tab(9)": ";:rem ..erst dann harmonie-bez. ausgeben
  91. 800 sysap+6,h4,fw,fw*fa,s$(ta%,hs%(h)):rem ton mit bez. ->ass-prog
  92. 820 ifpeek(197)=4thenhd=hd%(h):hn=ht+1:w=wa:rem abbruch
  93. 830 nexthd:goto550
  94. 850 nextw:sysap+6,0,0,0,"":sysap+3:rem irq-rout. aus
  95. 890 fori=0to1500:next:return
  96. 900 :
  97. 901 rem ende
  98. 902 :
  99. 990 end
  100. 1300 :
  101. 1301 rem werte zu einer harmonie generieren
  102. 1302 :
  103. 1308 z=sp(asc(x$)-193):z$=mid$(x$,2,1):x=0
  104. 1310 ifz$="#"thenz=z+1:goto1335
  105. 1320 ifz$="b"thenz=z-1-(z<1)*12:x=1:goto1335
  106. 1330 ifz$<>" "thenx$=left$(x$,1)+" "+mid$(x$,2)
  107. 1332 ifz=3orz=8thenx=1:rem c- & f-skalen mit b (nicht #)
  108. 1335 h$(ht)=x$:hg%(ht)=z:hs%(ht)=x:rem bez./grundton/skala (# oder b)
  109. 1340 fori=0toht-1:ifh$(i)=x$theny=ha%(i):goto1400
  110. 1345 nexti:y=0
  111. 1350 y=fnbs(0)+fnbs(4)+fnbs(7):rem bit-muster f.grund-dreiklang
  112. 1355 fori=2tolen(x$):z$=mid$(x$,i,1)
  113. 1360 ifz$="m"theny=fnbc(4):y=fnbs(3):goto1399:rem moll
  114. 1365 ifz$="j"theny=fnbc(10):y=fnbs(11):goto1399:rem major
  115. 1370 ifz$="+"theny=fnbc(7):y=fnbs(8):goto1399:rem quinte +
  116. 1375 ifz$="-"theny=fnbc(7):y=fnbs(6):goto1399:rem quinte -
  117. 1380 ifz$="0"orz$="o"theny=fnbc(4):y=fnbs(3):y=fnbc(7):y=fnbs(6):rem vermindert
  118. 1382 ifz$="6"theny=fnbs(9):goto1399:rem sexte
  119. 1385 ifz$="7"then1398
  120. 1386 ifz$="9"then1397
  121. 1387 ifz$="1"then1396
  122. 1388 ifz$="3"then1395
  123. 1390 goto1399
  124. 1395 y=fnbs(9):rem 13-er
  125. 1396 y=fnbs(5):rem 11-er
  126. 1397 y=fnbs(2):rem  9-er
  127. 1398 iffnbt(11)=0theny=fnbs(10):rem 7-er, wenn nicht schon major-7
  128. 1399 nexti
  129. 1400 ha%(ht)=y:print:printx$tab(9)": ";
  130. 1410 fori=0to11:iffnbt(i)=0then1450
  131. 1420 prints$(i+z+(i+z>11)*12,x)" ";
  132. 1450 nexti:print:return
  133. 1500 :
  134. 1501 rem anzaehlen
  135. 1502 :
  136. 1510 sysap:rem init.irq-prog.
  137. 1511 print:print"[211]timmton : "s$(ta%,hs%(h))
  138. 1512 pokerb,1:z=fw:fori=1toa4
  139. 1514 sysap+6,128,z,0,"":z=0:next
  140. 1515 ifpeek(fs)then1515
  141. 1516 print:print"[193]nzaehlen:";
  142. 1520 pokerp,1:fori=1toa4
  143. 1530 sysap+6,128,0,0,str$(i):next
  144. 1540 ifkpthenpokerp,0
  145. 1550 pr$=" ":return
  146. 1800 :
  147. 1801 rem frequ.umrechn.konst. & tempo rechnen/->ass.prog.
  148. 1802 :
  149. 1820 fu=fk*f6^p(0,0):t0%=0
  150. 1840 rem vorschlaege bei tempi<130 ->1/16-noten, wenn schneller ->1/8-triolen
  151. 1850 ifp(1,0)<130thenz=int(900/p(1,0)+.5):t2%=2*z:t3%=t2%+z:t4%=t3%+z:goto1870
  152. 1860 z=int(1200/p(1,0)+.5):t2%=z:t3%=t2%+z:t4%=t3%+z:goto1870
  153. 1870 poker+5,10+t4%/50:rem bass-decay aufgrund tempo
  154. 1880 sysap+18,t2%,t3%,t4%:return
  155. 1897 :
  156. 1898 rem ton -> sid
  157. 1899 :
  158. 2000 :
  159. 2001 rem abspeichern auf disk
  160. 2002 :
  161. 2010 print"[147][193]bspeichern auf [196]isk"
  162. 2020 input"[205]usik-[212]itel";mt$
  163. 2030 gosub2700:iferthenreturn
  164. 2040 open2,8,2,mt$+",s,w":gosub2800:ifer=0then2050
  165. 2042 ifer<>63thenreturn
  166. 2044 print"[213]eberschreiben (j/n)? ";
  167. 2046 getz$:ifz$<>"j"andz$<>"n"then2046
  168. 2048 printz$:ifz$="n"then2090
  169. 2049 close2:print#15,"s0:"+mt$:goto2040
  170. 2050 print#2,ht;c$;a4;c$;wa:fori=0to4:print#2,p(i,0):next
  171. 2060 gosub2800:iferthenreturn
  172. 2070 fori=1toht:print#2,h$(i);c$;ha%(i);c$;hs%(i);c$;hg%(i);c$;hd%(i):nexti
  173. 2090 gosub2800:close2:close15:return
  174. 2600 :
  175. 2700 open15,8,15,"i0"
  176. 2800 input#15,er,er$,et,es:ifer=0thenreturn
  177. 2820 print:printer;er$;et;es:ifer<20orer=63thenreturn
  178. 2850 :
  179. 2900 close2:close15
  180. 2910 :
  181. 2950 print:print"<[212]aste druecken>":poke198,0
  182. 2960 getz$:ifz$=""then2960
  183. 2980 return
  184. 3000 :
  185. 3001 rem einlesen von disk
  186. 3002 :
  187. 3010 print"[147][212]itel eingeben oder '[210]eturn' fuer":print"[201]nhaltsverzeichnis"
  188. 3020 mt$="":inputmt$:ifmt$>""then3040
  189. 3030 gosub3500:iferormt$=""thenreturn
  190. 3040 gosub2700:open2,8,2,"0:"+mt$+",s,r":gosub2800:iferthenreturn
  191. 3050 input#2,ht,a4,wa:fori=0to4:input#2,p(i,0):ifp(i,0)<p(i,1)thenp(i,0)=p(i,1)
  192. 3055 ifp(i,0)>p(i,2)thenp(i,0)=p(i,2)
  193. 3060 nexti:gosub2800:iferthenreturn
  194. 3065 print"[147]"mt$"  :"str$(a4)"/4-[212]akt":print"[200]armonie  [196]auer in 1/4"
  195. 3070 fori=1toht:input#2,h$(i):z=asc(h$(i)+chr$(0)):ifz=87orz=208then3080:rem w+p
  196. 3075 ifz<193orz>199thenprint:print"*** [198]ile-[198]ehler ***":goto2900
  197. 3080 input#2,ha%(i),hs%(i),hg%(i),hd%(i)
  198. 3090 printh$(i)tab(12)hd%(i):nexti:fori=0to500:next:goto3900
  199. 3500 :
  200. 3510 gosub2700:iferthenreturn
  201. 3515 open2,8,2,"#":dt=18:ds=1
  202. 3520 print#15,"u1";2;0;dt;ds
  203. 3522 print"[147][201]nhalt:":print"[206]r [212]itel":print"[163][163] [163][163][163][163][163]"
  204. 3525 print#15,"b-p";2;0:get#2,z$:dt=asc(z$+chr$(0)):get#2,z$:ds=asc(z$+chr$(0))
  205. 3530 fori=0to7:print#15,"b-p";2;i*32+2
  206. 3540 get#2,z$:ifz$<>chr$(129)then3600
  207. 3550 get#2,z$,z$
  208. 3560 x$="":forj=1to16:get#2,z$:x$=x$+z$:next:z$(i)=x$:printi;x$
  209. 3600 next:print"[212]aste druecken:":print"[206]r.0...7 = diesen [212]itel einlesen"
  210. 3610 print"'[211]pace'  = weiter im [201]nhaltsverzeichnis"
  211. 3620 print"'f1'     = zurueck ins [205]enue"
  212. 3640 getz$:ifz$=""then3640
  213. 3650 ifz$=chr$(133)thenmt$="":goto3900
  214. 3660 ifz$=>"0"andz$<"8"thenmt$=z$(val(z$)):goto3900
  215. 3670 ifz$<>" "then3640
  216. 3680 ifdt<1ordt>35thenprint"keine weiteren [212]itel":goto3640
  217. 3690 goto3520
  218. 3900 close2:close15:return
  219. 5000 :
  220. 5001 rem parameter aendern
  221. 5002 :
  222. 5020 print"[147][208]arameter-[197]instellungen:"
  223. 5030 print"[206]r. waehlen (1-5) und mit +/- aendern"
  224. 5100 print"1)          [211]timmung[146] (a=220 [200]z)"
  225. 5110 print"   e  f  f# g  g# a  a# b  c  c# d":printps$
  226. 5120 print"2) 30 45 60 [212]empo[146]   120   150   180":printps$
  227. 5130 print"3) dunkel   [194]ass-[198]ilter[146]       hell":printps$
  228. 5140 print"4) 1/4      [194]ass-[206]oten[146]         1/2":printps$
  229. 5150 print"5) [212]rend    [194]ass-[204]inie[146]      [218]ufall":printps$
  230. 5160 print""mn$""
  231. 5165 :
  232. 5170 forpn=0to4:gosub5500:next
  233. 5180 gosub6900:pn=0:f=220
  234. 5190 gosub1800:sysap:sysap+6,0,f*fu,0,"":pokerb,1
  235. 5200 z=peek(197):ifz=4then5900
  236. 5210 ifz=56thenpn=0
  237. 5220 ifz=59thenpn=1
  238. 5230 ifz=8 thenpn=2
  239. 5240 ifz=11thenpn=3
  240. 5250 ifz=16thenpn=4
  241. 5290 ifz<>40andz<>43then5200
  242. 5300 i=(p(pn,2)-p(pn,1))/30:ifz=43theni=-i
  243. 5310 p(pn,0)=p(pn,0)+i
  244. 5320 ifp(pn,0)<p(pn,1)thenp(pn,0)=p(pn,1)
  245. 5330 ifp(pn,0)>p(pn,2)thenp(pn,0)=p(pn,2)
  246. 5400 :
  247. 5410 gosub5500:ifpn=0orpn=1then5190
  248. 5415 ifpn=2thenpoker+22,p(2,0)
  249. 5420 goto5200
  250. 5490 :
  251. 5500 print"":fori=0topn:print"";:next
  252. 5510 z=int(30/(p(pn,2)-p(pn,1))*(p(pn,0)-p(pn,1))+3.5)
  253. 5520 printleft$(l$,z)"^"left$(l$,35-z)
  254. 5530 return
  255. 5900 :
  256. 5910 sysap+3:return
  257. 6900 :
  258. 6901 rem init.sid-registers: bass=vco#1+2, perc=vco#3
  259. 6902 :
  260. 6910 gosub6950:poker+10,1:poker+12,8:rem vco#2
  261. 6920 poker+15,80:rem vco#3
  262. 6930 poker+22,p(2,0):poker+23,240+8+2+1:poker+24,16+15:rem filter & volume
  263. 6940 return
  264. 6950 fori=r+24torstep-1:pokei,0:next:return
  265. 8000 :
  266. 8001 rem neueingabe / editieren
  267. 8002 :
  268. 8100 ifht<1thenprint"[147][206]eueingabe":goto8150
  269. 8102 print"[147][206]eueingabe oder [197]ditieren (n/e)?";
  270. 8105 getz$:ifz$=""then8105
  271. 8110 printz$:ifz$="n"then8150
  272. 8120 ifz$="e"thenhl=ht:goto8200
  273. 8130 goto8100
  274. 8150 hl=0:a4=4:wa=1
  275. 8200 ht=0:h=0
  276. 8210 print"[193]nzahl 1/4 pro [212]akt  "a4:printtab(20)"[145]";:inputa4
  277. 8220 print"[193]nzahl [199]esamt-[215]iederholungen  "wa:printtab(29)"[145]";:inputwa
  278. 8300 print"[147][200]armoniefolge eingeben (*=[197]nde [197]ingaben)"
  279. 8305 print" p=[208]ause            w=[215]iederholung"
  280. 8310 print" [193]...[200] (oder a...h)  =[199]rund-[196]reiklang"
  281. 8315 print" #=erhoeht          b=erniedrigt"
  282. 8320 print" j=major            m=moll"
  283. 8330 print" +=erhoehte [209]uint   -=erniedrigte [209]uint"
  284. 8340 print" o=vermindert       [194]=deutsches [200]"
  285. 8350 print" 6,7,9,11,13=[211]ext,[211]ept,[206]one,usw."
  286. 8360 print"[194]eispiele:"
  287. 8365 print" [195]    =[195]-[196]ur-[193]kkord"
  288. 8370 print" [198]#m9 =[198]is-[205]oll-[206]one-[193]kkord"
  289. 8380 print" [199]b6/7=[199]es-[211]ext/[211]ept-[193]kkord"
  290. 8390 print" [194]b7j =[194]es-major-[211]ept-[193]kkord"
  291. 8400 x$="":hd=4:ifht<hlthenx$=h$(ht+1):hd=hd%(ht+1)
  292. 8410 print"[212]akt"right$("  "+str$(int(h/a4)+1),3)":   "x$:printtab(9)"[145]";
  293. 8420 inputx$:x=asc(x$+chr$(0))and127
  294. 8430 ifx=42then8900:rem * (ende)
  295. 8435 ifx=87then8500:rem w (wiederh.)
  296. 8440 ifx=72thenx=66:rem h wird b
  297. 8445 ifx=80thenht=ht+1:h$(ht)="[208]ause":goto8480:rem p (pause)
  298. 8450 ifx<65orx>71thenprint"*** [198]ehler ***":goto8400
  299. 8460 x$=chr$(x+128)+mid$(x$,2)
  300. 8470 ht=ht+1:gosub1300
  301. 8480 print"[196]auer in 1/4  "hd:printtab(13)"[145]";:inputhd::h=h+hd
  302. 8490 hd%(ht)=hd:goto8400
  303. 8500 :
  304. 8501 rem wiederholungszeichen bearbeiten
  305. 8510 ifht=>hlthenhd=ht:hg%(ht+1)=1
  306. 8520 ht=ht+1:h$(ht)="w"
  307. 8530 print"ab der wievielten [200]armonie"
  308. 8535 print"soll wiederholt werden"
  309. 8537 print" "hg%(ht):print"[145]";:inputz:ifz>ht-2orz<1then8530
  310. 8538 hg%(ht)=z
  311. 8540 print"bis (und mit) zur wievielten [200]armonie"
  312. 8545 print"soll wiederholt werden ( letzte="ht-1")"
  313. 8550 print" "hd:print"[145]";:inputz:ifz=>ht orz<=hg%(ht)then8530
  314. 8560 hd%(ht)=z:goto8400
  315. 8900 :
  316. 8910 ifht<hlthenht=hl:rem exit, korr.ht wenn edit.
  317. 8920 return
  318. 9000 :
  319. 9100 :
  320. 9101 rem skala-pointers a,b,c,d,e,f,g
  321. 9102 :
  322. 9110 data0,2,3,5,7,8,10
  323. 9200 :
  324. 9201 rem # und b-skalen chromat.
  325. 9202 :
  326. 9210 data"[193] ","[193]#","[194] ","[195] ","[195]#","[196] ","[196]#","[197] ","[198] ","[198]#","[199] ","[199]#","\ "
  327. 9220 data"[193] ","[194]b","[194] ","[195] ","[196]b","[196] ","[197]b","[197] ","[198] ","[199]b","[199] ","[193]b","\ "
  328. 9400 :
  329. 9401 rem param. std/tiefst/hoechst-werte
  330. 9402 :
  331. 9410 data 15,0,30:rem stimmung (1/6-toene oberhalb 'e' ->'e'...'d')
  332. 9420 data105,30,180:rem tempo
  333. 9430 data15,0,30:rem bass-filter
  334. 9440 data.2,0,1:rem 1/4 - 1/2 noten
  335. 9450 data.2,0,1:rem trend - zufall
  336. 9480 :
  337. 50000 :
  338. 50001 rem save prog.
  339. 50002 :
  340. 50010 open15,8,15,"s0:bassist":gosub2800
  341. 50020 save"bassist",8:gosub2800:close15
  342. 50030 end
  343.