TFI and VGI formats

Type: FM instrument

TFI and VGI are the FM instrument formats for TFM Maker and VGI Maker, respectively. The two are very similar and while rarely used directly by sound drivers, they're easier to parse for instrument editors (as every argument is in its own byte).

Since they're so close, we're documenting both here.

TFI (TFM Maker format)

TFM Maker instruments have the ".tfi" file extension and consist of 42 bytes. The first two bytes are:

TFI format initial bytes
1 byteAlgorithm0 to 7
1 byteFeedback0 to 7

The following 40 bytes are for the operators, with each group of 10 bytes being an operator. Operators come in S1, S3, S2, S4 order. These bytes are as follows (repeat for each operator):

Data for each operator
1 byteMultiplier0 to 15
1 byteDetune0 to 6
1 byteTotal level0 to 127
1 byteRate scaling0 to 3
1 byteAttack rate0 to 31
1 byteDecay rate0 to 31
1 byteSustain rate0 to 31
1 byteRelease rate0 to 15
1 byteSustain level0 to 15
1 byteSSG-EG0 to 15

All values use the same format as the corresponding YM2612 registers, except for detune. In order to get the detune, substract 3 (to put it in the -3 to +3 range), then convert that to the format the YM2612 wants.

VGI (VGM Maker format)

VGM Maker instruments have the ".vgi" file extension and consist of 43 bytes. It's almost identical to TFI files, except that an extra byte follows feedback, which includes FMS and AMS (in the same format as register $B4+ from the YM2612).