From Video Game Music Preservation Foundation Wiki
Jump to: navigation, search
MIDI Stream
Developer: Microsoft
Header: RIFF
Content: Notational
Instruments: Optional
Target Output
Output - Digital Audio - No.png Output - MIDI.png Output - FM Synthesis - No.png Output - PSG - No.png
Released: 1995-08-24
  • *.mds
  • *.mids

The MIDI Stream (MDS) is a rare format for storing MIDI data created by Microsoft with the release of Windows 95. MIDI stream files can be played with midStream API.

However the format is not able to store additional information such as meta events. It can store only standard MIDI events (short messages), tempo changes and SysEx events just in one track (like MIDI Type 0).





MDS to ?

? to MDS


Released Title Sample
1996-??-?? DX-Ball (W32)
1997-03-28 Clock Tower (W32)
1998-04-24 Ys Eternal (W32)
1998-10-31 Total Air War (W32)


All MDS files use RIFF tree structure, and the identifier is MIDS.

RIFF Tree Structure

File Root
└─ RIFF:MIDS     - RIFF MIDS header
   ├─ fmt        - MIDS format chunk
   └─ data       - MIDS data chunk

Format chunk

The size of the format chunk is equal to 12 bytes which are formed by this structure:

Data type Name Description
UINT32LE dwTimeFormat Low word - time format in SMF format
UINT32LE cbMaxBuffer Guaranteed max buffer size (default is 4096)
UINT32LE dwFlags Format flags (default is 1)

Data chunk

The data is stored in the sequence of 32-bit numbers and divided into blocks. The first 32-bit value is count of the blocks in the chunk. The next it's followed by the MIDI blocks.

The MIDI block represented in this structure:

Data type Name Description
UINT32LE tkStart Absolute tick offset at start of buffer
UINT32LE cbBuffer Block size (default size is 2728)
BYTE[cbBuffer] aData MIDI data

The MIDI data represented in events which has this structure:

Data type Name Description
UINT32LE iTicks Delta-ticks before event
UINT32LE iEvent Event value

iEvent may has different types, depending on high byte. There are only 2 known types of events:

Event notation Description
xx p1 p2 00 MIDI short message (xx - status byte, p1 and p2 - parameters)
xx xx xx 01 Tempo change (low 3 bytes is 24-bit little-endian value for tempo)