VOGONS


PX Player: play MID and XMI files under DOS

Topic actions

First post, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie

After investigating into Miles AIL 2.0 I found its standard XPLAY utility somewhat clumsy for daily use. Thanks to John Miles who left AIL 2.0 open sourced thirteen years ago, I've been able to tear wildly at XPLAY and modify it.

So here comes PX Player. You may use it to play MID and XMI files if you got some. Just make sure that you have required GTL files (*.AD, *.OPL, *.MT etc.) right next to your MIDs/XMIs. Put DEFDRV.INI containing corresponding driver name into each folder with MIDs/XMIs and you won't need specifying a driver each time you run PX on that MID/XMI. If no GTL found in MID/XMI directory, PX will use ones in its home folder; same with DEFDRV.INI. Thus you can bind PX to MID and XMI extensions in your file manager (use PX.EXE !.! or whatever) and live with it. Now you just select your MID/XMI file and push enter to start playing.

Note that PX is primarily aimed at XMI files playback; MID files are converted on-the-fly to XMI format with included MIDIFORM utility.

Devices supported:

ADLIB.ADV - Adlib; Generic OPL2
ADLIBG.ADV - Adlib Gold (NOT TESTED YET)
ARIATSR.ADV - Sierra Semiconductor ARIA based soundcards (requires MIDITSR)
ARIAXMID.ADV - Sierra Semiconductor ARIA based soundcards
AUDDRVFM.ADV - ESS AudioDrive
GENMIDI.ADV - General MIDI
GF1MIDI.ADV - Advanced Gravis UltraSound GF1 (requires ULTRAMID)
INNOV.ADV - Innovation SSI-2001
MMSYNTH.ADV - ASC Media Master compatible cards
MT32MPU.ADV - Roland MT-32 and compatibles via Roland MPU interface; LAPC-I
MT32SB.ADV - Roland MT-32 and compatibles via Sound Blaster MPU interface
MULTISND.ADV - Turtle Beach Multisound Classic - this driver has misplaced drum patches, download a fixed version here
PASFM.ADV - Media Vision Pro AudioSpectrum
PASOPL.ADV - Media Vision Pro AudioSpectrum Plus, Pro AudioSpectrum 16 and Pro Audio Studio 16/XL
PCSPKR.ADV - PC speaker
SBAWE32.ADV - Creative Sound Blaster 32/AWE32/AWE64
SBFM.ADV - Creative Sound Blaster 1.0, 1.5, 2.0 and compatible
SBP1FM.ADV - Creative Sound Blaster Pro
SBP2FM.ADV - Creative Sound Blaster Pro 2, Sound Blaster 16
SC32MPU.ADV - Roland Sound Canvas via Roland MPU interface; SCC-1
TANDY.ADV - Tandy 1000 3-voice speaker
VESAMID.ADV - VESA-compatible (requires a VESA VBE/AI MIDI driver)
WAVE.ADV - Creative Wave Blaster family
WSS.ADV - Microsoft Windows Sound System and compatible; Tandy Sensation; Generic OPL3

Also take a look at Tronix's driver for CMS/Game Blaster.

Refer to readme.txt for more details if needed.

Note to XT users: as far as tests by Scali show, PX player runs on XT but is too slow to be really usable.

Latest PX version is 1.09, for changes see below posts.

Attachments

  • Filename
    px109.zip
    File size
    381.94 KiB
    Downloads
    1764 downloads
    File license
    Fair use/fair dealing exception
Last edited by bristlehog on 2022-10-22, 07:38. Edited 58 times in total.

Hardware comparisons and game system requirements: https://technical.city

Reply 1 of 97, by keropi

User metadata
Rank l33t++
Rank
l33t++

wow thanks for that!!!!
any source to grab xmidi files?

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 2 of 97, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie

XMIDI files are really everywhere if you know how to look for them 😉

