123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677 |
- #! /usr/bin/sdlbrt
- finp$="tune.vgm"
- '- .vgm to FamiTracker .txt converter - AY-3-8910(x1) + SN76489 (x2) version
- '- copyleft Paulo Silva, oct'20
- '-------------------------------
- '- bugs:
- '- - an acute sound might appear because an issue related to volume 0 that VortexTracker doesnt support, R-- note used instead (and the converter should store which note/frequency is for a probable volume changing, and set back the note/frequency value back)
- '- - doesn't read yet the author/title information
- '- - 'L' will be useful for the loop point location
- '- - probably will need a sample counter before converting
- '- - missing noise support
- '- - frequncy inaccuracy from the germanic notation formula probably fixed, needs more testing
- '-------------------------------
- ltxtm$="ROW .. : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ... : ... .. . ...":ltxcr$=ltxtm$
- freq0=0:freq1=0:freq2=0:vol0=0:vol1=0:vol2=0
- patsz=48:patc=0:patid=0:freqq=0
- hdram=0x40:vgmv=0:veof=0
- dim hdrv[256]
-
- if argc>2 then:finp$=argv(2):end if
- fout2$=finp$+"_famitracker.txt":fout3$=finp$+"_famitracker_debug.txt"
-
- frmc=0:frmr=300:trg=0
-
- frmi=735
- if argc>3 then:
- if argv(3)="1" or ucase$(argv(2))="-PAL" then
- frmi=882:end if:end if
-
- debug=0
- if argc>4 then:
- if argv(4)="1" or ucase$(argv(2))="-DEBUG" then
- debug=1:end if:end if
-
- '- fix: 0x0FE=440hz=A-4
- function nttfrq$(freqb)
- e$= "C-1C#1D-1D#1E-1F-1F#1G-1G#1A-1A#1B-1"
- e$=e$+"C-2C#2D-2D#2E-2F-2F#2G-2G#2A-2A#2B-2"
- e$=e$+"C-3C#3D-3D#3E-3F-3F#3G-3G#3A-3A#3B-3"
- e$=e$+"C-4C#4D-4D#4E-4F-4F#4G-4G#4A-4A#4B-4"
- e$=e$+"C-5C#5D-5D#5E-5F-5F#5G-5G#5A-5A#5B-5"
- e$=e$+"C-6C#6D-6D#6E-6F-6F#6G-6G#6A-6A#6B-6"
- e$=e$+"C-7C#7D-7D#7E-7F-7F#7G-7G#7A-7A#7B-7"
- e$=e$+"C-8C#8D-8D#8E-8F-8F#8G-8G#8A-8A#8B-8..."
- tmq=141-(int((log(freqb*.99)/log(2))*12))
- if tmq<1 then:tmq=1:end if
- if tmq>84 then:tmq=84:end if
- return mid$(e$,(tmq*3)-2,3)
- end function
-
- open finp$ for input as #1
- for i=0 to 255
- hdrv[i]=readbyte(1)
- next
- close #1
-
- hdram=0x040
- vgmv=hdrv[8]+hdrv[9]*256
- if vgmv>=0x0150 then:hdram=0x080:end if
- if vgmv>=0x0170 then:hdram=0x100:end if
- '- wrong information???
- ttsam=hdrv[0x18]+hdrv[0x19]*256+hdrv[0x1A]*65536+hdrv[0x1B]*16777216
- hsam$="PlayOrder=L0"
- for i=1 to (ttsam/(frmi*patsz))-1
- hsam$=hsam$+","+str$(i)
- next
-
- open finp$ for input as #1
- open fout2$ for output as #2
- open fout3$ for output as #3
- print #2,"# FamiTracker text format":print #2,""
- print #2,"# Module information"
- print #2,"TITLE \"\""
- print #2,"AUTHOR \"\""
- print #2,"COPYRIGHT \"\"":print #2,""
- print #2,"# Module comment"
- print #2,"COMMENT \"\"":print #2,""
- print #2,"# Global settings"
- print #2,"MACHINE 0"
- print #2,"FRAMERATE 0"
- print #2,"EXPANSION 16"
- print #2,"VIBRATO 1"
- print #2,"SPLIT 32":print #2,""
- print #2,"# Namco 163 global settings"
- print #2,"N163CHANNELS 6":print #2,""
- print #2,"# Macros":print #2,""
- print #2,"# DPCM samples":print #2,""
- print #2,"# Detune settings":print #2,""
- print #2,"# Grooves":print #2,""
- print #2,"# Tracks using default groove"
- print #2,"# Instruments"
- print #2,"INST2A03 0 -1 -1 -1 -1 -1 \"instrument01\""
- print #2,"INSTN163 1 -1 -1 -1 -1 -1 32 0 1 \"instrument02\""
- print #2,"N163WAVE 1 0 : 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0":print #2,""
- print #2,"# Tracks":print #2,""
- print #2,"TRACK "+str$(patsz)+" 1 128 \"test\""
- print #2,"COLUMNS : 1 1 1 1 1 1 1 1 1 1 1 1 1":print #2,""
- print #2,"Pattern 00"
-
- '- the amount of header bytes depends on vgm format version
- for eee=0 to hdram-1:q0=readbyte(1):next '- read offset byte first
- txou1$=" #("+str$(0)+")"
-
- while veof=0:
- q0=readbyte(1)
-
- '- vgm eof command
- if q0=0x66 then:
- veof=1
- print #3,"--vgm-eof--"
- print #2,""
- print #2,"# End of export"
- end if
-
- '- delay 1 byte (1..16 samples)
- if bitwiseand(q0,0x70)=0x70 then
- frmc=frmc+bitwiseand(q0,0xF)+1
- txou1$=" #("+str$(frmc)+")"
- 'print #3,txou1$
- end if
-
- '- delay 3 bytes (0..65535 samples)
- if q0=0x61 then
- q0=readbyte(1)
- frmc=frmc+q0
- q0=readbyte(1)
- frmc=frmc+(q0*256)
- txou1$=" #("+str$(frmc)+")"
- 'print #3,txou1$
- end if
-
- '- 1 ntsc frame delay, 735 samples
- if q0=0x62 then
- frmc=frmc+735
- txou1$=" #("+str$(frmc)+")"
- 'print #3,txou1$
- end if
-
- '- 1 pal frame delay, 882 samples
- if q0=0x63 then
- frmc=frmc+882
- txou1$=" #("+str$(frmc)+")"
- 'print #3,txou1$
- end if
- '- updates frameout pulses
- while frmr<frmc
- '- writes 1F in the first line of the first pattern
- 'if (patc<1 and patid=0) then
- 'ltxcr$=replace$(12,ltxcr$,"1F")
- 'ltxcr$=replace$(26,ltxcr$,"1F")
- 'ltxcr$=replace$(40,ltxcr$,"1F")
- 'end if
-
- '- creates a new pattern
- if patc>(patsz-1) then:
- print #2," "
- patid=patid+1:patc=0
- 'txou9$="Pattern "+str$(patid)+"]"
- txou9$="Pattern "+right$("00000"+ucase$(hex$(patid)),2)
- print #2,txou9$
- end if
-
- '- writes a pattern line in each frame
- if trg=0 then
- print #3,"--frameout-unchanged--"
- 'print #2,ltxtm$
- ltxcr$=ltxtm$
- ltxcr$=replace$(4,ltxcr$, right$("00000"+ucase$(hex$(patc)),2) ) '?????? <-----
- print #2,ltxcr$
- else
- print #3,"--frameout--"
- ltxcr$=replace$(4,ltxcr$, right$("00000"+ucase$(hex$(patc)),2) ) '?????? <-----
- print #2,ltxcr$
- ltxcr$=ltxtm$
- trg=0
- end if
-
- frmr=frmr+frmi
- patc=patc+1
- end while
- '- token 0xA0 gets registers and values to AY-3-8910 output
- if q0=0xA0 then
- q0=readbyte(1)
-
- '- channel 0, fine
- if q0=0x00 then
- q0=readbyte(1)
- freq0a= bitwiseor((bitwiseand(freq0,0xF00)),(bitwiseand(q0,0x0FF)))
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(9,ltxtm1$,nttfrq$(freq0a))
- ltxcr$=replace$(9,ltxcr$,nttfrq$(freq0a))
- ltxcr$=replace$(13,ltxcr$,"00")
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 0, coarse
- if q0=0x01 then
- q0=readbyte(1)
- freq0a= bitwiseor ( (bitwiseand(q0*256,0xF00)),(bitwiseand(freq0,0x0FF)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(9,ltxtm1$,nttfrq$(freq0a))
- ltxcr$=replace$(9,ltxcr$,nttfrq$(freq0a))
- ltxcr$=replace$(13,ltxcr$,"00")
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 1, fine
- if q0=0x02 then
- q0=readbyte(1)
- freq1a= bitwiseor ( (bitwiseand(freq1,0xF00)),(bitwiseand(q0,0x0FF)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(24,ltxtm1$,nttfrq$(freq1a))
- ltxcr$=replace$(24,ltxcr$,nttfrq$(freq1a))
- ltxcr$=replace$(28,ltxcr$,"00")
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 1, coarse
- if q0=0x03 then
- q0=readbyte(1)
- freq1a= bitwiseor ( (bitwiseand(q0*256,0xF00)),(bitwiseand(freq1,0x0FF)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(24,ltxtm1$,nttfrq$(freq1a))
- ltxcr$=replace$(24,ltxcr$,nttfrq$(freq1a))
- ltxcr$=replace$(28,ltxcr$,"00")
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 2, fine
- if q0=0x04 then
- q0=readbyte(1)
- freq2a= bitwiseor ( (bitwiseand(freq2,0xF00)),(bitwiseand(q0,0x0FF)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(39,ltxtm1$,nttfrq$(freq2a))
- ltxcr$=replace$(39,ltxcr$,nttfrq$(freq2a))
- ltxcr$=replace$(43,ltxcr$,"00")
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 2, coarse
- if q0=0x05 then
- q0=readbyte(1)
- freq2a= bitwiseor ( (bitwiseand(q0*256,0xF00)),(bitwiseand(freq2,0x0FF)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(39,ltxtm1$,nttfrq$(freq2a))
- ltxcr$=replace$(39,ltxcr$,nttfrq$(freq2a))
- ltxcr$=replace$(43,ltxcr$,"00")
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 1, volume
- if q0=0x08 then
- q0=readbyte(1)
- vol0a= bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(16,ltxtm1$,ucase$(right$(hex$(0x10+vol0a),1)))
- ltxcr$=replace$(16,ltxcr$,ucase$(right$(hex$(0x10+vol0a),1)))
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 2, volume
- if q0=0x09 then
- q0=readbyte(1)
- vol1a= bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(31,ltxtm1$,ucase$(right$(hex$(0x10+vol1a),1)))
- ltxcr$=replace$(31,ltxcr$,ucase$(right$(hex$(0x10+vol1a),1)))
- print #3,ltxtm2$
- trg=1
- end if
-
- '- channel 3, volume
- if q0=0x0A then
- q0=readbyte(1)
- vol2a= bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(46,ltxtm1$,ucase$(right$(hex$(0x10+vol2a),1)))
- ltxcr$=replace$(46,ltxcr$,ucase$(right$(hex$(0x10+vol2a),1)))
- print #3,ltxtm2$
- trg=1
- end if
- '?????
- if q0=6 then
- print #3,ltxtm$
- end if
- '?????
- 'if q0=7 then
- ' q0=readbyte(1)
- ' ltxtm1$=ltxtm$
- ' ltxtm2$=left$(ltxtm1$,31)+ right$(bin$(512+q0),8) +right$(ltxtm1$,2)+txou1$
- ' print #3,ltxtm2$
- ' trg=1
- ' end if
-
- end if
- '- token 0x50 gets registers and values to SN76489 output
- if q0=0x50 then
- q0=readbyte(1)
-
- if bitwiseand (q0,128)=0 then
-
- '- channel 0 - coarse
- if freqq=0 then
- freq0b= bitwiseor ( (bitwiseand(q0,0x3F))*16,(bitwiseand(freq0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(9+75,ltxtm1$,nttfrq$(freq0b))
- ltxcr$=replace$(9+75,ltxcr$,nttfrq$(freq0b))
- ltxcr$=replace$(13+75,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 1 - coarse
- if freqq=1 then
- freq1b= bitwiseor ( (bitwiseand(q0,0x3F))*16,(bitwiseand(freq1,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(24+75,ltxtm1$,nttfrq$(freq1b))
- ltxcr$=replace$(24+75,ltxcr$,nttfrq$(freq1b))
- ltxcr$=replace$(13+15+75,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 2 - coarse
- if freqq=2 then
- freq2b= bitwiseor ( (bitwiseand(q0,0x3F))*16,(bitwiseand(freq2,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(39+75,ltxtm1$,nttfrq$(freq2b))
- ltxcr$=replace$(39+75,ltxcr$,nttfrq$(freq2b))
- ltxcr$=replace$(13+30+75,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- end if
-
- if bitwiseand (q0,128)=128 then
-
- '- channel 0 - fine
- if bitwiseand (q0,0xF0)=0x80 then '- tone ch0
- freqq=0
- freq0b= bitwiseor ( (bitwiseand(freq0,0xFF0)),(bitwiseand(q0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(9+75,ltxtm1$,nttfrq$(freq0b))
- ltxcr$=replace$(9+75,ltxcr$,nttfrq$(freq0b))
- ltxcr$=replace$(13+75,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 1 - fine
- if bitwiseand (q0,0xF0)=0xA0 then '- tone ch1
- freqq=1
- freq1b= bitwiseor ( (bitwiseand(freq1,0xFF0)),(bitwiseand(q0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(24+75,ltxtm1$,nttfrq$(freq1b))
- ltxcr$=replace$(24+75,ltxcr$,nttfrq$(freq1b))
- ltxcr$=replace$(13+15+75,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 2 - fine
- if bitwiseand (q0,0xF0)=0xC0 then '- tone ch2
- freqq=2
- freq2b= bitwiseor ( (bitwiseand(freq2,0xFF0)),(bitwiseand(q0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(39+75,ltxtm1$,nttfrq$(freq2b))
- ltxcr$=replace$(39+75,ltxcr$,nttfrq$(freq2b))
- ltxcr$=replace$(13+30+75,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- 'if bitwiseand (q0,0xF0)=0xE0 then '- freq noise
- ' end if
-
- '- channel 0 - volume
- if bitwiseand (q0,0xF0)=0x90 then '- volume ch0
- 'freqq=0
- vol0b=15-bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(16+75,ltxtm1$,ucase$(right$(hex$(0x10+vol0b),1)))
- ltxcr$=replace$(16+75,ltxcr$,ucase$(right$(hex$(0x10+vol0b),1)))
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 1 - volume
- if bitwiseand (q0,0xF0)=0xB0 then '- volume ch1
- 'freqq=1
- vol1b=15-bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(31+75,ltxtm1$,ucase$(right$(hex$(0x10+vol1b),1)))
- ltxcr$=replace$(31+75,ltxcr$,ucase$(right$(hex$(0x10+vol1b),1)))
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 2 - volume
- if bitwiseand (q0,0xF0)=0xD0 then '- volume ch2
- 'freqq=2
- vol2b=15-bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(46+75,ltxtm1$,ucase$(right$(hex$(0x10+vol2b),1)))
- ltxcr$=replace$(46+75,ltxcr$,ucase$(right$(hex$(0x10+vol2b),1)))
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- 'if bitwiseand (q0,0xF0)=0xF0 then '- volume ch3
- ' end if
-
- end if
- end if
- '- token 0x30 gets registers and values to SN76489 (second chip) output
- if q0=0x30 then
- q0=readbyte(1)
-
- if bitwiseand (q0,128)=0 then
-
- '- channel 0 - coarse
- if freqq=0 then
- freq0c= bitwiseor ( (bitwiseand(q0,0x3F))*16,(bitwiseand(freq0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(9+75+45,ltxtm1$,nttfrq$(freq0c))
- ltxcr$=replace$(9+75+45,ltxcr$,nttfrq$(freq0c))
- ltxcr$=replace$(13+75+45,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 1 - coarse
- if freqq=1 then
- freq1c= bitwiseor ( (bitwiseand(q0,0x3F))*16,(bitwiseand(freq1,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(24+75+45,ltxtm1$,nttfrq$(freq1c))
- ltxcr$=replace$(24+75+45,ltxcr$,nttfrq$(freq1c))
- ltxcr$=replace$(13+75+15+45,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 2 - coarse
- if freqq=2 then
- freq2c= bitwiseor ( (bitwiseand(q0,0x3F))*16,(bitwiseand(freq2,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(39+75+45,ltxtm1$,nttfrq$(freq2c))
- ltxcr$=replace$(39+75+45,ltxcr$,nttfrq$(freq2c))
- ltxcr$=replace$(13+75+30+45,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- end if
-
- if bitwiseand (q0,128)=128 then
-
- '- channel 0 - fine
- if bitwiseand (q0,0xF0)=0x80 then '- tone ch0
- freqq=0
- freq0c= bitwiseor ( (bitwiseand(freq0,0xFF0)),(bitwiseand(q0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(9+75+45,ltxtm1$,nttfrq$(freq0c))
- ltxcr$=replace$(9+75+45,ltxcr$,nttfrq$(freq0c))
- ltxcr$=replace$(13+75+45,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 1 - fine
- if bitwiseand (q0,0xF0)=0xA0 then '- tone ch1
- freqq=1
- freq1c= bitwiseor ( (bitwiseand(freq1,0xFF0)),(bitwiseand(q0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(24+75+45,ltxtm1$,nttfrq$(freq1c))
- ltxcr$=replace$(24+75+45,ltxcr$,nttfrq$(freq1c))
- ltxcr$=replace$(13+75+15+45,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 2 - fine
- if bitwiseand (q0,0xF0)=0xC0 then '- tone ch2
- freqq=2
- freq2c= bitwiseor ( (bitwiseand(freq2,0xFF0)),(bitwiseand(q0,0x00F)) )
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(39+75+45,ltxtm1$,nttfrq$(freq2c))
- ltxcr$=replace$(39+75+45,ltxcr$,nttfrq$(freq2c))
- ltxcr$=replace$(13+75+30+45,ltxcr$,"01")
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- 'if bitwiseand (q0,0xF0)=0xE0 then '- freq noise
- ' end if
-
- '- channel 0 - volume
- if bitwiseand (q0,0xF0)=0x90 then '- volume ch0
- 'freqq=0
- vol0c=15-bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(16+75+45,ltxtm1$,ucase$(right$(hex$(0x10+vol0c),1)))
- ltxcr$=replace$(16+75+45,ltxcr$,ucase$(right$(hex$(0x10+vol0c),1)))
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 1 - volume
- if bitwiseand (q0,0xF0)=0xB0 then '- volume ch1
- 'freqq=1
- vol1c=15-bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(31+75+45,ltxtm1$,ucase$(right$(hex$(0x10+vol1c),1)))
- ltxcr$=replace$(31+75+45,ltxcr$,ucase$(right$(hex$(0x10+vol1c),1)))
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- '- channel 2 - volume
- if bitwiseand (q0,0xF0)=0xD0 then '- volume ch2
- 'freqq=2
- vol2c=15-bitwiseand(q0,0xF)
- ltxtm1$=ltxtm$
- ltxtm2$=replace$(46+75+45,ltxtm1$,ucase$(right$(hex$(0x10+vol2c),1)))
- ltxcr$=replace$(46+75+45,ltxcr$,ucase$(right$(hex$(0x10+vol2c),1)))
- print #3,ltxtm2$+" #("+str$(frmc)+")"
- trg=1
- end if
-
- 'if bitwiseand (q0,0xF0)=0xF0 then '- volume ch3
- ' end if
-
- end if
- end if
- if eof(1)<>0 then
- veof=1
- print #2,""
- print #2,"# End of export"
- end if
- wend
- for eeq=0 to patid
- txou$="ORDER "+right$(hex$(0x100+eeq),2)+" :"
- for eer=0 to 12
- txou$=txou$+" "+right$(hex$(0x100+eeq),2)
- next
- print #2,txou$
- next
- print #2,""
- 'print #2,"ORDER 00 : 00 00 00 00 00 00 00 00 00 00 00 00 00"
- 'print #2,"ORDER 01 : 01 01 01 01 01 01 01 01 01 01 01 01 01"
- 'print #2,"ORDER 02 : 02 02 02 02 02 02 02 02 02 02 02 02 02"
- 'print #2,"ORDER 03 : 03 03 03 03 03 03 03 03 03 03 03 03 03"
- 'print #2,"ORDER 04 : 04 04 04 04 04 04 04 04 04 04 04 04 04"
- 'print #2,"ORDER 05 : 05 05 05 05 05 05 05 05 05 05 05 05 05"
- 'print #2,"ORDER 06 : 06 06 06 06 06 06 06 06 06 06 06 06 06"
- 'print #2,"ORDER 07 : 07 07 07 07 07 07 07 07 07 07 07 07 07"
- 'print #2,"ORDER 08 : 08 08 08 08 08 08 08 08 08 08 08 08 08"
- 'print #2,"ORDER 09 : 09 09 09 09 09 09 09 09 09 09 09 09 09"
- 'print #2,"ORDER 0A : 0A 0A 0A 0A 0A 0A 0A 0A 0A 0A 0A 0A 0A"
- 'print #2,"ORDER 0B : 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B"
- 'print #2,"ORDER 0C : 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C"
- 'print #2,"ORDER 0D : 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D"
- 'print #2,"ORDER 0E : 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E"
- 'print #2,"ORDER 0F : 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F"
- 'print #2,""
- close #1:close #2:close #3
-
- if debug=0 then:
- shell("rm "+fout3$)
- end if
- 'print #2,"[Module]"
- 'print #2,"VortexTrackerII=1"
- 'print #2,"Version=3.6"
- 'print #2,"Title="
- 'print #2,"Author="
- 'print #2,"NoteTable=2"
- 'print #2,"Speed=1"
- 'print #2,hsam$
- 'print #2," "
- 'print #2,"[Ornament1]":print #2,"L0":print #2," "
- 'print #2,"[Sample1]":print #2,"Tne +000_ +00_ F_ L":print #2," "
|