freedoom/lumps/dmxgus
Mike Swanson 6eef9be73a use python3 only for building
Python 2 is very near end-of-life, and Python3-compatible changes to a
few scripts introduced compatibility problems with 2.7 again.  It went
unnoticed for me since my system symlinks "python" to "python3", but
it broke the build on systems where that symlink is still python2.  At
this point in time, I feel it is worth targetting modern Python and
forgetting about 2.7.
2019-09-06 14:43:50 -07:00
..
comparison.py Blacken all Python files 2019-09-04 19:36:23 -07:00
config.py Blacken all Python files 2019-09-04 19:36:23 -07:00
gather_stats.py use python3 only for building 2019-09-06 14:43:50 -07:00
gen-ultramid use python3 only for building 2019-09-06 14:43:50 -07:00
Makefile make: use $(RM) for removing files 2019-09-04 14:22:49 -07:00
README dmxgus: Tweak similarity groups for main instruments. 2014-01-31 05:40:13 +00:00
stats.py

The script in this directory generates the GUS config file
(ultramid.ini) which is included in the IWAD as a lump named DMXGUS or
DMXGUSC.

The GUS config is mostly obsolete nowadays but it's still nice to
include anyway. The challenge is that each GUS card has a limited
amount of memory (256, 512, 768 or 1024KB). The GUS drivers come with
a complete set of patch files for all the General MIDI instruments,
but there is never enough RAM to fit all of them into the card's
memory. Patches must therefore be reused for multiple similar-sounding
instruments.

The config file looks like this (short extract):

    31, 24, 31, 31, 31, gtrharm
    32, 39, 32, 32, 32, acbass
    33, 39, 33, 33, 33, fngrbass
    34, 39, 34, 34, 34, pickbass

The second to fifth columns are the configurations for different
memory sizes.  In this example, instrument 31 reuses instrument 24's
patch for the 256KB configuration, but in the 512KB configuration
there is enough space to load it properly.

The DMXGUS lumps used in the original Doom IWADs did not have a great
deal of attention paid to them, which lead some people to develop
optimized config files (see eg. GUS1M.WAD in idgames). The approach
taken here is to generate the configuration programatically:
statistics have been gathered about the use of different instruments
by analyzing the music found in various well-known WAD files. This is
used to prioritize which patches to load.

The generated config is now pretty good, though it might still be
possible to improve it. To improve the config, the best thing to
tweak is the similarity groups in config.py.