Commit graph

46 commits

Author SHA1 Message Date
Simon Howard
8c0a4bc4c5 genmidi: Import DMXOPL instruments.
This is ConSiGno's OPL instrument patch table, found here:
<https://github.com/sneakernets/DMXOPL>

This is the result of many years' development and probably the
highest quality Doom OPL instrument set that's ever been developed. I've
obtained permission from ConSiGno to submit it to Freedoom, with the
following small omissions from the upstream version:

* Instrument 107 (Shamisen)
* Percussion 36 (Bass Drum 1)
* Percussion 69 (Cabasa)
* Percussion 76 (Hi Wood Block)
* Percussion 77 (Low Wood Block)

In doing due diligence I found that the patch data for these instruments
matched the patch data from Doom's GENMIDI table. Just to be
meticulously safe we'll keep the old versions of these (nothing, in the
case of the Cabasa). Other than these, every other instrument has been
replaced with a new patch.
2023-06-24 01:09:42 -04:00
Simon Howard
bf01cc746f genmidi: Disable OPL2 waveform checks.
Pretty much every Sound Blaster-compatible card used an OPL3 chip
(everything since the Sound Blaster 2 in October 1991) so it seems
reasonable to add this as a requirement. Because of the way that the new
waveforms are arranged in OPL3, it's a pretty graceful degradation if
they're used on an OPL2 anyway (see datasheet, page 14).
2023-06-24 01:07:50 -04:00
Simon Howard
a94ae50ffb genmidi: Better dumpgenmidi output.
This adds dumping for the tune= field that was just added in commit
276118107, but also:

* Instrument name gets put in a comment at the end of line - like the
  current configuration in config.py.
* Instrument calls get split across two lines when there are many
  parameters, to try to keep to 80 columns.
* off1= and off2= parameters now get outputted as +x or -x rather than
  just x or -x.
2023-06-24 00:50:53 -04:00
Simon Howard
ffb7348b8e genmidi: Strip instrument name trailing whitespace.
Some of the DMXGUS instrument names seem to have long sections of
whitespace like this, and we can clean it up while dumping.
2023-06-24 00:49:26 -04:00
Simon Howard
276118107b genmidi: Add tune= for setting fine tune field.
The fine tuning field was previously being hard-coded to the value of
128 with no option to change it. DMXGUS in particular makes use of this
field to tune individual instruments, so let's add proper support for
it.
2023-06-24 00:46:52 -04:00
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
Steven Elliott
b2ca8cbfde Organize .gitignore
Organize .gitignore by moving all patterns into a top level sorted
.gitignore file. With this change both "git status" and
"git-ls-ignore-index" should return cleanly. The later checks if any
files in the index are ignored.
2019-09-05 07:09:47 -05:00
Mike Swanson
4701d8f351 Blacken all Python files
Using the black code reformatter, pass it over all our Python files.
This allows for a consistent style across the code base.

Exception: lumps/dmxgus/stats.py, for readability.
2019-09-04 19:36:23 -07:00
Mike Swanson
eca25952ad make: use $(RM) for removing files
This is one of the built-in variables for Make and can increase
portability on different operating systems (eg, on Windows, the
built-in $(RM) may be defined as "del" instead of "rm -f").
2019-09-04 14:22:49 -07:00
Mike Swanson
2992e49262 lumps/genmidi: Rename README to *.adoc 2017-02-20 11:42:37 -08:00
Mike Swanson
c6235d6ffc Makefile: Make sure all built files are removed in make clean. 2017-02-19 12:22:57 -08:00
Mike Swanson
8835afef5f Copyright date bump and apply SPDX tags.
The tags are shorthand for the license of each file and avoid
copying the full license text into each one (and avoids having
to manually update the dates in each one...).
2017-02-15 16:41:53 -08:00
Mike Swanson
e081ac986f Change quotes in AsciiDoc to left/right Unicode versions
GitHub’s AsciiDoc parser barfs on the standard AsciiDoc syntax to
represent such characters with only ASCII…  Well, everybody should
support UTF‐8 these days.  Let’s just use these directly.
2016-09-03 15:37:48 -07:00
Simon Howard
758164748c genmidi: Remove old C code.
This is obsolete, and is only really kept around for posterity. The
code is already in the idgames archive as bsdmidi.zip.
2015-12-24 12:11:53 +01:00
Simon Howard
0324308f37 lumps: Eliminate symlinks for dmxgus/genmidi.
Get rid of the symlinks for these lumps by copying into the parent
directory after build. This brings more progress on #202.
2015-12-24 11:15:50 +01:00
Mike Swanson
90fd6b1686 Cleanup __pycache__ directories with "make clean" 2014-10-29 00:37:42 -07:00
Simon Howard
e47b69a064 genmidi: Update to support Python 3 build.
Tweak the code used to build the GENMIDI Lump so that it properly
supports Python 3 for build. Tested use cases were:
 * Normal build
 * a2i-to-sbi script to convert AdTrack2 instruments to SBI format
 * dumpgenmidi script to dump the instruments from a GENMIDI lump.
 * Running genmidi.py, sbi_file.py, a2i_file.py standalone to print the
   contents of files in their respective formats.
