MUS (Electronic Arts)

From Video Game Music Preservation Foundation Wiki
Revision as of 18:20, 24 July 2017 by Binarymaster (talk | contribs) (Game Differences)
Jump to: navigation, search
MUS (Electronic Arts)
MUS (Electronic Arts).png
Developer: Electronic Arts, Inc.
Header: Custom
Content: Notational
Instruments: Unknown
Target Output
Output - Digital Audio - No.png Output - MIDI.png Output - FM Synthesis.png Output - PSG.png
Released: 1989-??-??
First Game: Cartooners (DOS)
Extensions
  • *.mus

This music format was used by Electronic Arts form 1989 to 1992. Below is technical specs on the format so that programmers may write a player for the format.

This music format uses the extension *.mus in "Cartooners" and the "Lost Files of Sherlock Holmes", but "Ski or Die" and "The Immortal" use a generic *.bin extension.

The MT-32 driver of "Lost Files of Sherlock Holmes" actually mentions "Ski or Die", by name, inside of it, probably from reused code.

At offset 0x37, there is a 12-byte table that is used for CMS playback only. It specifies the finetune offset (in semitones) for each of the 12 CMS channels.


Players

It appears that Joel Yliluoma (Bisqwit) managed to figure out how to play these music files: [1]. The page containing the source for this player: [2].


EAPlay: [3]


Converters

(Category)

MUS to ?

? to MUS

Games

(Category)
Released Title Sample
1989-??-?? Cartooners (DOS)
1990-??-?? Ski or Die (DOS)
1991-??-?? The Immortal (DOS)
1992-??-?? The Lost Files of Sherlock Holmes: The Case of the Serrated Scalpel (DOS)

Technical

Note that all this data is for the AdLib player in Cartoonist. It may be totally different for other EA games.

  • At offset 0x00, there is a 16-bit integer that describes the start of the song (and also the start of loop), relative to the beginning of the file. Commonly observed values include 0x007D and 0x007F.
  • At offset 0x02, there is a 16-byte table that is used in Roland playback only. It may tell for each of the 16 MIDI channels whether the channel is enabled. This is unconfirmed.
  • At offset 0x12, there is a 16-byte table that is used in Roland playback only. It tells for each of the 16 MIDI channels the global channel volume (controller 7 value).
  • At offset 0x22, there is a 9-byte table that is used in AdLib playback only: It tells for each AdLib channel which MIDI channel it is dedicated for. Only AdLib channels 5—8 may be dedicated for percussion (MIDI channel 9). Any of channels 0—8 may be melodic.
  • At offset 0x2B, there is a 12-byte table that is used for CMS playback only (dual SAA1099). It has the same purpose as the equivalent table for AdLib.
  • At offset 0x37, there is a 12-byte table that is used for CMS playback only. It specifies the finetune offset (in semitones) for each of the 12 CMS channels.
  • At offset 0x4B, there is a 2-byte table that is used for PC speaker playback only. Its purpose is unknown.
  • Bytes from 0x43-0x4A and from 0x4D to the start of the song are not used by any of the MIDI player interfaces in Cartooners. They may still have some purpose by the game itself, or it may be metadata that was utilized only by a music editing tool internal to the company.
  • Each header contains a data block beginning at song start offset minus 0x30 (it will be at 0x4D, if start offset is 0x7D, and 0x4F if start at 0x7F). This block consists of constant byte values with a string 'rsxx}u' at relative offset 0x20. The purpose of this data is unknown.
  • The actual song data is in MIDI MTrk format, so it's easy to convert it to standard MIDI file, though it may require to set correct pitch bend sensitivity using RPM events.
    • The delta-times in the song are always shorter than 0x80 (meaning the MIDI variable-length delay is not used), and they indicate the number of frames to idle before the next event.
    • Supported event types are 0xC0 (patch change), 0x80 (note off), 0x90 (note on), and 0xE0 (pitch bend).
    • Running status is supported, as is the shortcut of turning note off by issuing a zero-volume note-on event.
    • Note touch command (0xA0), controller change command (0xB0), channel after-touch command (0xD0), and any 0xFx commands than 0xFC are not supported. They are treated as 3-byte commands and skipped as such (which is incorrect for 0xD0 and most 0xFx commands).
    • A patch-change event will immediately reprogram the envelope parameters on all AdLib channels dedicated for that MIDI channel, regardless of notes currently playing on those channels. It may therefore alter the ADSR envelopes and waveforms of already keyed-on notes. The envelope parameters are not reprogrammed on key-ons.
    • Pitch-bender affects immediately all currently keyed-on notes on the specified channel, but the effect will not persist, i.e. new key-ons ignore the pitch-bender.
    • AdLib keyon will always succeed, provided that there exists an AdLib channel dedicated for that MIDI channel. If all channels are busy, it chooses the AdLib channel that has been keyed-on the longest time, from the list of AdLib channels dedicated for that MIDI channel.
    • Volumes are calculated in a peculiar way. Rather than multiplying the inverse level parameter from register 0x40 with the logarithm-corrected inverse volume and scaling and inverting the result, which is what most AdLib MIDI players do, it divides the MIDI volume by four, subtracts that from the level parameter, and writes that into the carrier register without any clamping. In Roland MT32 playback the volumes are fed straight to the device. In CMS playback, the MIDI volume parameters are all ignored.
  • The last event in the file is always 0xFC. This event is followed by either byte 0x80 or 0x81. Byte 0x80 indicates the song restarts (loops) from beginning, and any other byte means the song ends there.

Game Differences

The MUS files from The Lost Files of Sherlock Holmes begin with 12 spaces (0x20) before the '7F 00 00 01' string.

"The Immortal" has a completely different header and data style because of LZSS compression, with similar header like in three compressed songs from Ski or Die.

After decompression the data structure is the same.

Links