Games based on DIGPAK/MIDPAK, IBM/Miles AIL 2.0 and Miles Sound System 3.0+ tend to be using XMIDI files for music. Look for specific driver files: *.AD, *.OPL, *.ADV, *.MDI. I can even divide these games into four categories, based on my experience:

1) Games that just have XMI files lying open. You just take them and play.
Examples: Theme Hospital, Castles 2, Azrael's Tear, Ultima Underworld

2) Games that have XMI files packed within game archive files with no compression used. You need something to extract them. For example, a dozen of monkeys with hex editors!
Examples: Heroes of Might and Magic II, Ultima VIII, Dune II, Magic Carpet II: Netherworlds, Lands of Lore, Master of Orion

3) Games that have XMI files packed within compressed game archive files. You need a game-specific tool to extract them.
Examples: Lost Vikings, Blackthorne, Warcraft I & II, Little Big Adventure, Time Commando

4) Games that are based on aforementioned sound systems but do not use XMI. You get tempted by presence of specific drivers but there are no XMI files at all.
Examples: Dungeon Keeper (CD audio), Eradicator (PCM audio), Ultima VII: The Black Gate (uses MID instead of XMI), Oddworld: Abe's Oddyssee (uses obscure BSQ files)

Actually, I wrote myself a tool to extract XMI files from any other files, given that they aren't compressed. It has been proven compatible with almost thirty titles as of today. I'm just not sure if it's allowed to publish such tools here at Vogons. If it's not against the rules, I would release it for anyone's use.

Last edited by bristlehog on 2014-02-06, 09:53. Edited 2 times in total.

Hardware comparisons and game system requirements: https://technical.city

Reply 3 of 97, by keropi

User metadata
Rank l33t++
Rank
l33t++

I don't see why a file extractor would not be allowed, if you have the game you can look all you want on it's data files 😉

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 6 of 97, by Stefan_L

User metadata
Rank Member
Rank
Member

Nice!

Is it possible for you to make so some songs to loop... i mean just begin from start again as some songs do not have an looping event in the XMI... for example Albion and Ultima Underworld.

Reply 7 of 97, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie

I think it's possible. You mean like, make a switch to loop the XMI song until a key is pressed instead of exiting after song's end?

Hardware comparisons and game system requirements: https://technical.city

Reply 8 of 97, by Stefan_L

User metadata
Rank Member
Rank
Member

Yes, for example to start a song with looping then type "PX 1.xmi -L" or such 😀
I know Albion just restart the music when the end is reached but not using looping events in the XMI... the looping is not really smooth but it is better than having the music just to end abruptly.

Reply 9 of 97, by gerwin

User metadata
Rank l33t
Rank
l33t

Nice project!

What I was missing in the original XMIplay was this:
- Playing normal MID file instead of XMI. (I have to use MIDIFORM to convert first)
- Play after eachother the different subsongs. System shock is a good example of a game with subsong XMI tracks. What XMIplay calls 'sequence number' I suppose.

I think I was messing with the later .DIG / .MDI driver version of XMIplay.
Yes, and for the older .ADV driver system there was Menu.exe which plays both XMI and MID. But IIRC it sometimes has troubles with some MID files.
Download of Miles Menu player Here (midpak.zip)

--> ISA Soundcard Overview // Doom MBF 2.04 // SetMul

Reply 10 of 97, by Stefan_L

User metadata
Rank Member
Rank
Member

There is a player for System Shock XMI's called "SSPlayer"... but it seems it was never finished, however the source is available.
https://www.systemshock.org/index.php?topic=4717.0

Reply 11 of 97, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie

Requests heard; version 1.06 is out.

Changes in PX 1.06:

- added VESA folder with VESA-compatible OPL2 and MPU-401 resident drivers
- added TURTLE folder with Turtle Beach Multisound specific utilities and banks
- fixed bug in argument parsing that occasionally led to ignoring some arguments
- added /L switch to force endless loop until ESC key is pressed; if no sequence number provided, PX will loop through all sequences present in XMIDI file, otherwise specified sequence will be looped only. Loop mode (off/sequence/all sequences) may be changed during playback by pressing 'L' key.
- added keyboard commands during playback:

