A standard YM2413 instrument is defined by a set of specific parameters stored in these binary files:
The instruments.bin file is essentially a lookup table. When a song file (like .MUS or .VGM) calls for "Instrument 17" (the custom slot), the player software reads the corresponding bytes from instruments.bin and writes them to the YM2413’s registers.
Usually, one instrument definition takes up 8 bytes (or sometimes packed into fewer bytes depending on the specific tracker format, like MoonBlaster).
A standard unpacked instrument block usually looks like this: ym2413+instrumentsbin
| Byte Offset | Parameter Name | Description | | :--- | :--- | :--- | | 0 | AM (Amplitude Modulation) | Vibrato/Tremolo settings | | 1 | PM (Phase Modulation) | Vibrato/Tremolo settings | | 2 | EG (Envelope Generator) | Sustain level / Key scaling | | 3 | KSR (Key Scale Rate) | Envelope scaling based on pitch | | 4 | MULT (Multiplier) | Frequency multiplier | | 5 | TL (Total Level) | Volume/Output level (Carrier) | | 6 | AR (Attack Rate) | How fast sound starts | | 7 | DR (Decay Rate) | How fast sound drops to sustain | | 8 | SL (Sustain Level) | The level the sound holds at | | 9 | RR (Release Rate) | How fast sound fades after key-off |
(Note: The YM2413 actually expects this data to be packed into specific register bits. The binary file usually stores the raw values which are then bit-shifted before being sent to the chip.)
The YM2413 is a low-cost FM (Frequency Modulation) synthesis sound chip, famous for its use in the MSX computer standard (as an upgrade or built-in) and the Sega Master System (Mark III). A standard YM2413 instrument is defined by a
If you are a developer writing an emulator, loading the binary is a direct memory dump.
FILE *fp = fopen("ym2413_instruments.bin", "rb");
uint8_t instrument_data[8];
fread(instrument_data, 1, 8, fp);
// Write 'instrument_data' to YM2413 register 0x30 (User Instrument slot)
The file is typically exactly 8 bytes per instrument, arranged sequentially.
Each 8-byte patch corresponds to one YM2413 user instrument (slot 16 in most implementations). The instruments
If you are looking for the actual data to put into your instruments.bin:
Hardcore preservationists use logic analyzers on real MSX cartridges or Sega Master System PCBs to dump the register writes during game initialization. Tools like OPLLExtract can convert these logs into a .bin file.
Why rely on old ROMs? You can create your own instruments.bin using modern tools.
This allows you to turn the YM2413 from a "preset jukebox" into a truly flexible synthesizer. You can simulate:
|
|
||||||||||||||
|
|
|
|
For earlier versions (pre 4.70) of Command products, click here. To check current versions of commercial products, click here. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||