MDS

From Video Game Music Preservation Foundation Wiki
Jump to: navigation, search
MIDI Stream
MDS.png
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
Extensions
  • *.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).

Players

(Category)

Converters

(Category)

MDS to ?

? to MDS

Games

(Category)
Released Title Sample
1995-08-24 3D Pinball: Space Cadet (W16)
1995-10-31 Full Tilt! Pinball (W16)
1996-10-31 Full Tilt! 2 Pinball (W16)
1996-??-?? DX-Ball (W32)
1997-03-28 Clock Tower (W32)
1997-??-?? Legal Crime (W32)
1998-04-24 Ys Eternal (W32)
1998-10-31 Total Air War (W32)

Technical

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 iStreamID Stream ID to use (only if the format flags field is 0)
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)

Links