ESC - stop playback and exit PX
left-right arrow keys - navigate through sequences if more than one are present
up-down arrow keys - change playback relative volume
SPACE - pause/resume playback
L - change loop mode (OFF/SEQ[uence]/ALL[ sequences])

---------------------------------------
Hope to do in upcoming versions:

- add MID support
- fix bugs with some driver device descriptions

Hardware comparisons and game system requirements: https://technical.city

Reply 12 of 97, by Stefan_L

User metadata
Rank Member
Rank
Member

Great update 😀 I tried Albion and it plays (loops) just like in the game.

And speaking of Albion... even if the AdLib FM music uses the same music files so it is not possible to play the music in any XMI player since the the music mostly uses the last midi channels and using a XMI player so is AdLib music limited to the first 9 (i think), the game probably has some custom XMI drivers for FM music, the GM music is of course fine with PX.

Reply 13 of 97, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie
Stefan_L wrote:

Great update 😀 I tried Albion and it plays (loops) just like in the game.

And speaking of Albion... even if the AdLib FM music uses the same music files so it is not possible to play the music in any XMI player since the the music mostly uses the last midi channels and using a XMI player so is AdLib music limited to the first 9 (i think), the game probably has some custom XMI drivers for FM music, the GM music is of course fine with PX.

According to AIL documentation, AIL supports melodic channels 2-9 and drum channel 10 for XMIDI playback. I'm not sure how Albion deals with FM music. FM drivers and timbre banks are present, but XMIs that UXX is able to extract are not played well. There could be some custom engine parsing XMI data and somehow transmitting it to ADV XMIDI driver, instead of standard AIL_register_sequence() and AIL_start_sequence().

Hardware comparisons and game system requirements: https://technical.city

Reply 14 of 97, by Joey_sw

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for this program, its certainly better functionality than XPlay.

I extract the .XMI from game called "Flame Dragon 2: Legend of Golden Castle" which you can extract from file "FDMUS.DAT".
I also copies the sample.AD; sample.OPL; sample.BNK from game directory.
All those extracted .xmi files & sample.* are now in one directory.

Then i use the PX (version 106), but its sounded wrong, but i know why.
Using the /v switch its revealed PX using the supplied FAT.AD or FAT.OPL (depend on which driver i choose) instead of
SAMPLE.AD or SAMPLE.OPL which are game specific.

My current workaround is to overwrite the FAT.OPL (or FAT.AD) with SAMPLE.OPL (or SAMPLE.AD)
but its not optimal as i must rewrite thoase files again if i want to play another .XMI from different games,
as they use its own .AD or .OPL files.

EDIT:
miscalenous problem i found
the /v doesn't works well, if the starting/active directory is not the directory where PX program resides

related to the problem above, finding the correct GTL files are ok, if active/starting directory was where the correct .GTL located,
but i must explicitly specify which driver i must use, probably because the PX for some reason can't located the DEFDRV.INI file.

-fffuuu

Reply 15 of 97, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie

Don't keep all XMI files in PX folder, it would create a mess. Put XMI files of each game in separate folder (and create subfolders for different devices, if different XMI sets found for several devices in the game - FM, GM, AWE32, MT-32 etc.) Thus each folder will contain XMI files, GTL files for specific device, and defdrv.ini with device driver name.

There are several games I know of:

Fade to Black
Heroes of Might and Magic II
Inherit the Earth
Lords of the Realm
Master of Orion
Realms of Arkania
System Shock
Ultima Underworld II

that contain two or even more sets of GTL files; but these games are too few and I am too lazy to create a specific solution. Just put those GTL files in separate folders, if you manage to determine which GTL files correspond to which XMI files.

Concerning /V problem you described, I can't see it here. You may record PX output by running 'px blah.xmi /v >out.txt' and sending out.txt here for me to examine.

