123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- function lstinf$(a$,b$,c$)
- adra=1:adrb=1:blngt=len(b$):d$=""
- while adrb<=blngt
- if mid$ (a$,adra,1)=mid$ (b$,adrb,1) then:adrb+=1:end if
- adra=adra+1
- end while
- while mid$(a$,adra,1)<>left$(c$,1)
- d$=d$+mid$(a$,adra,1):adra=adra+1
- end while
- lstinf$=d$
- end function
- function vldc(a$)
- t0$="!"+a$+".0.0.0."
- t1$=lstinf$(t0$,"!",".")
- t2$=lstinf$(t0$,".",".")
- t3=10^(len(t2$))
- vldc=val(t1$)+(val(t2$)/t3)
- end function
- dim chfq[16],chvl[16]
- finp$="_.csv"
- if argc>2 then:finp$=argv(2):end if
- print"56676D20 FFFFFF00 510100000000000000000000B61B00001F6413000000"
- print"0000000000003C0000000000000000000000000000004C00000000000000"
- print"000000000000000060E3164060E3164060E3164000000000000000000000"
- print"000000000000000000000000000000000000000000000000000080841E40"
- print"00010100C8000000"
- print"A00000"
- print"A00100"
- print"A00200"
- print"A00300"
- print"A00400"
- print"A00500"
- print"A00800"
- print"A00900"
- print"A00A00"
- print"A007B8"
- print"A08000"
- print"A08100"
- print"A08200"
- print"A08300"
- print"A08400"
- print"A08500"
- print"A08800"
- print"A08900"
- print"A08A00"
- print"A087B8"
- print"A50000"
- print"A50100"
- print"A50200"
- print"A50300"
- print"A50400"
- print"A50500"
- print"A50800"
- print"A50900"
- print"A50A00"
- print"A507B8"
- print"550000"
- print"550100"
- print"550200"
- print"550300"
- print"550400"
- print"550500"
- print"550800"
- print"550900"
- print"550A00"
- print"5507B8"
- print"A60000"
- print"A60100"
- print"A60200"
- print"A60300"
- print"A60400"
- print"A60500"
- print"A60800"
- print"A60900"
- print"A60A00"
- print"A607B8"
- print"560000"
- print"560100"
- print"560200"
- print"560300"
- print"560400"
- print"560500"
- print"560800"
- print"560900"
- print"560A00"
- print"5607B8"
- print"A80000"
- print"A80100"
- print"A80200"
- print"A80300"
- print"A80400"
- print"A80500"
- print"A80800"
- print"A80900"
- print"A80A00"
- print"A807B8"
- print"580000"
- print"580100"
- print"580200"
- print"580300"
- print"580400"
- print"580500"
- print"580800"
- print"580900"
- print"580A00"
- print"5807B8"
- lct=0
- open finp$ for input as #1
- while eof(1)=0
- file input #1,txrd$
- setcaption("b:"+str$(lct)):lct+=1
- if mid$(txrd$,1,1)="[" then:
- if mid$(txrd$,2,1)="f" then:
- chid=val(mid$(txrd$,3,2))
- chid=chid mod 24 'ay38910x8 has 24 channels
- chfqv=vldc(lstinf$(txrd$,":","]"))
- chfqv2=int(26.6984611843*2^(8-chfqv))
- if chfqv2>2047 then:chfqv2=2047:end if
- if chfqv2<0 then:chfqv2=0:end if
- chchrfq$=right$("000"+hex$(chfqv2),3)
- if int(chid/3)=0 then
- txrgo$="A0"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" A0"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- if int(chid/3)=1 then
- txrgo$="A0"+right$("00"+hex$(129+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" A0"+right$("00"+hex$(128+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- if int(chid/3)=2 then
- txrgo$="A5"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" A5"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- if int(chid/3)=3 then
- txrgo$="55"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" 55"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- if int(chid/3)=4 then
- txrgo$="A6"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" A6"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- if int(chid/3)=5 then
- txrgo$="56"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" 56"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- if int(chid/3)=6 then
- txrgo$="A8"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" A8"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- if int(chid/3)=7 then
- txrgo$="58"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
- txrgo$+=" 58"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
- end if
- print ucase$(txrgo$)
- end if
- if mid$(txrd$,2,1)="v" then:
- chid=val(mid$(txrd$,3,2))
- chid=chid mod 24 'ay38910x8 has 24 channels
- chvlv=vldc(lstinf$(txrd$,":","]"))*0x10
- chchrvl$=right$("00"+hex$(chvlv),2)
- if int(chid/3)=0 then
- txrgo$="A0"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
- end if
- if int(chid/3)=1 then
- txrgo$="A0"+right$("00"+hex$(128+8+(chid mod 3)),2)+chchrvl$
- end if
- if int(chid/3)=2 then
- txrgo$="A5"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
- end if
- if int(chid/3)=3 then
- txrgo$="55"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
- end if
- if int(chid/3)=4 then
- txrgo$="A6"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
- end if
- if int(chid/3)=5 then
- txrgo$="56"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
- end if
- if int(chid/3)=6 then
- txrgo$="A8"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
- end if
- if int(chid/3)=7 then
- txrgo$="58"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
- end if
- print ucase$(txrgo$)
- end if
- if mid$(txrd$,2,3)="wvb" then:
- wvblv=vldc(lstinf$(txrd$,":","]"))
- wvblv2=wvblv*44100
- wvblv3a=wvblv2 mod 65536
- wvblv3b=int(wvblv2/65536)
- wvblv3as$=ucase$(right$("0000"+hex$(wvblv3a),4))
- for ii=1 to wvblv3b:print"61FFFF":next
- print "61"+mid$(wvblv3as$,3,2)+mid$(wvblv3as$,1,2)
- end if
- end if
- wend
- print:print "66":print
- close #1
|