Difference between revisions of "YMX"

From Sega Retro

m
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''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]].
+
'''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]]. In 2017, [[saxman]] released [[YMX2SYX]], a tool that converts YMX banks to SysEx banks supported by Yamaha DX11, DX21, DX27, DX27S, DX100, and TX81Z synthesizers.
 +
 
 +
Its name is a combination of letters from "'''YM'''2612" and "D'''X'''", the latter referring to Yamaha's line of FM synthesizers from the '80s.
  
 
===Specifications===
 
===Specifications===
The official specifications for the YMX format have been released by [[Saxman]] amongst the documentation included in Sonic QX. An 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.
+
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 pointers
 +
    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:
 +
    dword          pointer to group
 +
 
 +
 
 +
FOR EACH GROUP:
 +
    byte            length of group name
 +
    string[0-255]  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)
  
A YMX bank is allowed up to 128 voices. So anything above 7F is illegal. This
+
FOR EACH VOICE:
limit is used to seek future compatibility with MIDI messages and Yamaha DX/TX
+
    byte[25]        voice data (SMPS Sonic 2 format)
conversions.</pre>
+
    string[10]      voice name
====Voice====
+
</pre>
<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
+
[[Category:Contemporary data formats]]
2 - register 030
+
[[Category:Music]]
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</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]]
 

Latest revision as of 08:17, 7 July 2022

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. In 2017, saxman released YMX2SYX, a tool that converts YMX banks to SysEx banks supported by Yamaha DX11, DX21, DX27, DX27S, DX100, and TX81Z synthesizers.

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 pointers
    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:
    dword           pointer to group


FOR EACH GROUP:
    byte            length of group name
    string[0-255]   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