home *** CD-ROM | disk | FTP | other *** search
- 100 goto1000:rem ***** 16-bit calculation *****
- 200 kk=peek(key):ifkk=nullthen200
- 205 rem key pressed, use vars for speed
- 210 j=bb:z=peek(h+bb):hh=peek(shft)
- 215 rem cur-up=7,cur-lft=2,return=1
- 220 onkkgoto240,250,230,230,230,230,260
- 230 return:rem no valid key, keep value
- 240 j=int((z+bb)*k/cc):goto260
- 245 rem vry fast,larger for higher vals
- 250 j=k:rem moderate increment
- 260 z=peek(h)+z*xx+j*((hh=aa)-(hh>aa))
- 265 rem h set by caller, add incr
- 266 rem incr is pos if shift key down
- 270 ifz<aathenz=aa:rem min & max vals
- 280 ifz>zzthenz=zz
- 290 gosub930:rem position cursor
- 295 rem print value if pitch or filter
- 300 ifdv<>ccthenprintz"[157] ":goto320
- 305 rem print % of duty cycle
- 310 printint(z/4.095)/10"[157]% "
- 315 rem put value in buffer
- 320 pokeh+bb,z/xx:pokeh,z-int(z/xx)*xx
- 330 ifdv>ccthen360:rem branch for fltr
- 335 rem put val in sid, back for more
- 340 pokeyy,peek(h):pokeyy+bb,peek(h+bb)
- 350 goto200
- 355 rem filter is odd; 11-bit value
- 356 rem stored 3 low, 8 high
- 360 pokeyy,zand7:pokeyy+bb,z/8
- 370 goto200:rem ***** 8-bit calculation *****
- 400 kk=peek(key):ifkk=nullthen400
- 405 rem key pressed, is it valid?
- 410 onkkgoto430,430,420,420,420,420,430
- 415 rem no, return with value kept
- 420 return
- 430 hh=peek(shft):bb=sbuf+h
- 435 rem add increment (same for any
- 436 rem valid key), pos if shift down
- 440 z=(peek(bb)andj)/k+(hh=0)-(hh>0)
- 450 ifz<0thenz=0:rem min & max values
- 460 ifz>15thenz=15
- 470 gosub930:printz"[157] ":rem pos & prnt
- 475 rem mask on to byte
- 480 z=peek(bb)and255-jorz*k
- 485 rem insert & go back for more
- 490 pokebb,z:pokesid+h,z:goto400:rem ***** bit decoding *****
- 700 yy=peek(sbuf+xx):rem value of byte
- 710 z=int((yyandj)/k):rem val of bit(s)
- 715 rem mask values set by caller
- 720 return:rem ***** bit encoding *****
- 800 yy=yyand255-jorz*k:rem encode
- 810 pokesbuf+xx,yy:rem set buffer
- 820 pokesid+xx,yy:rem set sid
- 830 return:rem ***** cursor plotter *****
- 900 pokecx,wx%(ct)+cl:rem word row
- 910 pokecy,wy%(ct)+ofs:rem & column
- 920 goto950
- 930 pokecx,vx%(ct)+cl:rem value row
- 940 pokecy,vy%(ct):rem & column
- 950 sysmove:return:rem move cursor
- 996 rem ** main routine **
- 1000 gosub 50000:rem initialize ***** key input *****
- 1100 kk=peek(key):ifkk=nullthen1100
- 1105 rem key pressed, if shift is
- 1106 rem down, skip entry level calc
- 1110 hh=peek(shft):ifhh=1then1500
- 1115 rem entry level into voices?
- 1120 ifkk<f1orkk>f5then1500
- 1125 rem change entry level & clear
- 1130 el=kk-4:dv=-1:gosub53000:goto1100
- 1496 rem ***** key dispatch *****
- 1500 ifkk=fthen2000:rem frequency
- 1510 ifkk=pthen2000:rem pulse width
- 1520 ifkk=athen3000:rem attack
- 1530 ifkk=dthen3000:rem decay
- 1540 ifkk=sthen3000:rem sustain
- 1550 ifkk=rthen3000:rem release
- 1560 ifkk=wthen4000:rem waveform
- 1570 ifkk=gthen4000:rem gate
- 1580 ifkk=ithen4000:rem ring
- 1590 ifkk=ythen4000:rem sync
- 1600 ifkk=qthen2000:rem filter freq
- 1610 ifkk=nthen3000:rem resonance
- 1620 ifkk=vthen3000:rem volume
- 1630 ifkk=mthen5000:rem mode
- 1640 ifkk=n1then5000:rem assign
- 1650 ifkk=n2then5000
- 1660 ifkk=n3then5000
- 1670 ifkk=xthen5000
- 1680 ifkk=othen6000:rem osc3
- 1690 ifkk=ethen6000:rem env3
- 1700 ifkk=tthen5000:rem 3 off
- 1705 rem special functions
- 1710 ifkk=f1thengosub7000:goto1100
- 1720 ifkk=f3thengosub7000:goto1100
- 1730 ifkk=f5thengosub7000:goto1100
- 1740 ifkk<>f7orhh=0then1800:rem end?
- 1750 geta$:ifa$<>""then1750:rem clr buf
- 1760 pokesid+24,0:syscs:end:rem end
- 1800 dv=-1:gosub53020:rem no valid key
- 1810 gosub52000:goto1100:rem oops ***** 16-bit evaluation *****
- 2000 dv=1:ifkk=pthendv=2
- 2010 ifkk=qthendv=12
- 2015 rem dv:1=voice freq, 2=pls wdth
- 2016 rem 12=filter freq, clear old
- 2017 rem vars used for speed
- 2018 rem zz=max val, h=sid reg
- 2020 gosub53020:xx=256:aa=0:bb=1:cc=2
- 2030 k=29:h=0:zz=65535:j=7
- 2040 ifdv=2thenzz=4095:h=2
- 2050 ifdv=12thenzz=2047:h=21:j=0
- 2055 rem pre-calculate buffer & sid
- 2056 rem entry points
- 2060 yy=sid+el*j+h:h=sbuf+el*j+h
- 2065 rem calc & display values
- 2066 rem once a non-valid key is found
- 2067 rem in subroutine, exit with key
- 2068 rem value intact
- 2070 gosub200:goto1110:rem ***** 8-bit evaluation *****
- 3000 dv=4:h=el*7+5:j=240:k=16:rem atck
- 3005 rem decay, sustain, release?
- 3010 ifkk=dthendv=5:j=15:k=1
- 3020 ifkk=sthendv=6:h=el*7+6
- 3030 ifkk=rthendv=7:h=el*7+6:j=15:k=1
- 3035 rem resonance or volume?
- 3040 ifkk=nthendv=13:h=23
- 3050 ifkk=vthendv=14:h=24:j=15:k=1
- 3055 rem clear, calc & display values
- 3056 rem when non-valid key pressed,
- 3057 rem return with value intact
- 3060 gosub53020:gosub400:goto1110:rem ***** ctrl byte calculation *****
- 4000 dv=-1:gosub53020:rem clear
- 4005 rem set mask values
- 4010 xx=4+el*7:dv=3:j=240:rem waveform
- 4020 ifkk=gthendv=8:j=1:rem gate
- 4030 ifkk=ithendv=9:j=4:rem ring
- 4040 ifkk=ythendv=10:j=2:rem sync
- 4050 k=j:ifj=240thenk=16
- 4055 rem go get value from sid buffer
- 4056 rem branch if waveform
- 4060 gosub700:ifdv=3then4110
- 4066 rem toggle value
- 4070 z=-(z=0):cl=el*5:ct=dv
- 4080 ifz=1thenprint"";:rem highlight
- 4090 gosub53070:goto4190:rem display
- 4100 rem
- 4105 rem inc 0->1,1->2,2->4,4->8,8->0
- 4110 z=(z*2-(z=0))*-(z<8)
- 4120 ct=dv:cl=el*5:gosub930:rem mve crs
- 4125 rem display waveform
- 4130 a$="-":ifz=1thena$="t
- 4140 [139]z[178]2[167]a$[178]"s
- 4150 ifz=4thena$="p
- 4160 [139]z[178]8[167]a$[178]"n
- 4170 printa$
- 4180 rem
- 4190 gosub800:goto1100:rem store & rtrn ***** filt/mode calculation *****
- 5000 dv=-1:gosub53020:rem clear old
- 5010 dv=15:ct=dv:cl=0:rem mode
- 5015 rem filter assignment?
- 5020 ifkk=n1thendv=16:h=1:goto5500
- 5030 ifkk=n2thendv=17:h=2:goto5500
- 5040 ifkk=n3thendv=18:h=4:goto5500
- 5050 ifkk=xthendv=19:h=8:goto5500
- 5055 rem 3 off?
- 5060 ifkk=tthendv=22:goto5200
- 5070 rem
- 5075 rem mode increment
- 5080 xx=24:j=112:k=16:gosub700
- 5085 rem incr 0->1,1->2,2->4,4->0
- 5086 rem program modification possible
- 5087 rem to allow more than one mode
- 5088 rem at the same time
- 5090 z=(z*2-(z=0))*-(z<4)
- 5100 gosub930:rem move cursor
- 5110 a$=" -":ifz=1thena$="lp
- 5120 [139]z[178]2[167]a$[178]"bp
- 5130 ifz=4thena$="hp
- 5140 [153]a$:[137]5550:[143] display
- 5150 [143]
- 5155 [143] turn 3 off
- 5200 ct[178]dv:xx[178]24:j[178]128:k[178]1:[141]700
- 5205 [143] mask & toggle
- 5210 zz[178]128[172][171]((z[175]j)[178]0):h[178]1:[137]5520
- 5220 [143]
- 5225 [143] assign filter
- 5500 ct[178]dv:xx[178]23:j[178]15:k[178]1:[141]700
- 5510 zz[178]h[172][171]((z[175]h)[178]0):[143] mask & toggle
- 5520 [139]zz[177]0[167][153]"";
- 5530 [141]53090:[143] display
- 5540 z[178]z[175]j[171]h[176]zz
- 5550 [141]800:[137]1100:[143] store & rtrn ***** i/o insert *****
- 6000 dv[178][171]1:[141]53020:[143] clear
- 6005 [143] default to osc
- 6010 h[178]os:ct[178]20:cl[178]0:[139]kk[178]o[167]6030
- 6015 [143] envelope
- 6020 h[178]en:ct[178]21
- 6030 j[178][194](h):[143] read value
- 6035 [143] value switch
- 6036 [143] either 255 (off),0 (voice 1,
- 6037 [143] low),1 (voice 1, high), or 22
- 6038 [143] (filter frequency, high)
- 6040 j[178][171](j[178]0)[171]22[172](j[178]1)[171]255[172](j[178]22)
- 6050 [151]h,j:[141]930:[143] save & move
- 6055 [143] calculate display
- 6060 j[178]1[171](j[177]0)[171](j[177]1)[171](j[177]22)
- 6070 [153][202]("lhf-",j,1):[137]1100
- 6996 [143] ***** function keys *****
- 7000 dv[178][171]1:[141]53020:[143] clear
- 7005 [143] cannot arrive here unless
- 7006 [143] shift key was pressed, so
- 7007 [143] f1=f2,f3=f4,f5=f6
- 7010 h[178]0:ct[178]8:j[178]1:k[178]1:[143] default
- 7015 [143] f1(f2)=toggle, f3(f4)=all off
- 7020 [139]kk[178]f1[176]kk[178]f3[167]7100
- 7025 [143] f5(f6)=on then off
- 7026 [143] z=read value, set to 1
- 7027 [143] will cause a toggle to 0
- 7028 [143] h serves to adjust z
- 7030 h[178]1:[141]7100
- 7040 h[178]2
- 7095 [143] voice gates at sid+4,11,18
- 7100 [129]xx[178]4[164]18[169]7
- 7105 :[143] if f3, set to turn off
- 7110 :[141]700:[139]kk[178]f3[167]z[178]1
- 7115 :[143] adjust for f5
- 7120 :[139]h[177]0[167]z[178]h[171]1
- 7125 :[143] calculate display row
- 7130 :cl[178][171]5[172](xx[178]11)[171]10[172](xx[178]18)
- 7135 :[143] display as on/off
- 7140 :[145](z[179][177]1)[170]2[141]53060,53070
- 7150 :z[178][171](z[178]0):yy[178]yy[175]254[176]z
- 7155 :[143] save in buffer
- 7160 :[151]sbuf[170]xx,yy
- 7170 [130]
- 7175 [143] move to sid quickly
- 7180 [129]xx[178]4[164]18[169]7
- 7190 :[151]sid[170]xx,[194](sbuf[170]xx)
- 7200 [130]:[142]:[143] ** initialize **
- 49995 [143] * put in system routines *
- 49996 [143] * cursor plot routine *
- 50000 move[178]679:cx[178]251:cy[178]252
- 50010 [129]xx[178]move[164]move[170]7
- 50020 :[135]yy:[151]xx,yy
- 50030 [130]:[143] interrupt routine
- 50040 [129]xx[178]712[164]760
- 50050 :[135]yy:[151]xx,yy
- 50060 [130]:[143] ***** variable assignment *****
- 50100 key[178]203:shft[178]653:null[178]64
- 50105 [143] peek(key)=val of current
- 50106 [143] key down, peek(shft)>0 if
- 50107 [143] shift,c=,or ctrl pressed
- 50108 [143] peek(key)=null means no key
- 50110 up[178]7:fa[178]2:lo[178]1:xx[178]0:yy[178]0:zz[178]0:z[178]0
- 50115 [143] up=cursor up/down=slow
- 50116 [143] fa=crsr lft/rght=moderate
- 50117 [143] lo=return=fast
- 50118 [143] no shift=down, shift=up
- 50120 kk[178]0:hh[178]0:h[178]0:j[178]0:k[178]0:dv[178]0:ct[178]0
- 50125 [143] kk holds current key value
- 50126 [143] hh>0 if shift down
- 50127 [143] dv,ct,cl are display values
- 50130 cl[178]0:aa[178]0:bb[178]0:cc[178]0:sid[178]54272
- 50135 [143] op=move interrupt,cs=restore
- 50140 sbuf[178]move[170]8:op[178]712:cs[178]725
- 50145 [143] highlighted key values
- 50150 f1[178]4:f3[178]5:f5[178]6:f7[178]3
- 50160 f[178]21:p[178]41:w[178]9:a[178]10:d[178]18:s[178]13:r[178]17
- 50170 g[178]26:i[178]33:y[178]25:q[178]62:n[178]39:m[178]36
- 50180 v[178]31:n1[178]56:n2[178]59:n3[178]8
- 50185 [143] en,os used in i/o
- 50190 x[178]23:o[178]38:e[178]14:t[178]22:en[178]254:os[178]253
- 50196 [143] ***** read screen data *****
- 50200 [134]wx%(22),wy%(22):[143] word x,y
- 50210 [134]vx%(22),vy%(22):[143] value x,y
- 50220 [134]wrd$(22):[143] display strings
- 50230 [129]xx[178]0[164]22
- 50240 :[135]wx%(xx),wy%(xx)
- 50250 :[135]vx%(xx),vy%(xx)
- 50260 :[135]wrd$(xx)
- 50270 [130]:[143] ***** display screen *****
- 50300 [153]"loadwaitcont sid editor - press a highlighted key
- 50310 print"crsr:[u/d]=slow,[l/r]=med, [return]=fast
- 50320 [129]xx[178]0[164]10[169]5:[143] voices 1-3
- 50325 :[143] 0=f1,5=f3,10=f5
- 50330 :a$[178][201]([196](2[172]xx[173]5[170]1),1)
- 50335 :[143] move cursor
- 50340 :ct[178]0:cl[178]xx:ofs[178][171]3:[141]900
- 50345 :[143] print "voice"
- 50350 :[153]"f"a$"cont "wrd$(0)xx[173]5[170]1
- 50355 :[143] z determines display type
- 50360 :[129]yy[178]1[164]10:z[178]1[171](yy[179]8)[171](yy[178]3)
- 50370 : ct[178]yy:ofs[178]0:[141]900
- 50380 : [153]wrd$(yy)" "[202](" 0-",z,1)
- 50390 :[130]
- 50400 [130]
- 50410 [143]
- 50415 [143] filter & volume stuff
- 50420 ct[178]11:cl[178]0:[141]900
- 50430 [153]wrd$(11)
- 50440 [129]xx[178]12[164]22:[139]xx[179][177]16[167]50460
- 50445 :[143] additional prompt
- 50450 :[153]" assign filter
- 50455 :rem a$=default display
- 50460 :a$="":ifxx<15thena$=" 0
- 50470 :[139]xx[178]15[176]xx[178]20[176]xx[178]21[167]a$[178]" -
- 50480 :ct=xx:gosub900:rem move cursor
- 50490 :printwrd$(xx)a$
- 50500 next:print
- 50510 print" f2[154]=toggle f4[154]=all off f6[154]=on/off f8[154]=quit";
- 50515 rem display values default
- 50520 el=0:oel=el:dv=-1:odv=dv
- 50598 rem ***** insert i/o into interrupt *****
- 50600 pokeen,255:pokeos,255:sysop
- 50996 rem ***** clear sid & buffer *****
- 51000 forxx=sidtosid+28
- 51020 : pokexx,0
- 51030 : pokesbuf+xx-sid,0
- 51040 next
- 51050 return:rem ***** error buzz ****
- 52000 pokesid+23,0:rem no filter
- 52010 pokesid+24,15:rem full vol
- 52020 pokesid+1,10:rem voice 1
- 52030 pokesid+5,0:rem no a/d
- 52040 pokesid+6,240:rem full sus
- 52050 pokesid+4,0:rem gate off
- 52060 pokesid+4,33:rem saw on
- 52070 forxx=1to80:next:rem delay
- 52075 rem restore old values
- 52080 pokesid+23,peek(sbuf+23)
- 52090 pokesid+24,peek(sbuf+24)
- 52100 pokesid+1,peek(sbuf+1)
- 52110 pokesid+5,peek(sbuf+5)
- 52120 pokesid+6,peek(sbuf+6)
- 52130 pokesid+4,peek(sbuf+4)
- 52140 return:rem ***** highlight current entry *****
- 52995 rem line 53000 clears old voice
- 52996 rem line 53010 highlights new
- 52997 rem line 53020 clears old entry
- 52998 rem line 53040 highlights new
- 52999 rem
- 53000 ct=0:cl=5*oel*-(ct<11):gosub53070
- 53005 rem cl=row offset
- 53010 cl=5*el*-(dv<11):gosub53060
- 53020 ct=odv:cl=5*oel*-(ct<11)
- 53030 gosub53070
- 53040 oel=el:odv=dv
- 53050 ct=odv:cl=5*oel*-(ct<11)
- 53060 print"";
- 53065 rem no change for these values
- 53066 rem gate, ring, etc
- 53070 ifct<0orct>14then53110
- 53080 ifct=3orct=11then53110
- 53090 gosub900:rem plot
- 53100 print wrd$(ct)
- 53110 print"[146]";:return:rem ***** program data *****
- 59998 rem cursor move routine
- 59999 rem
- 60000 data24,166,251,164,252,76,240,255
- 60096 rem
- 60097 rem
- 60098 rem interrupt routine
- 60099 rem
- 60100 data120,169,226,141,20,3,169
- 60110 data2,141,21,3,88,96,120,169
- 60120 data49,141,20,3,169,234,141
- 60130 data21,3,88,96,166,253,48,6
- 60140 data173,27,212,157,0,212,166
- 60150 data254,48,6,173,28,212,157
- 60160 data0,212,76,49,234
- 62992 rem
- 62993 rem
- 62994 rem screen display data
- 62995 rem
- 62996 rem word start x, word start y,
- 62997 rem value start x, value start y,
- 62998 rem word
- 62999 rem
- 63000 data3,4,3,4,voice
- 63010 data3,13,3,23,"f[154]requency:
- 63020 [131]4,13,4,23,"pcontls width:
- 63030 data5,14,5,24,"w[154]aveform:
- 63040 [131]3,30,3,37,"acontttack:
- 63050 data4,31,4,37,"d[154]ecay:
- 63060 [131]5,29,5,37,"scontustain:
- 63070 data6,29,6,37,"r[154]elease:
- 63080 [131]6,13,6,13,"gcontate
- 63090 data6,18,6,18,"ri[154]ng
- 63100 [131]6,23,6,23,"sycontnc
- 63110 data19,1,19,1,filter/out
- 63120 data19,13,19,23,"freq[154]uency:
- 63130 [131]20,13,20,23,"resoncontance:
- 63140 data19,30,19,37,"v[154]olume:
- 63150 [131]20,32,20,37,"mcontode:
- 63160 data21,27,21,27,"1[154]
- 63170 [131]21,29,2,29,"2cont
- 63180 data21,31,21,31,"3[154]
- 63190 [131]21,33,21,33,"excontt
- 63200 data22,13,22,18,"o[154]sc3
- 63210 [131]22,21,22,26,"econtnv3
- 63220 data22,29,22,29,"t[154]urnoff 3
- 63230 [143] *** end of program ***
-