Article: Playing MIDI files using custom soundfonts

Methods of playing MIDI files using custom soundbanks, without the use of a music sequencing application.

Tags: Audio, MIDI

Contents

Background

Back in the 90’s, MIDI was at the peak of its popularity. The format was favoured due to its relatively low computational overhead, which suited the limited hardware of the day, as well as the small filesizes that made it ideal for transferring over the internet.

However, the nature of MIDI somewhat limited the potential of the format, since composers had no control over what end users actually heard. The final sound depended on the soundbanks (collections of pre-recorded samples) that the user’s synthesiser or sound card used for playback, which were often low-quality and rarely sounded the same as those used by the composer.

In order to extend the format’s potential and facilitate better results, several organisations worked on developing file formats that would allow composers to create their own custom soundbanks, which could then be loaded by MIDI synthesisers, to ensure the end user heard exactly what the composer had intended.

This solution offered increased flexibility, and was actually rather reminiscent of module music, a format which contained samples and instrument instructions in the one file (and which I happen to have a bit of a soft spot for, see my article on MOD music.)

Though several different formats of soundbanks surfaced, the two notable formats are Creative’s SoundFont and MMA’s Downloadable Sounds (DLS). SoundFont took off and gained a large following, whereas DLS, which never gained any sizeable momentum, is ironically the format supported natively by the synthesisers built into both Windows and Mac OS X.

Solution Applies To…

The SoundFont format, due to its popularity, is well supported by the open source community, and can be utilised under most operating systems.

However, as far as DLS goes, you’re stuck with using Windows or Mac OS X. I’ve been unable to find a cross-platform solution that supports DLS files, so Linux users will have to stick to SoundFont files.

Cross-Platform Solution for SoundFont files

If you want to play MIDI files with SoundFont soundbanks, it’s easy to do so using the excellent cross-platform VLC Media Player, which utilises the FluidSynth library to do the synthesising. As it turns out, VLC is actually incapable of playing MIDI files without first loading a SoundFont, so these instructions may already be familiar to you if you’re a VLC user:

If VLC isn’t your cup of tea, or you want to enable MIDI playback for all applications under Linux, SoundFont files are also supported by the somewhat less user-friendly Timidity++, which can be configured as a local MIDI server. There are some instructions here.

Both of these applications can output to a file, so either one can be used for converting MIDI files.

QuickTime under Mac OS X or Windows

Apple’s QuickTime, available under Windows and Mac OS X, supports both SoundFont and DLS files for the synthesis of MIDI files. Better yet, since iTunes utilises QuickTime and also has a feature to convert MIDI files, by changing the soundbank used by QuickTime you are changing the soundbank used by iTunes for MIDI conversion.

These instructions are simplified from those found here, which covers this topic fairly well.

Bear in mind that the soundbank(s) will be listed by the name embedded in the file, not the filename itself, so soundbanks that have no embedded name information may just show up as ‘Instrument Set’.

Incidentally, it seems that QuickTime can have difficulties with certain soundbanks. When attempting to perform these steps under Windows with a couple of the soundbanks I had on hand, using a SoundFont file from HammerSound produced no sound, whilst using one of my DLS files actually crashed the QuickTime player. (Attempting to convert a MIDI file using iTunes yielded the same results, as expected.)

In order to confirm that it was my soundbank files that were the culprit, I copied GM.DLS (the default Windows MIDI soundbank) to the QuickTime folder, and when using that everything worked fine. Based on this, all I can say is that your mileage may vary.

Windows-only Solution #1: Winamp MIDI Plugin and DirectSound

The Windows-only media player Winamp has a plugin to enable MIDI input. The plugin is bundled with the player, but needs to be explicitly enabled during the installation process.

Once the player is installed with the MIDI plugin enabled, only two settings need to be modified in the plugin’s configuration dialog:

The settings will take effect after restarting playback. When combined with a file writer output plugin, this makes Winamp a useful MIDI converter.

Windows-only Solution #2: Sound Card-specific Utilities

This solution depends entirely on the software available for your specific sound card. As such, the Winamp solution is preferred. The details I have provided here are those specific to the sound card in my computer. Though I have heard of similar utilities for other cards, I have been unable to investigate them.

In the case of my laptop, the sound card was listed under Device Manager as SoundMAX Digital Audio. A quick search online yielded a number of references to a utility to load DLS files, that was supposed to be bundled with the card’s driver. The SoundMAX DLS Loader utility was not included in the preinstalled software on my machine, so I grabbed an installer from the Helwett Packard website that included it.

Installing the SoundMAX control panel applet from the HP website broke the existing applet instead of replacing it, but otherwise appeared to have no negative effects on audio playback or the system overall. The DLS Loader utility allows you to select a MIDI file and a DLS file, and then opens Windows Media Player to perform the playback. As long as the DLS Loader window is still open, the DLS soundbank will be used when playing back all MIDI files through Windows Media Player.

In addition to playing back MIDI files with the loaded soundbank whilst the DLS Loader is still open, files in the obscure RMID format (which contains both MIDI and DLS data in the one file) will also work in Windows Media Player, alleviating the need to switch soundbanks when playing different files. I whipped up a quick utility that combines MIDI and DLS files into RMID files, which allowed me to enjoy the full benefit of this feature.

The only way to convert MIDI files using this method is to record your system’s audio output using a program like Audacity, which can be somewhat cumbersome.

Mobile Applications

The following Android applications support MIDI playback using custom SoundFont files, either from a MIDI file or from a hardware keyboard:

Conclusion

Ultimately, the DLS format just didn’t become mainstream enough to garner as much support as SoundFont. It does seem a little bizarre that it became the native format for the Windows and Mac OS X inbuilt synthesisers, but that could quite possibly have resulted from licensing agreements more so than popularity. Regardless of the reason, if you’re a user of one of those platforms, feel free to enjoy all the DLS you can get (which is very little.)

The main lesson here would probably be to stick to SoundFont files where possible, because that way you’ll be set, regardless of platform.

Resources

Info:

Software: