Ym2413+instrumentsbin __exclusive__ ✮ «Deluxe»

The "story" of the (also known as the ) is one of calculated compromise that defined the sound of 1980s Japanese home computing and gaming. The Origin: A "Lightweight" Legend

Born in 1986, the YM2413 was Yamaha’s attempt to bring the complex world of Frequency Modulation (FM) synthesis to the masses by creating a "cost-reduced" version of the YM3812 (OPL2) . While professional FM synthesizers like the Yamaha DX7

were expensive and difficult to program, the YM2413 was designed to be cheap, tiny, and "plug-and-play". The Secret of the 15+1 Presets

To save on manufacturing costs, Yamaha removed the internal registers that allowed users to design their own sounds. Instead, they "burned" 15 fixed instrument profiles directly into the chip's ROM. The Hardware Limitation : Users could only create

custom instrument at a time. All other sounds had to be chosen from the 15 hard-coded presets. The Instrument List : These presets included 80s staples like Synth Bass Electric Guitar The Rhythm Mode

: The chip could either play 9 melodic channels or switch to a "Rhythm Mode" that provided 6 melodic channels and 5 fixed percussion sounds ( Bass Drum, Snare, Tom, Top Cymbal, and Hi-Hat The Chips That Powered an Era

Because it was so affordable, the YM2413 became the heartbeat of several iconic systems:

jech2/YM2413-MDB: 80s FM video game music dataset (ISMIR 2022) ym2413+instrumentsbin

The YM2413, also known as the OPLL (One-Period Linear Programming), is a audio chip developed by Yamaha Corporation. It was widely used in various applications, including video game consoles, computers, and arcade machines, particularly in the 1980s and early 1990s.

Why do we need it?

While the chip has 15 hardcoded sounds, many games and demos rely on the User Instrument Slot (Instrument #0) to create unique sounds. A file like instruments.bin stores the parameters for these custom sounds.

1. VGM Music Files

If you are analyzing VGM (Video Game Music) files from the Sega Master System, the custom instrument data is embedded inside the .vgm or .gz file itself. You don't need an external instruments.bin. The player writes the instrument definition to the chip every time the instrument changes.

The Data Structure (The "Patch")

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:

| 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 "story" of the (also known as the

Part 5: The "Holy Grail" – Where to Find the Correct Version

The search for ym2413+instruments.bin is often frustrating because there are dozens of corrupted or mislabeled versions floating around on file-hosting sites. If the hash (MD5/CRC) is wrong, your music will play back wrong.

The authoritative source: Look for the file bundled with Plom’s OPLL Bank or the MSX Software Database. A clean instruments.bin should have a file size of exactly 128 bytes (if it contains 16 full 8-byte instruments) or 8 bytes (for a single user instrument).

Warning signs:

3. Example: Generate your own instruments.bin

Here's a C code to write a custom YM2413 instrument into an 8‑byte binary file:

#include <stdio.h>

typedef struct unsigned char op1_AM_VIB_EGT_KSR_MULT; // $30 unsigned char op1_KSL_TL; // $31 unsigned char op1_AR_DR; // $32 unsigned char op1_SL_RR; // $33 unsigned char op2_AM_VIB_EGT_KSR_MULT; // $34 unsigned char op2_KSL_TL; // $35 unsigned char op2_AR_DR; // $36 unsigned char op2_SL_RR; // $37 OpllVoice;

int main() // Example: a "bright piano" patch (just as demo) OpllVoice voice = 0x01, // op1: MULT=1, no AM/VIB, EGT=0, KSR=0 0x22, // KSL=2, TL=34 (decimal) → 0x22 0x9C, // AR=15, DR=12 → 0x9C 0x17, // SL=2, RR=7 0x01, // op2 same MULT 0x00, // op2 KSL=0, TL=0 0xFC, // AR=15, DR=12 0x37 // SL=3, RR=7 ;

FILE *f = fopen("instruments.bin", "wb");
fwrite(&voice, 1, sizeof(voice), f);
fclose(f);
return 0;

Compile, run → get an 8‑byte instruments.bin.

But many tools expect 48‑byte (e.g., MSX PLAYER), so you can repeat or combine patches.


4. Extracting and Modifying Instruments

Tools like VGM Music Maker, OPLL Bank Editor, or Hex editors can read/write instruments.bin. A typical workflow:

  1. Dump a game’s YM2413 register writes during music playback.
  2. Extract the 8-byte patches sent to register $30 (for the user slot).
  3. Save as instruments.bin for reuse in other projects.

Part 3: The Anatomy of the Binary File

Why can't you just rename a .wav file to .bin? Because the YM2413 speaks a very strict hardware language.

A standard YM2413 instrument binary (for the user slot) is exactly 8 bytes. Each byte configures a specific FM parameter:

If a single bit is off in your instruments.bin, your "Trumpet" will sound like a clicking modem. If the file is 1KB or larger, it’s

The "Low Cost" Compromise

The YM2413 was labeled "Low Cost" for a reason. Unlike full FM chips that allowed programmers to tweak every parameter of a sound wave, the YM2413 was more rigid. It offered:

However, the magic of the YM2413 lay in its one "User Instrument" slot. This allowed programmers to define one custom instrument at a time, injecting a unique personality into the standard preset palette. This custom instrument definition is where the digital file format enters the picture.