From a1608b3fc3e87d21b840dd0dd7eb1cc0df3ccef4 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 9 Jan 2012 22:30:38 +0000 Subject: [PATCH] dmxgus: Add first attempt at GUS config. This is a functioning (but awful) configuration file for the Gravis Ultrasound card, which is usually stored in the IWAD as DMXGUS / DMXGUSC. I constructed this by hand, and at least it's better than nothing. Also included is a sanity check script that checks the configuration will fit in the memory limits of the card. --- buildcfg.txt | 8 +- lumps/dmxgus.lmp | 1 + lumps/dmxgus/check.py | 170 +++++++++++++++++++++++++++ lumps/dmxgus/ultramid.ini | 239 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 416 insertions(+), 2 deletions(-) create mode 120000 lumps/dmxgus.lmp create mode 100755 lumps/dmxgus/check.py create mode 100644 lumps/dmxgus/ultramid.ini diff --git a/buildcfg.txt b/buildcfg.txt index 15d84512..3e8e60d4 100644 --- a/buildcfg.txt +++ b/buildcfg.txt @@ -173,11 +173,15 @@ PLAYPAL COLORMAP ENDOOM GENMIDI -;DMXGUS -;DMXGUSC FREEDOOM DEHACKED +#ifdef DOOM2 +DMXGUSC = dmxgus +#else +DMXGUS +#endif + #ifdef DOOM2 DEMO1 = demo1_d2 diff --git a/lumps/dmxgus.lmp b/lumps/dmxgus.lmp new file mode 120000 index 00000000..7d7da43f --- /dev/null +++ b/lumps/dmxgus.lmp @@ -0,0 +1 @@ +dmxgus/ultramid.ini \ No newline at end of file diff --git a/lumps/dmxgus/check.py b/lumps/dmxgus/check.py new file mode 100755 index 00000000..a395cabb --- /dev/null +++ b/lumps/dmxgus/check.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python +# +# Copyright (c) 2012 +# Contributors to the Freedoom project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the freedoom project nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# +# Sanity check script for DMXGUS lump. +# Please run this script after making any changes to ultramid.ini. +# + +import sys +import re + +# These are the sizes (in bytes) of the patch files distributed +# with the GUS drivers. Having these means we can calculate the +# size in RAM (roughly) of the patch set for a given configuration +# and check it is within the limit. + +GUS_PATCH_SIZES = { + "acbass": 10829, "accordn": 19623, "acguitar": 52581, + "acpiano": 65259, "agogo": 27727, "agogohi": 7283, + "agogolo": 7283, "altosax": 11711, "applause": 60449, + "atmosphr": 63035, "aurora": 62503, "bagpipes": 16057, + "banjo": 64523, "barisax": 21739, "basslead": 53389, + "bassoon": 16723, "belltree": 64103, "blank": 3367, + "bongohi": 7233, "bongolo": 9201, "bottle": 25063, + "bowglass": 49691, "britepno": 72739, "cabasa": 17203, + "calliope": 46303, "carillon": 12089, "castinet": 12349, + "celeste": 20207, "cello": 18741, "charang": 90661, + "chiflead": 63381, "choir": 45353, "church": 4609, + "claps": 11719, "clarinet": 19161, "clave": 5035, + "clavinet": 3443, "cleangtr": 46027, "concrtna": 17981, + "congahi1": 8753, "congahi2": 9713, "congalo": 9713, + "contraba": 9723, "cowbell": 6645, "crystal": 60783, + "cuica1": 18995, "cuica2": 26017, "cymbell": 34815, + "cymchina": 48545, "cymcrsh1": 63353, "cymcrsh2": 62411, + "cymride1": 35655, "cymride2": 35655, "cymsplsh": 63353, + "distgtr": 38249, "doo": 17333, "echovox": 30287, + "englhorn": 24675, "epiano1": 15005, "epiano2": 44191, + "fantasia": 47229, "fiddle": 12309, "flute": 12383, + "fngrbass": 19797, "frenchrn": 28635, "freshair": 58307, + "fretless": 5605, "fx-blow": 57693, "fx-fret": 27631, + "ghostie": 63301, "glocken": 10695, "gtrharm": 10173, + "guiro1": 8561, "guiro2": 18821, "halopad": 60291, + "harmonca": 15301, "harp": 23927, "helicptr": 50327, + "highq": 3945, "hihatcl": 9453, "hihatop": 40417, + "hihatpd": 3925, "hitbrass": 63369, "homeorg": 2301, + "honky": 131905, "hrpschrd": 7709, "jazzgtr": 55923, + "jingles": 34219, "jungle": 27541, "kalimba": 4739, + "kick1": 9411, "kick2": 10377, "koto": 42079, + "lead5th": 13233, "maracas": 9433, "marcato": 122881, + "marimba": 4447, "metalpad": 60905, "metbell": 539, + "metclick": 539, "musicbox": 30947, "mutegtr": 34577, + "mutetrum": 19019, "nyguitar": 39211, "oboe": 9269, + "ocarina": 3537, "odguitar": 25845, "orchhit": 28751, + "percorg": 15435, "piccolo": 8945, "pickbass": 33213, + "pistol": 36595, "pizzcato": 40173, "polysyn": 60759, + "recorder": 5647, "reedorg": 3471, "revcym": 27391, + "rockorg": 60887, "santur": 43833, "sawwave": 54485, + "scratch1": 9091, "scratch2": 4883, "seashore": 62407, + "shakazul": 62589, "shaker": 6527, "shamisen": 26667, + "shannai": 20151, "sitar": 36979, "slap": 12031, + "slapbas1": 56133, "slapbas2": 41581, "slowstr": 36717, + "snare1": 17417, "snare2": 8503, "soundtrk": 40091, + "sprnosax": 14713, "sqrclick": 539, "sqrwave": 30439, + "startrak": 55085, "steeldrm": 24229, "stickrim": 6005, + "sticks": 8757, "surdo1": 19527, "surdo2": 19527, + "sweeper": 62745, "synbass1": 12627, "synbass2": 6191, + "synbras1": 61735, "synbras2": 60641, "synpiano": 11543, + "synstr1": 62763, "synstr2": 33165, "syntom": 61331, + "taiko": 37671, "tamborin": 18219, "telephon": 9157, + "tenorsax": 17367, "timbaleh": 10839, "timbalel": 19787, + "timpani": 14473, "tomhi1": 13467, "tomhi2": 13455, + "tomlo1": 13455, "tomlo2": 19527, "tommid1": 13455, + "tommid2": 13455, "toms": 13467, "tremstr": 122881, + "triangl1": 4781, "triangl2": 31901, "trombone": 26187, + "trumpet": 13621, "tuba": 11847, "tubebell": 18637, + "unicorn": 60505, "vibes": 21597, "vibslap": 19247, + "viola": 56465, "violin": 25061, "voices": 30287, + "voxlead": 30289, "warmpad": 36491, "whistle": 12053, + "whistle1": 4315, "whistle2": 2173, "woodblk": 7685, + "woodblk1": 5035, "woodblk2": 7685, "woodflut": 4191, + "xylophon": 19085 +} + +def patches_for_mapping(patches, mapping): + result = {} + + for pnum in mapping.values(): + patch = patches[pnum] + result[patch] = True + + return sorted(result.keys()) + +def patch_set_size(patch_set): + result = 0 + + for patch in patch_set: + result += GUS_PATCH_SIZES[patch] + + return result + +def print_patch_set(title, patch_set): + print "%s:" % title + + for patch in patch_set: + print "\t%-8s %i" % (patch, GUS_PATCH_SIZES[patch]) + + print "\t" + ("-" * 30) + print "\t%-8s %i" % ("TOTAL", patch_set_size(patch_set)) + +patches = {} +mappings = [ {}, {}, {}, {} ] + +f = open("ultramid.ini") + +for line in f: + line = line.strip() + if line.startswith("#"): + continue + + fields = re.split(r"\s*,\s*", line) + + instr = int(fields[0]) + patches[instr] = fields[5] + + for i in range(4): + mappings[i][instr] = int(fields[i + 1]) + +f.close() + +# Check mappings: + +MAPPING_SIZES = [ 256, 512, 768, 1024 ] + +for i in range(4): + patch_set = patches_for_mapping(patches, mappings[i]) + + if patch_set_size(patch_set) > MAPPING_SIZES[i] * 1024: + print >> sys.stderr, \ + "ERROR: Configuration for %iKB exceeds %iKB" % \ + (MAPPING_SIZES[i], MAPPING_SIZES[i]) + print_patch_set(MAPPING_SIZES[i], patch_set) + sys.exit(-1) + diff --git a/lumps/dmxgus/ultramid.ini b/lumps/dmxgus/ultramid.ini new file mode 100644 index 00000000..126e4c44 --- /dev/null +++ b/lumps/dmxgus/ultramid.ini @@ -0,0 +1,239 @@ +# Copyright (c) 2012 +# Contributors to the Freedoom project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the freedoom project nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# +# GUS patch mappings. +# +# This is a *terrible* configuration file. I threw it together in an +# hour just so that Freedoom would have a DMXGUS lump. It's based on +# inaccurate stereotypes, ignorance of musical instruments and wild +# guesses. So if you think you can improve it, feel free to do so. +# If you are a musician and are annoyed by this awful configuration +# or the comments within it, YHBT :-) +# +# Designed to use as few patches as possible to fit within a GUS +# with 256K of RAM, but no attempt has been made to improve this for +# the higher configurations! +# +# +# GM 256K 512K 768K 1024K patch name +#------------------------------------------------ +# "All pianos sound the same, right?" +0, 2, 2, 2, 2, acpiano +1, 2, 2, 2, 2, britepno +2, 2, 2, 2, 2, synpiano +3, 2, 2, 2, 2, honky +4, 2, 2, 2, 2, epiano1 +5, 2, 2, 2, 2, epiano2 +6, 2, 2, 2, 2, hrpschrd +7, 2, 2, 2, 2, clavinet +8, 2, 2, 2, 2, celeste +9, 2, 2, 2, 2, glocken +# Xylophone etc. +10, 13, 13, 13, 13, musicbox +11, 13, 13, 13, 13, vibes +12, 13, 13, 13, 13, marimba +13, 13, 13, 13, 13, xylophon +14, 13, 13, 13, 13, tubebell +15, 13, 13, 13, 13, santur +# "Organ? You mean like in a church?" +16, 16, 16, 16, 16, homeorg +17, 16, 16, 16, 16, percorg +18, 16, 16, 16, 16, rockorg +19, 16, 16, 16, 16, church +20, 16, 16, 16, 16, reedorg +21, 16, 16, 16, 16, accordn +22, 16, 16, 16, 16, harmonca +23, 16, 16, 16, 16, concrtna +# "Any guitar, I just want to be a rock star" +24, 30, 30, 30, 30, nyguitar +25, 30, 30, 30, 30, acguitar +26, 30, 30, 30, 30, jazzgtr +27, 30, 30, 30, 30, cleangtr +28, 30, 30, 30, 30, mutegtr +29, 30, 30, 30, 30, odguitar +30, 30, 30, 30, 30, distgtr +31, 30, 30, 30, 30, gtrharm +# Bass: +32, 35, 35, 35, 35, acbass +33, 35, 35, 35, 35, fngrbass +34, 35, 35, 35, 35, pickbass +35, 35, 35, 35, 35, fretless +36, 35, 35, 35, 35, slapbas1 +37, 35, 35, 35, 35, slapbas2 +38, 35, 35, 35, 35, synbass1 +39, 35, 35, 35, 35, synbass2 +# Violin: +40, 40, 40, 40, 40, violin +41, 40, 40, 40, 40, viola +42, 40, 40, 40, 40, cello +43, 40, 40, 40, 40, contraba +44, 40, 40, 40, 40, tremstr +45, 40, 40, 40, 40, pizzcato +46, 40, 40, 40, 40, harp +47, 40, 40, 40, 40, timpani +# Strings: +48, 55, 55, 55, 55, marcato +49, 55, 55, 55, 55, slowstr +50, 55, 55, 55, 55, synstr1 +51, 55, 55, 55, 55, synstr2 +52, 55, 55, 55, 55, choir +53, 55, 55, 55, 55, doo +54, 55, 55, 55, 55, voices +55, 55, 55, 55, 55, orchhit +# Trumpet: +56, 56, 56, 56, 56, trumpet +57, 56, 56, 56, 56, trombone +58, 56, 56, 56, 56, tuba +59, 56, 56, 56, 56, mutetrum +60, 56, 56, 56, 56, frenchrn +61, 56, 56, 56, 56, hitbrass +62, 56, 56, 56, 56, synbras1 +63, 56, 56, 56, 56, synbras2 +# Reed: +64, 71, 71, 71, 71, sprnosax +65, 71, 71, 71, 71, altosax +66, 71, 71, 71, 71, tenorsax +67, 71, 71, 71, 71, barisax +68, 71, 71, 71, 71, oboe +69, 71, 71, 71, 71, englhorn +70, 71, 71, 71, 71, bassoon +71, 71, 71, 71, 71, clarinet +# Pipe. Same thing as reed, right? +72, 71, 71, 71, 71, piccolo +73, 71, 71, 71, 71, flute +74, 71, 71, 71, 71, recorder +75, 71, 71, 71, 71, woodflut +76, 71, 71, 71, 71, bottle +77, 71, 71, 71, 71, shakazul +78, 71, 71, 71, 71, whistle +79, 71, 71, 71, 71, ocarina +# "Lead? You mean a lead guitar, right?" +80, 30, 30, 30, 30, sqrwave +81, 30, 30, 30, 30, sawwave +82, 30, 30, 30, 30, calliope +83, 30, 30, 30, 30, chiflead +84, 30, 30, 30, 30, charang +85, 30, 30, 30, 30, voxlead +86, 30, 30, 30, 30, lead5th +87, 30, 30, 30, 30, basslead +# Nobody really uses this shit: +88, 128, 128, 128, 128, fantasia +89, 128, 128, 128, 128, warmpad +90, 128, 128, 128, 128, polysyn +91, 128, 128, 128, 128, ghostie +92, 128, 128, 128, 128, bowglass +93, 128, 128, 128, 128, metalpad +94, 128, 128, 128, 128, halopad +95, 128, 128, 128, 128, sweeper +96, 128, 128, 128, 128, aurora +97, 128, 128, 128, 128, soundtrk +98, 128, 128, 128, 128, crystal +99, 128, 128, 128, 128, atmosphr +100, 128, 128, 128, 128, freshair +101, 128, 128, 128, 128, unicorn +102, 128, 128, 128, 128, echovox +103, 128, 128, 128, 128, startrak +# Lazy guesses at things these sound like: +104, 30, 30, 30, 30, sitar +105, 30, 30, 30, 30, banjo +106, 30, 30, 30, 30, shamisen +107, 30, 30, 30, 30, koto +108, 13, 13, 13, 13, kalimba +109, 71, 71, 71, 71, bagpipes +110, 71, 71, 71, 71, fiddle +111, 71, 71, 71, 71, Shannai +# Percussion. +112, 171, 171, 171, 171, carillon +113, 171, 171, 171, 171, agogo +114, 163, 163, 163, 163, steeldrm +115, 171, 171, 171, 171, woodblk +116, 163, 163, 163, 163, taiko +117, 174, 174, 174, 174, toms +118, 174, 174, 174, 174, syntom +119, 178, 178, 178, 178, revcym +# No. +120, 128, 128, 128, 128, fx-fret +121, 128, 128, 128, 128, fx-blow +122, 128, 128, 128, 128, seashore +123, 128, 128, 128, 128, jungle +124, 128, 128, 128, 128, telephon +125, 128, 128, 128, 128, helicptr +126, 128, 128, 128, 128, applause +127, 128, 128, 128, 128, pistol +128, 128, 128, 128, 128, blank +# Every percussion instrument ever invented is one of either: +# cymbal, tom, bass drum, snare or hi-hat. Everything else is +# just a variant on these themes. Correct? +162, 163, 163, 163, 163, kick1 +163, 163, 163, 163, 163, kick2 +164, 165, 165, 165, 165, stickrim +165, 165, 165, 165, 165, snare1 +166, 165, 165, 165, 165, claps +167, 165, 165, 165, 165, snare2 +168, 174, 174, 174, 174, tomlo2 +169, 171, 171, 171, 171, hihatcl +170, 174, 174, 174, 174, tomlo1 +171, 171, 171, 171, 171, hihatpd +172, 174, 174, 174, 174, tommid2 +173, 171, 171, 171, 171, hihatop +174, 174, 174, 174, 174, tommid1 +175, 174, 174, 174, 174, tomhi2 +176, 178, 178, 178, 178, cymcrsh1 +177, 174, 174, 174, 174, tomhi1 +178, 178, 178, 178, 178, cymride1 +179, 178, 178, 178, 178, cymchina +180, 178, 178, 178, 178, cymbell +181, 165, 165, 165, 165, tamborin +182, 178, 178, 178, 178, cymsplsh +183, 171, 171, 171, 171, cowbell +184, 178, 178, 178, 178, cymcrsh2 +185, 165, 165, 165, 165, vibslap +186, 178, 178, 178, 178, cymride2 +187, 165, 165, 165, 165, bongohi +188, 165, 165, 165, 165, bongolo +189, 163, 163, 163, 163, congahi1 +190, 163, 163, 163, 163, congahi2 +191, 163, 163, 163, 163, congalo +192, 165, 165, 165, 165, timbaleh +193, 165, 165, 165, 165, timbalel +194, 171, 171, 171, 171, agogohi +195, 171, 171, 171, 171, agogolo +196, 171, 171, 171, 171, cabasa +197, 165, 165, 165, 165, maracas +198, 171, 171, 171, 171, whistle1 +199, 171, 171, 171, 171, whistle2 +200, 171, 171, 171, 171, guiro1 +201, 171, 171, 171, 171, guiro2 +202, 163, 163, 163, 163, clave +203, 165, 165, 165, 165, woodblk1 +204, 165, 165, 165, 165, woodblk2 +205, 171, 171, 171, 171, cuica1 +206, 171, 171, 171, 171, cuica2 +207, 171, 171, 171, 171, triangl1 +208, 171, 171, 171, 171, triangl2