YMX

From Sega Retro

YMX is a voice bank format which contains a collection of YM2612 voices, invented by saxman for use in his Sonic QX program. It has been since implemented, to different extents, in other music-related hacking programs, such as Sonic One Music Editor, xm3smps, and xm4smps.

It's name is a combination of letters from "YM2612" and "Sonic QX", the third letter being from the latter, and the first two letters being from the former.

Specifications

The official specifications for the YMX format have been released by saxman amongst the documentation included in Sonic QX. A verbatim extract from the original file follows.

Header

First 6 bytes - 59 4D 32 36 31 32 (YM2612)
Byte 7 - format <reserved -- leave it as 00>
Byte 8 - number of voices (+1) in the file;
			-- FF is for 0 voices
			-- 00 is for 1 voice
			-- 01 is for 2 voices
			-- 02 is for 3 voices, etc.

A YMX bank is allowed up to 128 voices. So anything above 7F is illegal. This
limit is used to seek future compatibility with MIDI messages and Yamaha DX/TX
conversions.

Voice

Directly after the first 8 bytes, the data for the first voice begins. There
are a total of 35 bytes used for each individual voice. They follow one after
another. Below are the YM2612 register equivallents to each byte in a voice.

1 - register 0B0
2 - register 030
3 - register 031
4 - register 032
5 - register 033
6 - register 050
7 - register 051
8 - register 052
9 - register 053
10 - register 060
11 - register 061
12 - register 062
13 - register 063
14 - register 070
15 - register 071
16 - register 072
17 - register 073
18 - register 080
19 - register 081
20 - register 082
21 - register 083
22 - register 040
23 - register 041
24 - register 042
25 - register 043
Bytes 26-35 - voice name in ASCII format

It should be noted that the voices are stored in the format used by Sonic 2, so some byte swaps are needed to use those voices in the other Sonic games that use SMPS.