![]() |
A game programming library |
|
|
Hosted by: Project page |
MIDI patch setsThe DIGMID wavetable music driver needs a set of instrument samples, which can either be in the GUS patch or SoundFont 2.0 formats. GUS patches can be read directly from disk or converted into a single patches.dat file with the pat2dat utility. SoundFont banks must be converted prior to use. A GUS patch set consists of around 180 .pat instrument files, plus a default.cfg index file listing which patch goes with each MIDI program number. To use these files directly, point the "patches=" line in your allegro.cfg at the default.cfg file. To convert them into the patches.dat format, run "pat2dat -o patches.dat samplepath.cfg -8", and then copy the resulting patches.dat into either the same directory as your program, the location pointed to by the ALLEGRO environment variable, or the location specified by the "patches=" line in your allegro.cfg. A SoundFont bank consists of a single .sf2 (SoundFont 2.0) file. Allegro cannot read the older .sbk (version 1.x) format, but there is a utility to convert such files: see the links below. The SoundFont should contain a set of GM instruments on bank 0, presets 0-127, and a GM drumkit on bank 128, preset 0 (this will be true for anything described as GM or GS compatible). It is possible to convert non-GM files as well (pat2dat has an option to grab samples from any bank you specify), but obviously the results will only work with MIDI files that were specifically written for those instruments. Some SoundFont banks make use of the AWE32 ROM samples, which are not available to Allegro, so it is only possible to convert instruments that include all their sample data within the SoundFont. To convert a SoundFont into the patches.dat format, run "pat2dat -o patches.dat filename.sf2 -8", and then copy the resulting patches.dat into either the same directory as your program, the location pointed to by the ALLEGRO environment variable, or the location specified by the "patches=" line in your allegro.cfg. It is very easy to customise a GUS format patch set. You can either just copy new instruments over the top of the existing .pat files, or edit the default.cfg index to use different patches. If you want to modify a SoundFont bank, you must first convert it into the patches.dat format, which can be edited using the grabber. Each instrument is stored as a seperate object, so you can export them to .pat files, import from other files, move them around, rename them, etc. The patches.dat also contains a default_cfg index object in the standard GUS format, so you can edit this to use different samples (in particular you can list a single instrument for multiple program numbers, so for example you could use a single brass sample for the trumpet/trombone/tuba/horn/etc, if you are trying to reduce the size of your sample set). I am no lawyer, and I didn't make any of the patch sets listed below, so I can't tell you what the copyright situation with these samples is. Apart from the Emu bank, I think you are probably quite safe to redistribute them with a freeware game, but I would be very careful about using them in commercial products. It may be possible, but check the details first. I can't give any guarantee about the legality of these files...
|