iMuse MIDI player?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
starslab
Posts: 3
Joined: Sat Nov 09, 2019 10:36 pm

iMuse MIDI player?

Post by starslab »

Heya!

The Tie Fighter Total Conversion project is trying to produce high-quality captures of the original MIDI output from the DOS Tie Fighter game.

Obviously this is not a SCUMM engine game, but it does use the iMuse music system for dynamic music, and it's causing headaches for the team. They are able to extract gmid data from the game, but this doesn't quite play right in normal MIDI players.

Is there any chance there is code or tools in the ScummVM project that could help with this? Ideally, I'm thinking of having the ability to glue a bunch of arbitrary gmids together into a standards-compliant .midi file that can then be played on common playback software?
digitall
ScummVM Developer
Posts: 1087
Joined: Thu Aug 02, 2012 1:40 pm

Re: iMuse MIDI player?

Post by digitall »

No SCUMM / iMUSE expert, but there is the technical reference documentation here:
https://wiki.scummvm.org/index.php?titl ... _resources
https://wiki.scummvm.org/index.php?titl ... iMuse_data

Apart from that, "Use the Source, Luke":
https://github.com/scummvm/scummvm/tree ... cumm/imuse
starslab
Posts: 3
Joined: Sat Nov 09, 2019 10:36 pm

Re: iMuse MIDI player?

Post by starslab »

As a not-a-programmer, "use the source" is a little bit outside my realm of competence.

How accessible is SCUMM? Could someone (maybe me?) take the gmid files from TIE Fighter / XWing and construct a new ScummVM "game" that just plays defined sequences of music?
User avatar
Mok
Posts: 7
Joined: Mon Feb 09, 2009 8:04 pm

Re: iMuse MIDI player?

Post by Mok »

starslab wrote: Wed Jul 21, 2021 3:48 am As a not-a-programmer, "use the source" is a little bit outside my realm of competence.

How accessible is SCUMM? Could someone (maybe me?) take the gmid files from TIE Fighter / XWing and construct a new ScummVM "game" that just plays defined sequences of music?
I haven't looked at imuse for years, so my memory is fuzzy, but I don't think conversion will be easy (to retain all of the original music). OTOH the format isn't really special. Each sequence internally is a normal SMF .MID file except it's marked as "type 2" which is unsupported by many sequencers. And every track is either a part of a main song or a subsong. So to play/edit it, it's as simple as flipping the flag from type 2 to type 1 in the file header and load into your favorite midi editor. Now, to play anything, you must disable every track except the one you are trying to play. Take note that often only one of the tracks will setup controllers/instruments and all other will assume it's already done so may not play correctly stand alone. This part is easy. The problem is you don't really know when to start the extra parts (tracks) as these are used during scene transitions/game callbacks (ie. switching from one file to another, from normal fight to boss fight etc. etc.) Imuse uses internal sysex commands for all it's extras but that will probably require digging into the source to understand. Years ago I was only interested in playing "main" songs outside of the game, so I never bothered about transition parts/callbacks. Good luck.
User avatar
sev
ScummVM Lead
Posts: 2110
Joined: Wed Sep 21, 2005 1:06 pm
Contact:

Re: iMuse MIDI player?

Post by sev »

In essence, iMUSE could be considered a small specialized programming language that uses a MIDI-like file structure for its programs.

There are commands which are then triggered by the game scripts. Thus, it is not a single playback, but a program. The only viable way of getting it aside would be to either emulate those commands sent to the iMUSE subsystem or capturing the MIDI playback directly produced by ScummVM or DOSBox.


Eugene
starslab
Posts: 3
Joined: Sat Nov 09, 2019 10:36 pm

Re: iMuse MIDI player?

Post by starslab »

The issue with capturing from DOSBox is that the scripts do a bunch of things that are hostile to "just capturing the music".

For example, during the cinematic sequences for both XWing and TIE Fighter, iMUSE dials down the volume when digital effects are playing, then lets it back up when the digital effects are done.

That is, how shall we say, less than ideal for archiving the musical performance.

And the in-flight music is extremely dynamic. It will change depending on if the player is in combat, and will also seamlessly play little ditties when friendlies or hostiles are destroyed, and when friendly or hostile reinforcements enter the area.

I'm thinking of trying my hand at making a little Scumm "game" that plays "background music" on each screen the player navigates to, using the MIDI data ripped from the original games, but excluding all the iMUSE commands that are hostile to music capture.
Post Reply