Difference between revisions of "YMX"

From Sega Retro

m (7 revisions: because of a red link)
(Updated YMX format)
Line 4: Line 4:
  
 
===Specifications===
 
===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.
+
The official specifications for the YMX format have been released by [[saxman]].
====Header====
+
<pre>===================================
<pre>First 6 bytes - 59 4D 32 36 31 32 (YM2612)
+
YMX revision 1 format specification
Byte 7 - format <reserved -- leave it as 00>
+
Created by Damian Grove
Byte 8 - number of voices (+1) in the file;
+
08/03/2011
-- 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.</pre>
 
====Voice====
 
<pre>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
+
The original YMX format is sufficient for most uses, but I wanted to update
2 - register 030
+
the format to make it a little more versatile and add support for the GEMS FM
3 - register 031
+
voice format so the YMX format could be extended to non-SMPS games. The new
4 - register 032
+
group feature will allow you to categorize your voices, so if you have voices
5 - register 033
+
from multiple levels or games, or if you want to group together all the types
6 - register 050
+
of instruments (e.g. woodwind, brass, etc.), you can do that. You can also
7 - register 051
+
have up to 65535 voices now, a vast improvement over the 128 limit from the
8 - register 052
+
original specification.
9 - register 053
+
 
10 - register 060
+
All word and dword values described in this specification are little-endian.
11 - register 061
+
Any implementation of this revision should also support the original format.
12 - register 062
+
SMPS voices are in the Sonic 2 format and are 25 bytes in length. GEMS PSG
13 - register 063
+
voices are not supported. Only the FM-based GEMS voices are supported, and
14 - register 070
+
they are 39 bytes in length. All strings are in ASCII format. Voice and group
15 - register 071
+
names should use 0x20 for empty characters. Strings do not use any special
16 - register 072
+
terminating characters.
17 - register 073
+
 
18 - register 080
+
 
19 - register 081
+
 
20 - register 082
+
Below is the structure of a YMX revision 1 file:
21 - register 083
+
 
22 - register 040
+
 
23 - register 041
+
HEADER:
24 - register 042
+
    string[6]      "YM2612"
25 - register 043
+
    byte            revision (0x01)
Bytes 26-35 - voice name in ASCII format</pre>It should be noted that the voices are stored in the format used by ''[[Sonic 2]]'', so some [[:Image:VoiceOperators.png|byte swaps]] are needed to use those voices in the other Sonic games that use [[SMPS]].[[Category:Data Formats]][[Category:Music]]
+
    word            number of voices (up to 65535 voices)
 +
    byte            number of groups (up to 255 groups)
 +
    dword          pointer to voice pointers
 +
    dword          pointer to group list
 +
    bits[8]        (76543210)
 +
                    0 -- Voice format (0=SMPS[S2], 1=GEMS)
 +
                    1-7 -- RESERVED
 +
    byte            length of description
 +
    string[0-255]  bank description
 +
 
 +
 
 +
FOR EACH VOICE:
 +
    dword          pointer to voice
 +
 
 +
 
 +
FOR EACH VOICE:
 +
    byte            group (0=none)
 +
    byte[25-39]    voice data
 +
    string[10]      voice name
 +
    byte            length of description
 +
    string[0-255]  voice description
 +
 
 +
 
 +
FOR EACH GROUP:
 +
    string[10]      group name
 +
 
 +
 
 +
 
 +
Below is the original YMX format:
 +
 
 +
 
 +
HEADER:
 +
    string[6]      "YM2612"
 +
    byte            revision (0x00)
 +
    byte            number of voices (0=0xFF, 1=0x00, 2=0x01; up to 128=0x7F)
 +
 
 +
FOR EACH VOICE:
 +
    byte[25]        voice data (SMPS Sonic 2 format)
 +
    string[10]      voice name
 +
</pre>It should be noted that the voices are stored in the format used by ''[[Sonic 2]]'', so some [[:Image:VoiceOperators.png|byte swaps]] are needed to use those voices in the other Sonic games that use [[SMPS]].[[Category:Data Formats]][[Category:Music]]

Revision as of 23:47, 2 August 2011

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 since been implemented in other music-related hacking programs, such as Sonic One Music Editor, xm3smps, and xm4smps. Support for it is also being considered for the ProSonic game engine.

Its name is a combination of letters from "YM2612" and "DX", the latter referring to Yamaha's line of FM synthesizers from the '80s.

Specifications

The official specifications for the YMX format have been released by saxman.

===================================
YMX revision 1 format specification
Created by Damian Grove
08/03/2011
===================================


The original YMX format is sufficient for most uses, but I wanted to update
the format to make it a little more versatile and add support for the GEMS FM
voice format so the YMX format could be extended to non-SMPS games. The new
group feature will allow you to categorize your voices, so if you have voices
from multiple levels or games, or if you want to group together all the types
of instruments (e.g. woodwind, brass, etc.), you can do that. You can also
have up to 65535 voices now, a vast improvement over the 128 limit from the
original specification.

All word and dword values described in this specification are little-endian.
Any implementation of this revision should also support the original format.
SMPS voices are in the Sonic 2 format and are 25 bytes in length. GEMS PSG
voices are not supported. Only the FM-based GEMS voices are supported, and
they are 39 bytes in length. All strings are in ASCII format. Voice and group
names should use 0x20 for empty characters. Strings do not use any special
terminating characters.



Below is the structure of a YMX revision 1 file:


HEADER:
    string[6]       "YM2612"
    byte            revision (0x01)
    word            number of voices (up to 65535 voices)
    byte            number of groups (up to 255 groups)
    dword           pointer to voice pointers
    dword           pointer to group list
    bits[8]         (76543210)
                    0 -- Voice format (0=SMPS[S2], 1=GEMS)
                    1-7 -- RESERVED
    byte            length of description
    string[0-255]   bank description


FOR EACH VOICE:
    dword           pointer to voice


FOR EACH VOICE:
    byte            group (0=none)
    byte[25-39]     voice data
    string[10]      voice name
    byte            length of description
    string[0-255]   voice description


FOR EACH GROUP:
    string[10]      group name



Below is the original YMX format:


HEADER:
    string[6]       "YM2612"
    byte            revision (0x00)
    byte            number of voices (0=0xFF, 1=0x00, 2=0x01; up to 128=0x7F)

FOR EACH VOICE:
    byte[25]        voice data (SMPS Sonic 2 format)
    string[10]      voice name

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.