Playing MIDI Files from Browser


PC/Linux

You don't even need a soundcard to play MIDI files from your Linux PC! If you have soundcard, all the better, if not, get the PC sound drive kernel patch, follow the instructions inside to patch your kernel, recompile the kernel, and you have soundcard-emulation from your PC speaker! Well, don't expect it to sound anything close to the quality of a real soundcard, but it should be better than white noise :) Next you need the MIDI player TiMidity and also the instrument patch files found e.g. in here. After you compiled timidity and grabbed the patch files, you need to add the following line to the .mailcap file in your home directory (create one if you don't have one already):

	audio/midi; xterm -bg peachpuff1 -e timidity -OdM -s22 %s
If you have Motif and compiled timidity with the Motif interface enabled, use the following instead (not tested since I don't have Motif):

	audio/midi; timidity -im -OdM -s22 %s
Now start up your browser (or re-read the config files) and try some of the MIDI files in my Anime MIDI server! Note that not all servers are configured for delivering MIDI files with the correct audio/midi MIME type, which means that clicking on a .mid file on those servers won't launch your MIDI player but rather gives you junk. The only solution then would be to ask the server administrator of the site to enable the audio/midi MIME type. Fortunately, the Anime MIDI server is already configured correctly :)


FreeBSD with the VoxWare sound driver
HP-UX with HP network audio server
SunOS and Solaris with /dev/audio
Microsoft Windows NT or 95
MS-DOS with DJGPP
DEC OSF/1 with MMS support


For these systems, you can download TiMidity, patch and compile it if necessary, and follow the steps in the above section to configure your browser to use timidity as MIDI viewer.

For Windows users, if you have difficulty launching your MIDI player, have a look at midigate.


General MIDI-capable systems

If your computer is capable of playing MIDI files from the command line, then it's easy to configure your browser to play MIDI files from web pages. For UNIX users, if the command you use to play a MIDI file is say

	playmidi midifile.mid

then you just need to add the following line to the .mailcap file in your home directory (create one if you don't have it):

	audio/midi; playmidi %s

That's all there's to it! Now you can restart your browser (or re-read) the config files) and click on MIDI files to play them.

For non-UNIX users, you should be able to configure your browser by choosing the appropriate MIDI player as the helper application for audio/midi files. Details on how to do this can be found in the browser's help menu.





back to Ming's Anime MIDI server