VGI File Format
The .vgi file format is the instrument format used by VGM Music Maker programmed by Shiru. It supports both the Texas Instrument SN76489 and the Yamaha YM2612. The same format is used for both chips in VGM Music Maker.
Organization
Every .vgi file is composed of 43 bytes of info. The organization of these bytes are listed in the table below with abbreviated functions as an overview.
AL | FB | AMD/FMD |
MT | DT | TL | RS | AR | DR/AM | SR | RR | SL | EG |
MT | DT | TL | RS | AR | DR/AM | SR | RR | SL | EG |
MT | DT | TL | RS | AR | DR/AM | SR | RR | SL | EG |
MT | DT | TL | RS | AR | DR/AM | SR | RR | SL | EG |
A brief description of the functions of each byte, their offsets and the valid range are listed in the chart below.
Hex Offset | Function | Range |
0x00 | Algorithm | $00-$07 |
0x01 | Feedback | $00-$07 |
0x02 | AMD & FMD | $00-$07, $10-$17, $20-$27, $30-$37 |
0x03 | OP0 Multiplier | $00-$0F |
0x04 | OP0 Detune | $00-$06 |
0x05 | OP0 Total Level | $00-$7F |
0x06 | OP0 Rate Scaling | $00-$03 |
0x07 | OP0 Attack Rate | $00-$1F |
0x08 | OP0 Decay Rate & AM enable | $00-$1F, $80-$9F |
0x09 | OP0 Sustain Rate | $00-$1F |
0x0A | OP0 Release Rate | $00-$0F |
0x0B | OP0 Sustain Level | $00-$0F |
0x0C | OP0 SSG-EG | $00, $08-$0F |
0x0D | OP1 Multiplier | $00-$0F |
0x0E | OP1 Detune | $00-$06 |
0x0F | OP1 Total Level | $00-$3F |
0x10 | OP1 Rate Scaling | $00-$03 |
0x11 | OP1 Attack Rate | $00-$1F |
0x12 | OP1 Decay Rate & AM enable | $00-$1F, $80-$9F |
0x13 | OP1 Sustain Rate | $00-$1F |
0x14 | OP1 Release Rate | $00-$0F |
0x15 | OP1 Sustain Level | $00-$0F |
0x16 | OP1 SSG-EG | $00, $08-$0F |
0x17 | OP2 Multiplier | $00-$0F |
0x18 | OP2 Detune | $00-$06 |
0x19 | OP2 Total Level | $00-$3F |
0x1A | OP2 Rate Scaling | $00-$03 |
0x1B | OP2 Attack Rate | $00-$1F |
0x1C | OP2 Decay Rate & AM enable | $00-$1F, $80-$9F |
0x1D | OP2 Sustain Rate | $00-$1F |
0x1E | OP2 Release Rate | $00-$0F |
0x1F | OP2 Sustain Level | $00-$0F |
0x20 | OP2 SSG-EG | $00, $08-$0F |
0x21 | OP3 Multiplier | $00-$0F |
0x22 | OP3 Detune | $00-$06 |
0x23 | OP3 Total Level | $00-$3F |
0x24 | OP3 Rate Scaling | $00-$03 |
0x25 | OP3 Attack Rate | $00-$1F |
0x26 | OP3 Decay Rate & AM enable | $00-$1F, $80-$9F |
0x27 | OP3 Sustain Rate | $00-$1F |
0x28 | OP3 Release Rate | $00-$0F |
0x29 | OP3 Sustain Level | $00-$0F |
0x2A | OP3 SSG-EG | $00, $08-$0F |
Descriptions
Algorithm Values
Feedback values only affect Operator 0. In the descriptions below a "+" sign indicates that the operators involved are combined through additive synthesis and a ">" sign indicates that the operators involved are combined through FM synthesis where the operator(s) to the left are the modulator wave and the operator(s) to the right are the carrier waves.
- $00 = OP0 > OP2 > OP1 > OP3
- $01 = (OP0 + OP2) > OP1 > OP3
- $02 = (OP0 + (OP2 > OP1)) > OP3
- $03 = ((OP0 > OP2) + OP1) > OP3
- $04 = (OP0 > OP2) + (OP1 > OP3)
- $05 = (OP0 > OP1) + (OP0 > OP2) + (OP0 > OP3)
- $06 = (OP0 > OP2) + OP1 + OP3
- $07 = OP0 + OP1 + OP2 + OP3
Feedback Values
Number of times Operator 0 feeds back into itself
Amplitude Modulation Depth & Frequency Modulation Depth Values
In the VGM Music Maker program, AM depth is displayed as "AMS" and FM Depth is displayed as "FMS". Note that both of these modulations are controlled by an LFO and thus FMD values are closer to a vibrato than traditional FM synthesis.
AMD and FMD values are separated by the high nybble and low nybble where the first digit corresponds to AMD and the second digit corresponds to FMD. Range for AMD is 0 to 3 and range for FMD is 0 to 7.
This can also be explained when converted to binary as shown:
%00AA0FFF | \-- bit0-bit2 = Frequency Modulation Depth \----- bit4-bit5 = Amplutide Modulation Depth
- Examples:
- $00 = AMD 0 FMD 0
- $10 = AMD 1 FMD 0
- $20 = AMD 2 FMD 0
- $30 = AMD 3 FMD 0
- $01 = AMD 0 FMD 1
- $07 = AMD 0 FMD 7
- $17 = AMD 1 FMD 7
- $37 = AMD 3 FMD 7
Multiplier Values
These Multiplier values are the same for all Yamaha FM chips
- $00 = 1/2x or the octave below
- $01 = 1x or at pitch
- $02 = 2x or an octave above
- $03 = 3x or an octave and a perfect fifth above
- $04 = 4x or two octaves above
- $05 = 5x or two octaves and a major third above
- $06 = 6x or two octaves and a fifth above
- $07 = 7x or two octaves and a minor seventh above
- $08 = 8x or three octaves above
- $09 = 9x or three octaves and a major second above
- $0A = 10x or three octaves and a major third above
- $0B = 10x or three octaves and a major third above
- $0C = 12x or three octaves and a perfect fifth above
- $0D = 12x or three octaves and a perfect fifth above
- $0E = 15x or three octaves and a major seventh above
- $0F = 15x or three octaves and a major seventh above
Detune values
Exact meaning for detune values and how they affect tuning are not clearly outlined in any literature regarding the YM2612 and may need further research to identify.
- $00 = -3
- $01 = -2
- $02 = -1
- $03 = no detune
- $04 = +1
- $05 = +2
- $06 = +3
Decay Rate & AM Enable Values
In the .vgi format this byte shares info for the Decay Rate and whether or not the instrument uses the LFO affecting AMD & FMD. The LFO speed is not definable.
This byte is best explained when converted to binary as shown:
%A00DDDDD | \---- bit0-bit4 = Decay rate \------- bit7 = enable AM
- Examples:
- $00 = Decay Rate $00 and AM off
- $10 = Decay Rate $10 and AM off
- $1F = Decay Rate $1F and AM off
- $80 = Decay Rate $00 and AM on
- $90 = Decay Rate $10 and AM on
- $9F = Decay Rate $1F and AM on
SSG-EG Values
When enabled, the Software Sound Generator-Envelope Generator will change the order in which the Attack, Decay, Sustain and Release sections of the envelope will be stepped through. In the description below "OFF" means the envelope will cycle once and then will be silenced and "ON" means the envelope will cycle once and then play at the volume indicated in the operator's TL value.
- $00 = Do not use SSG-EG
- $08 = ADSR ADSR ADSR
- $09 = ADSR OFF
- $0A = ADSR RSDA ADSR
- $0B = ADSR ON
- $0C = RSDA RSDA RSDA
- $0D = RSDA ON
- $0E = RSDA ADSR RSDA
- $0F = RSDA OFF