PC GAME MIDI RIPING GUIDE
Sorry, tento článok som nestihol preložiť do slovenčiny. Keď si nájdem čas, chcel by som túto chybu napraviť. Zatiaľ sa budeš musieť uspokojiť s anglickou verziou.
I wrote this article, to help you store great music of that great PC times of Midi format, and to save it for the next generations :) I wrote it also in hope that if you will find the PC Game with great Midi tunes and you will be able to rip them, you won't leave the tunes for yourself and you will contribute them to World of Game Mids, so also the other music fans can share it. The article was written as part of World of Game Mids FAQs, where you will find also other interesting questions regarding Midi and archive (it also references there sometimes). Enjoy and feel free to send your feedback! :)
HOW CAN I RIP MIDI TUNES FROM OLD PC GAMES PROPERLY?
Well, this is very complex piece of cake, and I will try to explain it quickly, and will try to tell my experience what is good to do and what to avoid. But firstly, thanks for this section go out to these people:
- Borg No. One - without lot of help from this guy would this section very hardly exist. He has given me most of information about ripping tunes, connecting two computers (including the Gameport Midi cable which he sent me and using which I was able to set up the two computers midi recording environment), setting up the DOS environment for games (also boot disks for running DOS on todays fast hardware), virtual cable settings, lot of Winamp info about converting the tunes from exotic formats and playing files from archives and final feedback&comments for this help file
- Totoro - for initial explanation of recording Midi music from DOS games using two computers, first rips and MIDI gameport-gameport through din connection idea.
- Hadanite Marasek - for lot of VDMSound tips, and for MidiYoke tip too.
So, let's go to the point. Firstly, let's explain a bit how the MIDI music is played in the DOS PC games:
1. Let's say the music is stored in some form in the file(s) on the disk
2. The driver in the game takes these data and processes them.
3. Processed data are thrown to the "output", which is your sound card. The drivers play these data either as midi music (if you have soundcarad capable of playing MIDI data), or AdLib music (if you have older sound card, which has so called OPL-2 synthesizer).
Comparing to the other computer and console systems (e.g. Amiga, or todays PCs), the MIDI music storing is much more complicated especially because of the well-known problem that the same song sounds different on different soundcard and the target of game makers was to make the music play correctly on all sound cards of that time.
In many PC games in the past most PC music ripping people saw some smiling *.mid files in the PC game's directory, or in worse case they saw music in some exotic midi format like XMI, HMP or CMF, they took some DOS conversion tool like XMI2MID or HMP2MID and voila, they have music ripped from game in MIDI! But, then whoops, the midis sound different than the original ones in the game. But it sure doesn't matter, it will sure sound better on better soundcard, says the ripping man - and that's the story why many bad Midi songs have been spread over the world: they are not patched with the original used instruments in the game itself, and that's why they are unlistenable on *any* soundcard and they are complete junk. It's problem I described here and this was the painful point I recognized after ripping many tunes this "simple" way - though many of them really worked, some else sounded absolutely jerky. The reason, why this is so, is in above three points. If you simply take the MIDI tunes from the game, you did the point 1. But you DID NOT do the points 2 and 3, which the game does. During these points, the game can transfer the originated MIDI data applying the drivers (many games use Instrument-patch files, to play the midis/notes with other instruments) and processing the tune to output, and this means the game will change the originated data to the midi data which sounds okay on your soundcard. If you simply take the MIDI data you will find, it will loose the quality more or less. Mostly it is 1:1 to the tune you listen in game. But sometimes it's real jerk. So, what to do?
The target is to "simulate" above three points as good as it gets. Step through each of the points potentially looses quality of the resulted MIDy and it's up to you how you will handle with that, to gain the quality loss as low as it gets. I'd recommend these rules:
Don't trust the ripped tune is the same as game tune. Always compare the ripped result with the one you hear in the game. If it sounds jerky on your common card (e.g. SB Audigy, or some software synthesized card), it will be probably your fault. You must be able to run the game in original environment and quality to achive this.
If the game is in different format than MID, DO NOT use conversion tools like XMI2MID, HMP2MID, CMF2MID etc. They loose quality of the songs more or less, and are absolutely useless now. Use Winamp's conversion to convert the tunes instead, or in worst cases use direct recording to achieve songs in better quelity (read below more).
Best method for ripping MIDI from PC games
Most perfect method of ripping tunes at the time is recording them directly from the game. The basic idea is like this:
- We have to set up the recording environment, which is able to record MIDI data. The best is to use two computers, where the first one sends the midi tune through the MIDI OUT port (most of the sound cards have it on Gameport), and second computer receives the midi data through MIDI IN port. You will need the additional cable which connects these computers through MIDI IN-OUT port. Most sound cards use Gameport for this, so you have to create simple cable with gameport connectors and connect pin12 of outgoing computer with pin15 of incoming computer.
Thanks to Borg No. One, who made and sent me this cable, I have set up this environment and confirm that this way definitely works!
Here is simple schema of this cable:
As you can see, the pin12 and pin15 are connected in both ways. This is because now you can use the cable both ways between two connected computers, so the both ones are able to record and receive data from other one. For very simple one-way connection you don't need to do the connection marked red, but then you can connect the first connector to the sending computer and the second one to the receiving computer and record the data only one-way.
WARNING, BE CAREFUL you connect the proper pins, because the bad connection may result to destroying sound cards on sending or receiving computer! Often common mistake is connecting the same pins (e.g. pin12 with pin12) - this may do really bad things! Also watch this page to see which pin does what on the gameport (for us are important only pins 12 and 15,though).
To have better imagination how the complete cable should look, here are few photos from Borg No. One's finished cable (click on pictures to enlarge):
If you are not into cable making, there is a more convenient, but more expensive solution - buy two adapter cables from gameport to MIDI in/out (DIN connectors) and one MIDI cable, which connects these two DIN connectors between themselves. This idea was sent to me by Totoro and I didn't test it at all. But as he told me, this should work as well as previous solution
- On the "receiving" computer we will install the software, which receives the Midi data and is able to save it to some form, which is then convertable to Midi (good way under Windows is Midi-OX - freeware program, which can do lot of things, and one of them is ability to log Midi input to the "Midi to text format". This is simple text file, which "logs" the Midi data into human readable and editable form, and what is most important, it is lossless convertable to classic MID file using the T2MF.EXE tool). Here is briefly described what to set up in Midi-OX, if you use Gameport Midi cable described in previous point:
- Open the File/Log configuration dialog and set it following (the data will be saved into the filename which you will write in the "File name" field):
- Set up input and output devices, by opening opening the Options/MIDI Devices Configuration dialog. Choose the Input device where leads the Gameport midi input from (you should have some Midi input device available between the input devices list, its exact name depends from your receiving sound card). Also open some output device (this is actually not necessary, but you can hear the received music then through output device you selected). E.g. for SoundBlaster Audigy you should select the input/output devices following:
- Run the game on the "sending" computer and play the corresponding tune, while output leads to MIDI OUT port. The best would be if the sending computer would be "pure DOS", hardware should be somewhere around Pentium 200MHz (to be able to run the games fast enough, but not too fast and incompatible), with ISA sound card (e.g. SoundBlaster AWE32 or 64) and with MIDI output redirected to MIDI OUT using the native sound card driver. Most todays sound cards don't have native DOS drivers, and you have to find some way how to run these cards under DOS (for SoundBlaster PCI cards like SB Live! or Audigy, you can find the DOS drivers here) and additionally, how to .redirect the Midi output to MIDI OUT. You should try to choose any MPU-401 device as music card (in most cases it goes through port 330) and this should work - in the sound card setup use any music card which goes through port 330 (Roland, General MIDI, etc.) and you should be able to see the input data in the second coputer's MidiOX input window (if the cable is connected and MidiOX input port is set up properly), as soon as the music starts to play. Note, you need always to watch which soundcard the data output is for. For example, the Roland MT32 Midi may be successfully recorded through any soundcard's MPU401 port, but for correct playback after processing you will need real Roland MT32 soundcard, on other cards it will sound crappy. The SoundBlaster AWE32 Midi output may be more tricky, because it doesn't send the data to port 330 by default. You will either have to set up the AWE32 output to port 330 somehow (it's not common setup and sometimes it's not possible without modifying the INI files somehow) or if you know where the AWE music data files are stored, try to replace the music file to the General Midi file and set up General Midi (this will cause that the AWE32 tune will play when General Midi is setup, if set properly).
- On the receiving computer, store the tune properly while playing (clicking on "LOG" square in bottom right corner on Midi OX you will start to log the Midi data into the file), save it as MIDI (or export to text file if you're using Midi-OX, and then using T2MF.EXE convert it lossless to midi). It is good to cut each song descent if the recording process was not exactly or just a litle bit too long (you can edit the file in Midi sequencer, or if you're using Midi-OX, you can edit resulting text file and remove repeating song from the end of the file, before converting with T2MF.EXE). And that's all, the ripping is complete!
Programs which make your life a bit easier
The above is very basic idea for ripping tunes, which cost lot of resources and is very hard to achieve (you need two computers, cable, pure DOS, old DOS driver for soundcard...). But this is really "ideal" environment. Fortunately, in current fast computers era we have some tools, which will help us to rip most of the tunes more easily, and as soon as it doesn't loose the quality of the ripped song, we can freely use them. But remember, always double check if more simple method really doesn't loose the quality of the output, because they really may do sometimes. Well, these are our "smart bombs" :
MidiYoke - This is software driver, which treats as virtual "cable" between two soundcards. Because it installs virtual Midi device, using this driver, you don't need to have two sound cards or two computers connected to record MIDI data, you can just play and record the MIDI on the same computer and one soundcard. But, you cannot use MidiYoke in the pure DOS, it is only Windows program, so it has sense to use it only in Windows applications (though, emulators like DosBox or VDMSound work well). Here is step-by-step guide how to record the MIDI tunes on one computer using Midi Ox and Midi Yoke:
- Install Midi Ox and Midi Yoke drivers
- Go to Windows Control panel, menu Sounds and Audio Devices Properties, tab Audio, section MIDI music playback and choose "Default device" as "MIDI Yoke NT: 1" (if you successfully installed Midi Yoke, you should see this device between the choices, if you don't see it, install Midi Yoke again).
- Run Midi Ox and open the Options/MIDI Devices Configuration dialog. Select the "MIDI Yoke NT: 1" as MIDI Input.
- Select your soundcard output as MIDI Output (you actually don't need to do this step, only you won't hear any music then while playing a game). Warning: NEVER set output as "MIDI Yoke NT: 1"! This is often a mistake and it causes the computer crash (in better case), because then you will output data to the same port as you read the input.
- Click OK on Midi Ox Options dialog and keep Midi Ox running during next step.
- Run your favourite Windows game which plays Midi (you can try also DOS game under DosBox emulator) and while playing Midi tune you should see the text dialog in Midi Ox keeps writing some text in Input Window. If yes, everything is set up properly and you can store the Midi data into text file and then convert it to MID (use step 4 of best method of midi ripping guide)
DosBox - This is "DOS emulator", which focuses to emulate the old DOS games in Windows environment properly. It emulates also MIDI ouput and because it is Windows application, you can use MidiYoke to record MIDI data from DOS games this way. However, as every emulator, it's much slower than the original system. In this case it means that you have to double check if the music played is really in the correct speed as original (often it's slower) and of course, if the quality in the emulation is the same as in original. But for older games and fast computers is this really very helpful tool.
VDMSound - I would call this "emulator of DOS sound for Windows". Like DosBox, it emulates sound in games, but unlike DosBox, it doesn't emulate the system as whole, it emulates only sound from it. However, sound support was most problematic feature in DOS games under Windows (especially Windows NT/2000/XP, because these systems don't emulate SoundBlaster in their DOS command prompt) and mostly it was the reason why the games couldn't be run from DOS window properly. Using VDMSound many games will work with proper sound emulation. The advantage comparing DosBox is that the games are often faster (sometimes too fast ), disadvantage is the number of emulated games, which is less than in DosBox. But like DosBox, you can use MidiYoke and other tools to record Midi output on one computer in Windows environment, so it's best to try the desired game in both environments.
WinAmp - this player has very good Midi player, which plays near standard MIDI files also many exotic formats. And what is important for us, it is able to convert them to MIDs much better way than old DOS conversion tools did. You can use this player to convert tunes in formats like XMI, HMP, HMI, MUS, CMF etc. to MID this way:
- Download, install and run Winamp (Free Full Distribution).
- In the Options/Preferences menu choose the tab Plugins/Input, choose "Nullsoft MIDI player", click Configure.
- Select tab "File Types", select all file types in the box, and click OK.
- Now the Winamp can play the exotic Midi formats. Play some exotic file and choose File/View file info (or press ALT+3)
- Click "Save" button to save the exotic file to Midi file. You can also select multiple files in playlist and press ALT+3 on them. This will allow you to save and convert the files faster.
During the conversion beware of following:
- Always double check if the original exotic midi file sounds like in the game. If not, it doesn't have big sense to convert it, it probably misses the correct drivers and the result midi will sound bad too.
- In some rare cases, the Winamp's playroutine doesn't play the files properly because of the format nature (especially if the exotic file has subsongs, which may happen in case of some XMI or other files - for example, Lords of Midnight 3). In this case you have to use original DOS game's music play instead of Winamp, and record the files using Midi-OX and Midi Yoke to convert files properly. For XMI files, you can try to play the music with DOS's XMIPlay, which plays also the subsongs of XMIs, so it's more proper in some cases. In different formats (especially HMI, HMP), you can use simple trick - run SETUP.EXE, select midi card, and choose sound test. You can hear play a test song. If yes, find the Midi file inside the game (it should be the same format as the game's music) and copy the file you want to be played over the this file. Run SETUP again and play the test song. You should hear and record the tune you wish
MT2GM - This tool is handy if the tunes are originated for Roland MT-32 and are not found in General MIDI form. You can use this tool to convert the MT32 tunes to General Midi. Though you cannot count that the tune will sound exactly as on MT32, it will sure sound better on GM card than original (MT32 uses other instruments and other order of instruments). But beware, you have to be sure the originated tunes are for MT32, otherwise the conversion will result to absolutely crappy sounded junk. (and as I told before, MIDI format doesn't store the information which system was it done for, so only way is to know it or simply to try the conversion and check if it sounds better than original...). The MT2GM tool is conciped to be "generic" converter from one patch bank to another, only clue is to have proper PATCHCNV.TXT file, which defines the conversion rules. Because of this philosophy, you can find near "original" patch file also another called PATCHCNV(vdmsound).txt provided to me by Borg No. One. This patch file uses a bit different patch bank for converting MT32 files, and the result is sometimes better, sometimes worse than original patch bank. To apply, just copy PATCHCNV(vdmsound).txt over the PATCHCNV.txt and apply the conversion. When I have to convert tunes, I mostly leave both versions (mostly I'll create directory GM, where I place tunes converted with original patch conversion bank, and directory GMV with files converted using VDMSound patch bank).
Extractor or MultiRipper - handy tools which allow you to extract music/picture files from big archive files. Though both programs do almost the same, they differ a lot and therefore I recommend to try both of them. Extractor is rather new, has nice Windows graphical user interface with many interesting functions, it supports libraries from newer games and is very good not only for MIDI/MOD files, but also for many of todays streamed formats. On the other side, MultiRipper is rather old, but recognizes more "old" formats and file libraries, it's cool especially for some rare MOD formats, so in our MIDI/MOD ripping situations it may be more successful, though it has obsolete DOS user interface, which doesn't work well sometimes on todays Windows machines (I cannot say it doesn't work, but it doesn't work well sometimes ). Additionally, the last 3.0 beta version of MultiRipper is completely freeware, while Extractor is shareware (unregistered version of Extractor limits the saved tunes to 30 and registration costs approx. $10). However, I am still looking for a program, which could scan and analyze PC memory for known tunes.
So, if you think you can get onto it, feel free to "revise" the tunes in World of Game MIDs. Many of them are in the state they should be re-ripped again the better way. You can try it using some tips above, and maybe you'll get better version of your favourite music, or you will be able to get something wholy new, which is not in the archives. And if you don't forget, you can send the tunes to me, so I can put the tunes on the website and share them with others to make me and them happy too .