2014-10-28 03:55:22 +00:00
Simon Howard
dba8b84744 genmidi: Improve music for GOTHICDM MAP06.
This music sounded really horrible with Freedoom's GENMIDI lump, which
was a shame because this is a really beautiful level. So adjust a
couple of the more prominent instruments used for this music track:

 * Instrument 104 (Sci-fi):
   This instrument was using a frequency multiplier that put it 2
   octaves and a 5th above, making it (intentionally, because it's
   a "sci-fi" effect?) discordant. Rework this so that it isn't
   discordant any more.
 * Instrument 51 (SynthStrings #1):
   This had a slow attack phase which had the effect of offsetting
   the notes slightly, so that they seemed out of sync. Adjust this
   and also increase the feedback so that the instrument sounds more
   "stringy" (?)
2014-08-02 15:28:02 -04:00
Simon Howard
80b212d1b1 genmidi: Fix GENMIDI waveform warnings.
Some of the instruments were using OPL3 waveforms, but GENMIDI is
for OPL2 chips and these are not necessarily supported. Adjust the
instrument settings to only use the original four OPL2 waveforms,
while trying to maintain something resembling the same sound.
2014-08-01 23:31:49 -04:00
Simon Howard
b5d0a04088 Use print() for Python 3 compatibility.
This doesn't get everything working in Python 3 yet but it's a
start.
2014-02-04 02:12:50 +00:00
Fabian Greffrath
d9c9b315e6 Remove Python byte-code in the clean rule. 2014-01-20 13:06:50 +01:00
Mike Swanson
c47a48975e Remove .gitignore from the contents of a .gitignore 2014-01-06 21:33:41 -08:00
Simon Howard
f5f2a419b5 Offset (almost) all instruments down one octave.
With a couple of exceptions, the majority of OPL instruments sound
better when adjusted down by one octave. It seems likely that the
original BSD instruments were supposed to sound this way and we've
been playing the wrong notes all this time.
2013-01-22 23:10:21 +00:00
Simon Howard
b108fea226 genmidi: Fix waveform warnings for some instruments.
This tweaks some of the problem instruments to use only OPL2
waveforms, silencing the warnings and improving playback.
2012-01-07 00:15:02 +00:00
Simon Howard
04dd837169 genmidi: Pedantic fix to README
Thanks andrewj.
2012-01-04 16:54:48 +00:00
Simon Howard
ac1d81b4ff genmidi: Import remaining horncomposer changes.
This adds the remaining changes from horncomposer's modified version
of the old GENMIDI lump. Details from his accompanying text file
follow:

2/6/11- Replaced Electric Piano 2 (patch 5) - with the high pitched attack :)
        Replaced Acoustic Piano (patch 0) - Serves as model for other pianos
        Replaced Bright Acoustic Piano (patch 1)
        Replaced Electric Grand Piano (patch 2)
        Replaced Honky-tonk piano (patch 3) - Added "out of tune"
        Accidentally discovered a good Electic Piano 1 (patch 4) - with chorus
