Nostalgia: ST-Sound
YM File format
 

Legal notes: YM file format was created for ST-Sound by Arnaud Carré. The file format is freeware, so everybody can use, read or produce YM file.

WARNING: If you're not programmer, you can skip that page. It contains technical information and it's totally unusefull if you only want to listen YM tunes.

 

YM file are specific file to use with ST-Sound or any ST-Sound based player. You can find some ".ym" files for the amiga but both formats are really different. If you're looking for a great collection of real ST-Sound YM file, go to the biggest YM database on the internet.

YM file format is a "multi format". Basically, YM file are made to produces some classic ATARI chip tune. But YM can produce some strange and custom music too.

 
YM Header type Music type
YM3 to YM6 Classic YM-2149 chip tunes. Differents formats are made to support some "extended" chip tune effects as digidrum, SID-Voice,etc...
MIX Sample remix. Many ATARI demos feature music wich is just sample remix. (Ex: Union Demo "1 Mb Beat Dis Screen" by The Carebears)
YMT Universal YM Tracker. This is a universal tracker format. (Tracker is a music in wich instruments uses real sample, no YM-2149 tone synthesis). Use it to replay all custom soundtracker music from ATARI, AMIGA etc...
 
YM6 Chiptune format
 

As you probably know, YM is only an YM2149 Chip emulator, not a true MC68000 emulator. (For the moment !). YM-Files does not contain any 68000 code routine. A music-file is composed of YM2149 registers dump generated by the original play-routine (from the original machine: ATARI, AMSTRAD, SPECTRUM and all kind of machine with an Yamaha YM2149 sound chip). WARNING: YM3 trought YM5 are now old format, so if you want information about it, just write me. Next things are YM6 specific !