I am not sure about your defdrv.ini problem. But remember that PX searches current folder for defdrv.ini, not the folder PX resides in. Only driver (*.ADV) files are searched for in PX's native directory.

About BNK, CAT files: these are source files from which AD, OPL etc. GTLs are built. Neither BNK nor CAT files are required for XMIDI playback. Developers include them in game distributions erroneously.

Few games include BNK files that are not sources, but are needed for Sierra Semiconductor ARIA chipset cards (Prometheus ARIA16 etc.) These BNK files are not used by PX or other XMIDI players directly, instead used by ARIA TSR utility that is, in its turn, needed for ARIAXMID.ADV driver to work. But ARIA bnk files are called gm1.bnk, gm2.bnk, mt1.bnk, mt2.bnk. If you encounter some sample.bnk file, it's not needed for playback.

Hardware comparisons and game system requirements: https://technical.city

Reply 16 of 97, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie

I prepared a short video with PX demonstration, hope it will make the idea of organising your XMIDI into folders clear.

Hardware comparisons and game system requirements: https://technical.city

Reply 17 of 97, by Joey_sw

User metadata
Rank Oldbie
Rank
Oldbie

ah, yes its my fault for not copying the gamedrv.ini into the .xmi directory
above the /v problem i describe happens when i forgot to copy DEFDRV.INI

i believes its related on directory handling to find the required files

PX program in C:\PX directory
the XMI & GTL in C:\FD2

if i start PX from PX directory, to play the xmi i got ths:

C:\PX>PX \FD2\XMI00001.XMI /v
Verbose: ON
Driver: SBP2FM.ADV
Device: Creative Labs Sound Blaster Pro(TM) FM Sound
File: XMI00001.XMI
GTL: FAT.OPL
Sequence: 0

if i start the PX from FD2 directory:

C:\FD2>\PX\PX XMI00001.XMI /v
Verbose: ON
Driver: SBP2FM.ADV
Device: Creative Labs Sound Blaster Pro(TM) FM Sound
File: XMI00001.XMI
GTL: SAMPLE.OPL
Sequence: 0

but what happens if i happen in another directory, but i want to play the .xmi int other directory for a while ?
since i need to resume the works in my current directory, my dos logic dictate me like this

D:\WORKS\PAS\MAKE-3F\>C:\PX\PX C:\FD2\XMI00001.XMI /v

at first PX will complain not founding about not finding DEFDERV.INI,

Driver is neither specified nor found in DEFDRV.INI.

well.. its kind weird to hava a copy DEFDRV.INI to any directories where i want to run PX,
i would suggest for PX if its can't find the .INI in current directory,
PX should try to look in directory where the .XMI is,
and if it still fail then fall back to default .INI ini PX's directory.

other works around is to specify the DRIVER as command line argument/parameter, BUT without /l or /v switch ...

As purpose of testing, i copied the .INI to current directory anyway, and this time PX will complain about lack of .AD or .OPL file

Timbre library error: found no *.AD here.

... if i copied the GTL files to current directory again, it would work.
Anyway, i would suggest the same strategy to retrieves the GTL file.

Yeah those should've been easier if i use NC, but i lost my copy of norton commander ...

-fffuuu

Reply 18 of 97, by bristlehog

User metadata
Rank Oldbie
Rank
Oldbie

Got your point. I never ran PX from a folder other than one where XMIDI reside, should have thought about it.

I will fix PX behaviour so that it would:

- search XMIDI folder (not current folder) for defdrv.ini and GTL files
- if none found, fall back to PX folder and search for defdrv.ini and GTL files

Get yourself some free file manager. DOS Navigator, for instance, is freeware.

Hardware comparisons and game system requirements: https://technical.city

Reply 19 of 97, by gerwin

User metadata
Rank l33t
Rank
l33t

Yes. For a program which depends on several files, and uses parameter input, it is good practice to make it aware of where it resides. Example Allegro 4

--> ISA Soundcard Overview // Doom MBF 2.04 // SetMul