2012-01-04 04:57:14 +00:00
Simon Howard
13df5cd47b genmidi: Detect null instruments when dumping. 2012-01-04 04:18:06 +00:00
Simon Howard
507931694e genmidi: Add some missing percussion instruments.
This adds a good number of the missing percussion instruments. These
come from a dump of Matt Cadirao (horncomposer)'s modified version of
the old GENMIDI lump.
2012-01-04 04:15:37 +00:00
Simon Howard
b6b9cf999e genmidi: Output fixed_note as constant value.
Generate output that uses the more readable constants from midi.py instead
of just a MIDI note number.
2012-01-04 01:47:49 +00:00
Simon Howard
b0253e3176 genmidi: Add GENMIDI dump script.
Helper script to dump the contents of a GENMIDI file into separate
SBI files and a configuration matching the format of config.py.
2012-01-04 01:36:49 +00:00
Simon Howard
3b96d7f1de genmidi: Split off GENMIDI code into separate file.
Split out code for handling the GENMIDI format into a separate genmidi.py
file. Add routine to load the contents of a GENMIDI lump.
2012-01-04 01:20:38 +00:00
Simon Howard
85482928d5 genmidi: Add .gitignore file. 2012-01-03 17:26:33 +00:00
Simon Howard
a61d3c4d71 genmidi: Add README for instrument editing. 2012-01-03 17:25:22 +00:00
Simon Howard
3b14d8d1a0 genmidi: Add a2i-sbi conversion script.
Convenience script to convert a2i files to the more convenient
SBI format.
2012-01-03 00:52:12 +00:00
Simon Howard
d8d0b371b5 genmidi: Improve GENMIDI Makefile build. 2012-01-03 00:03:16 +00:00
Simon Howard
8249f55c3e genmidi: Hook GENMIDI script into build. 2012-01-03 00:03:16 +00:00
Simon Howard
3fb0fdac05 genmidi: Add script to make GENMIDI lump. 2012-01-03 00:03:16 +00:00
Simon Howard
e10f006a71 genmidi: Add option for note offset. 2012-01-03 00:03:16 +00:00
Simon Howard
9071466be9 genmidi: Add copyright headers to Python files. 2012-01-03 00:03:15 +00:00
Simon Howard
c029a423d4 genmidi: Add constants for MIDI notes.
Constant definitions for MIDI notes, so that instrument definitions do
not need to use meaningless numbers.
2012-01-03 00:03:15 +00:00
Simon Howard
a21e76c70c genmidi: Add config file for GENMIDI builder.
Config lists the instrument files to use to build the GENMIDI lump.
Some instruments are not yet provided and are nulled out using a dummy
SBI file that doesn't play anything.
2012-01-03 00:03:15 +00:00
Simon Howard
1eabaa74cd genmidi: Add dumped instrument patches.
Split out OpenBSD OPL instrument patches into separate SBI files.
These can then be individually edited and compiled into a full GENMIDI
lump.
2012-01-03 00:03:15 +00:00
Simon Howard
b754214379 genmidi: Move GENMIDI C code to subdirectory.
Move C code into subdirectory as it will soon be only of historical
interest. Add extra program to dump SBI instrument patches, switch
to using OPL2 instruments, and ignore "null" instruments (all-zero).
2012-01-03 00:03:15 +00:00
Simon Howard
5ce7690612 genmidi: Add Python code for reading OPL instruments.
These files load OPL instrument data from SBI (SoundBlaster Instrument)
or A2I (AdlibTracker2 Instrument) format files.
2012-01-03 00:03:06 +00:00
Mike Swanson
654981d5c2 lumps/genmidi: Update OpenBSD-derived code to newer license
Signed-off-by: Mike Swanson <mikeonthecomputer@gmail.com>
2008-12-17 18:17:31 -08:00
Simon Howard
be0cd445a2 Add code to generate a GENMIDI lump using the register values from the OpenBSD OPL driver. 2007-12-28 20:33:22 +00:00