mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-01 04:25:45 -04:00
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. |
||
---|---|---|
.. | ||
comparison.py | ||
config.py | ||
gather_stats.py | ||
gen-ultramid | ||
Makefile | ||
README | ||
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.