What is a WAV file?
Simply put, a WAV file is the computer's representation of sound. Sound is really nothing more than rapid fluctuations in air pressure. As such, a computer can model and reproduce sound easily by taking measurements of air pressure during short intervals of time, and recording the measurements for future playback. The red line in the two graphs above show the actual physical representation of a particular sound. Time is plotted on the horizontal axis; air pressure is measured on the vertical axis. As you can see, the air pressure rises and falls smoothly with time. In order to reproduce this sound, the computer must model this red line. The computer cannot model the sound precisely, but it can get reasonably close with a digital approximation. During a particular short period of time, the computer records the average air pressure as shown on the vertical axes on the graphs. This pressure measurement is usually 8 or 16 bits (1 or 2 bytes) in size. A 16-bit measurement can represent 65,536 distinct air pressures, but an 8-bit measurement can only represent 256 distinct air pressures. Obviously, the 16-bit measurement can come much closer to the actual air pressure, and thus the sound heard by the listener sounds better than an 8-bit sound. The air pressure must be measured very rapidly, usually several thousand times a second. This is where the sample rate comes in. (A sample is either the 8-bit or 16-bit value which represents the air pressure at a particular instant of time.) Typical sample rates include 11.025, 22.05, and 44.1 kHz. These mean that samples are taken 11025, 22050,or 44100 times a second, respectively. The higher the sample rate, the more often the measured air pressure can change and the closer the reproduced sound will come to the original. This is illustrated by the graphs. The black boxes represent the computer's approximation of the analog sound. The graph shows 8-bit samples taken 11025 times a second. Getting back to the original question, a WAV file is simply the collection of the 8- or 16-bit samples which the computer uses to approximate the sound. (There is also some header information at the beginning of a WAV file giving the sample depth, sample rate, number of channels, and so on.)
What is a MIDI file?
A MIDI file does not actually contain sound recordings, but instead it is a digitized form of sheet music. It contains instructions on which instruments to play and when, at what notes, and other information pertaining to the proper playback of the music. Because it does not actually contain waveforms, there are many ways to play back a MIDI file using different representations of the instruments. The most common is FM synthesis, which uses overlapping sinewaves to simulate the sound of each instrument. A more realistic and better sounding method is wavetable synthesis, which uses pre-recorded samples similar to WAV files to represent the instruments. A new method, not widely available yet, actually uses the physics of the instruments and acoustical properties of the materials in the instruments to predict the exact sound that the instrument would make. The main problem with MIDI is that the same instrument sample is used for every MIDI file, making them all sound pretty much the same. The MOD-file fixes this, by including the samples in the file itself, allowing the composer to choose the most appropriate-sounding instrument samples.
(by the way, MIDI stands for Musical Instrument Digital Interface, and it is also a protocol used to control a musical keyboard from a computer.)
What is a MOD-file?
What I refer to as a MOD-file includes many file types with extensions such as MOD, XM, S3M, MTM, as well as many others. I refer to all these various formats as a MOD-file because the MOD format was the original, and all the other formats are pretty much the same concept, but have various enhancements and improvements. MOD-files follow the basic formula:
Real Recordings of Instruments + Information on How to Play the Instruments = Great Music
The instruments in a MOD are actual recordings in WAV-like format embedded into the file itself. The "sheet music" is a set of commands which tell the computer such information as when to play a note, at what pitch, volume, panning, effect,...and the list goes on. This concept is similar to a MIDI file, but MIDI does not contain its own samples. Thus, a MOD-file can be thought of as a combination of a WAV and MIDI file. The advantage is that they are much smaller than WAV files for their playing time, and sound much better than MIDI because the composer can use instruments which are more suited to the style of each individual song.
Why do different formats of MOD-files exist? or How do I make my own MOD-file?
MOD-files are composed in a program called a "tracker." This tracker program allows the composer to select the instrument patches to use and completely control how they are played back. There are many different trackers out there, and each one has its own unique format that it saves the song in. That is why there are so many formats of songs around. Also, the more recent formats tend to have more features, because the capabilities of computer hardware keeps increasing what you can do with a song. For example, the original MOD-format was limited to 4 channels and up to 15 different instruments. More modern formats can handle 32 or more channels and any number of instruments.
If you are interested in composing MOD's, many popular trackers can be found at The Maz Sound Tools Page under Trackers/Players.
How do I play a MOD-file?
There are many MOD-players available, but Cubic Player is the best DOS player. I hear it will also work under Windows 3.1 / 95 and OS/2. If you want a Windows-specific MOD player, try MOD4WIN, which can be found at the MAZ Sound Tools Page. Be forewarned, however, that MOD4WIN will stop working after 30 days if you don't pay for it.