So YM6 is just a register dump file. In chip music, sound registers are usually updated once per frame. A frame is generally updated at 50Hz. An YM6 file frame is a 16 bytes lenght frame. So just imagine you have a 6 minutes songs, in wich registers are updated at 50Hz (let's call this the "frame rate" now), you need 288000 bytes (282Kb) to store all YM registers. Quite big for a soundchip format don't you think ? Yes, but data are "interleaved" in the file, then packed with a great packer. Finally, if you look at all the YM file on the internet, you'll see that YM file is generally from 1 to 10Kb.

About the packer: The YM file can be stored on your hard disk in two ways: without or with packing. To pack an YM file, you just have to use the freeware packer "LHA" written by Haruyazu Yoshizaki. Almost all YM file spreaded around the web are packed. So if you want to look inside an YM packed file, just use the command: "lha e music1.ym".WARNING: The ST-Sound player only support LZH file with header 0, so don't forget to use the "-h0" flag when packing a YM file you just create !

About an YM data frame: An YM data frame is composed of 16 bytes. 14 first bytes contains YM2149 data registers, and the two last ones contains extended information. To improve the compression ratio, an YM data frame can be interleaved or not. Let's call the 16 bytes of a frame r0,r1,r2,...,r15. In a non-interleaved format, the YM file contains: r0,r1,....,r15 of frame 0, then r0,r1,...,r15 of frame 1 and so on. This is quite easy to enderstand but not easy to pack :-) That's why there is an interleaved format: file contains all r0 for all frames, then all r1 for all frame on so on. Almost all YM file spreaded on the web are interleaved files.

 
Type used in YM File
BYTE
unsigned 8 bits integer
WORD
unsigned 16 bits integer (Big Endian format)
LWORD
unsigned 32 bits integer (Big Endian format)
STRING[n]
Ascci text string of n characters
NT-String
Null terminated string.
 
YM6 File header structure
Offset
Type
Size
Description
0
LWORD
4
File ID "YM6!"
4
STRING[8]
8
Check string "LeOnArD!"
12
LWORD
4
Nb of frame in the file
16
LWORD
4
Song attributes
20
WORD
2
Nb of digidrum samples in file (can be 0)
22
LWORD
4
YM master clock implementation in Hz .(ex:2000000 for ATARI-ST version, 1773400 for ZX-SPECTRUM)
26
WORD
2
Original player frame in Hz (traditionnaly 50)
28
LWORD
4
Loop frame (traditionnaly 0 to loop at the beginning)
32
WORD
2
Size, in bytes, of futur additionnal data. You have to skip these bytes. (always 0 for the moment)
Then, for each digidrum: (nothing if no digidrum)
34
LWORD
4
Sample size
38
BYTES
n
Sample data (8 bits sample)
Then some additionnal informations
?
NT-String
?
Song name
?
NT-String
?
Author name
?
NT-String
?
Song comment
?
BYTES
?
YM register data bytes. (r0,r1,r2....,r15 for each frame). Order depend on the "interleaved" bit. It takes 16*nbFrame bytes.
?
LWORD
4
End ID marker. Must be "End!"
 
 
Frame register detail
 
b7
b6
b5
b4
b3
b2
b1
b0
 
r0
x
x
x
x
x
x
x
x
Period voice A
r1
       
x
x
x
x
Fine period voice A
r2
x
x
x
x
x
x
x
x
Period voice B
r3
       
x
x
x
x
Fine period voice B
r4
x
x
x
x
x
x
x
x
Period voice C
r5
       
x
x
x
x
Fine Period voice C
r6
     
x
x
x
x
x
Noise period
r7
   
x
x
x
x
x
x
Mixer control
r8
     
x
x
x
x
x
Volume control A
r9
     
x
x
x
x
x
Volume control B
r10
     
x
x
x
x
x
Volume control C
r11
x
x
x
x
x
x
x
x
Envelope high period
r12
x
x
x
x
x
x
x
x
Envelope low period
r13
       
x
x
x
x
Envelope shape
r14
                Extended data
r15
                Extended data
 

Almost all ATARI game tunes are very classic chip-tune music, using only the original YM2149 features. These music sounds quite poor but are very simple to generate. For that kind of tune, you only have to fill the "x" bits with the original chip value, and set all other bits to 0.

 
Extended YM effects
 
 

YM6 format support some ATARI specific tricks to produce complex sound. These tricks will be now called "special effects". YM6 supports 4 special effects, and can start two of these each frame. All these effects use the ATARI software timer interrupts. ATARI timer routine can be resumed with only two values: The timer predivisor (TP) and the timer count (TC). The ATARI interrupts system has a master clock of 2457600 Hz. The predivisor is a 3 bits value, wich divide the master clock. Then period is divided by the timer count. As an example, let's say you write 1 in TP and 28 in TC, you obtain a 21492 Hz interrupts routine. ((2457600/4)/28)

YM timer period coding table
Predivisor register
Real predivisor value
000
Timer is stopped
001
4
010
10
011
16
100
50
101
64
110
100
111
200
Here are the special effects list:
YM6 Special effects supported
Effect
Description
Digidrum
Digidrum is a very little 4bits sample played on a voice. Tradionnaly used to add more realistic drums in music, musicians called it "Digi(t) Drum".
SID-Voice
SID-Voice is a great sound trick on the ATARI, because of low CPU consuming and great sound effects. It sounds a bit like C64 so that's why musicians call it "SID-Voice". On a real ATARI, SID-Voice uses a CPU interrupts to produce a square tone, wich is mixed to the original YM2149 tone.
Sinus-Sid
This is bad name for an effect wich is closer to the Digidrum technic than the SID-Voice. Only used by the musician TAO, this is only a little 4bits sample producing a sinus wave.
Sync-Buzzer

I think this is one of the coolest special effect, with SID-Voice. It was used first by the musician TAO. Sync-Buzzer uses an external CPU interrupts to write values in the Envelope shape register. (YM2149 register 13). As you probably know, writing in r13 set the new shape waveform AND reset the envelope ! So you can produce some very nice sound effect.