Hi, This is going to be a long post regarding the tfi format conversion and the detune parameter DT..
There is an error in the tfi format conversion that should be corrected..
If you implement a software with a tfi import function,you cannot simply read the tfi DT bytes because it is a conversion from the original YM2612 DT register.
First YM2612 Register DT ranges from:
DATA 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7
----------------------------------------------------
PITCH 0 -1 -2 -3 0 1 2 3
small decrease on the pitch (from 1 to 3)where 3 is max.
small increase on the pitch (from 5 to 7)where 7 is max.
So the maximum detune between two operator is:
3 from max decrease and 7 for max increase.
In the tfi 42 bytes long format, DT parameter was converted
following a table and adding +3 to the register value.
Like so:
DETUNE TABLE(8)
0 1 2 3 0 -1 -2 -3
Conversion happens like so:
--------------------------------------------------
-Converters read the DT register
-DT register is converted to the table value
-Add +3
Result will always give values ranges from 0 to 6.
So DT register will be written in .tfi format like so:
DT REGISTER 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7
-------------------------------------------------------------
DT TFI FORMAT 3 4 5 6 3 2 1 0
The tfi DT byte is read like so in softwares:
DT TFI FORMAT 0 - 1 - 2 - 3 - 4 - 5 - 6
------------------------------------------------------------------------------------------
DT VGMM,TFMM,DEFLMASK etc -3 -2 -1 0 1 2 3
If you followed so far you can see that the parameters are inverted were 3 is -3 and so on.
More, If you extract a tfi patch with the very useful GenKmod the DT bytes will be saved with the original register value witch is plain correct but will produce incorrect values in every trackers that followed the tfi DT table...
So for compatibility with my FMDRIVE 2612 Vsti and LittleScale Genmdm Midi Interface I have rewritten a vgm2tfi 2.0 converter that output direct DT register values (0 to 7) with no changes.
and a classic one for compatibility sake with a reverted Dt table.
AJ.