Age | Commit message (Collapse) | Author |
|
Formatting, variable names, don't pollute global variable namespace.
|
|
Older DMX's OPL voice allocation algorithm
|
|
Prefer replacing a second voice before a voice from a higher-
numbered channel. This resolves some issues with the MAP01 music,
as noted in comments on #468; it may not be Vanilla behavior in
terms of code but seems to better match it based on observation,
and makes logical sense.
Also adjust code to fit to the 80 column limit.
|
|
|
|
differ. This commit adds old DMX's voice allocating alogrithm for Hexen and Heretic.
|
|
Eliminate tab characters and trailing whitespace. Add extra
whitespace around operators in for() expressions.
|
|
opl note limitation and octave overflow fixes
Adjust how the OPL MIDI code behaves at extreme MIDI note values
(high/low octaves) to better match how the Doom DMX library decides
on the OPL register value (thanks Alexey Khokholov / khokh20010.
|
|
opl additive voice volume calculation fix
Adjust how the OPL volume register values are calculated based on the
channel, note and global MIDI volume, to better match how the Doom
DMX library performs these calculations (thanks Alexey Khokholov /
khokh2001).
|
|
MIDI uses channel 9 for percussion but MUS uses channel 15. As the
channel numbers matter when we run out of free voices (#468),
internally swap channels 9 and 15 so that channel precedence is
decided correctly.
|
|
opl additive voice volume calculation fix
|
|
|
|
Fix voice allocation when there are no more free voices. This fixes a
long-standing (but minor) discrepancy between the OPL code and the DMX
library that was marked in the code with a TODO.
|
|
opl voice allocation fix when there are no free voices
|
|
fixed note drum instrument should be 60
|
|
|
|
opl additive voice volume calculation fix
|
|
It turns out that the way that tempo has been calculated in OPL playback
has been broken for a long time. The mysterious "fudge factor" that I
had to apply to tempo calculations is actually completely unnecessary:
the byte-swapping in the MIDI_GetFileTimeDivision() function was being
done wrong, so the time division being used by the OPL MIDI code was
completely wrong. Presumably the multiply by 260 was close enough to an
8-bit bitshift that it worked okayish, but large enough time division
values would overflow a single byte and screw up.
This fixes long-running OPL playback problems in a number of WADs, most
notably Alien Vendetta. This *really* fixes #352.
|
|
The Doom II MAP14/MAP20 music has a hanging note at the end of the
track that is never turned off. If this is not reset when the track
loops, there is a continuous (and annoying) drone sound throughout
the next iteration of the song. Some information is here:
http://www.doomworld.com/vb/source-ports/66802-the-d-ddtblu-disease/
This changes the mus2mid code to generate an "all notes off"
controller event at the start of the MIDI track. This is specifically
done at the start and not the end of the track because otherwise the
looping of tracks like D_RUNNING is affected.
Thanks to a whole host of people for help on this: @plumsinus for
reporting the bug, @bradharding for devising a fix as part of Doom
Retro, and Quasar for feedback and his own fix to the Eternity Engine.
This fixes #412.
|
|
Multi-track MIDI files are played back using separate callback chains
for each track, and this introduces the possibility of one track
becoming out of sync with the others. This was noticeable in WADs
that use multi-track MIDIs, such as Alien Vendetta. Increase the
timing resolution to microsecond precision to fix this.
|
|
When the tempo is changed, the times on all active timers must be
adjusted to match the new timing values. Add an API to do this and
invoke it when a tempo change meta event is read.
|
|
The MIDI format includes a special meta event to set the tempo of
playback, and some WADs depend on this - notably the music in Alien
Vendetta. Move the variables controlling tempo to the global scope
(they are not per-track as I previously thought) and set when the
tempo events are encountered.
This is some progress towards resolving #334, but that bug is not
yet completely fixed, because the tempo change does not
retroactively apply to OPL timers that have already been set.
|
|
Some MIDI files, such as the music tracks in AV.wad, use a second
"key on" event with a volume of zero to mean "key off". Handle this
case correctly.
|
|
This change rewrites and simplifies the copyright headers at the top
of all source files:
* Remove "Emacs style mode select" line; this line was included in
the headers for the originally released source files and appears
to be to set the file type for old versions of Emacs. I'm not sure
entirely why it was required but I don't think it is any more.
* Remove "You should have received a copy of..." text from copyright
header. This refers to the old 59 Temple Place address where the
FSF headquarters used to be located and is no longer correct.
Rather than change to the new address, just remove the paragraph
as it is superfluous anyway. This fixes #311.
* Remove ---- separator lines so that the file headers are barer
and more simplified.
|
|
The previous change to add the poll method to the music module
interface introduced a crash, as the OPL music struct does not
define a poll method.
|
|
The Windows API has an _snprintf function that is not the same as
Unix's snprintf(): if the string is truncated then no trailing NUL
character is appended. This makes the function unsafe. Define a
replacement/wrapper called M_snprintf that works the same but always
appends a trailing NUL, for safety on Windows and other OSes that
behave like this.
Do the same thing for vsnprintf(), and update HACKING to list
snprintf/vsnprintf as forbidden functions. This fixes #375;
thanks to Quasar for pointing out the different behavior of these
functions.
|
|
As part of this, add DIR_SEPARATOR_S as a string version of the
DIR_SEPARATOR macro. Change M_TempFile() to return a string allocated
on the C heap rather than the zone heap.
This is a first step towards fixing #371.
|
|
Subversion-branch: /branches/v2-branch
Subversion-revision: 2639
|
|
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2607
|
|
Subversion-branch: /branches/v2-branch
Subversion-revision: 2537
|
|
for GENMIDI development.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2482
|
|
Subversion-branch: /branches/raven-branch
Subversion-revision: 2347
|
|
Alexandre Xavier).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2313
|
|
Subversion-branch: /branches/raven-branch
Subversion-revision: 1924
|
|
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1913
|
|
voice of a two voice instrument. Don't discard instruments from lower
numbered MIDI channels for higher numbered MIDI channels.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1727
|
|
Subversion-branch: /branches/opl-branch
Subversion-revision: 1725
|
|
set from snd_samplerate in the configuration file.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1723
|
|
instrument. This should stop the ugly bleeping from the electric snare
on E1M2.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1715
|
|
voices when music is shut down.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1704
|
|
Subversion-branch: /branches/opl-branch
Subversion-revision: 1700
|
|
library code, so that we fall back to software emulation if we have port
access but an OPL is not detected. Fix detection of ioperm in configure.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1692
|
|
this.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1691
|
|
Subversion-branch: /branches/opl-branch
Subversion-revision: 1688
|
|
Subversion-branch: /branches/opl-branch
Subversion-revision: 1685
|
|
Subversion-branch: /branches/opl-branch
Subversion-revision: 1684
|
|
Subversion-branch: /branches/opl-branch
Subversion-revision: 1683
|
|
of instruments to offset.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1680
|
|
one octave, as per research.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1678
|
|
voices. Doom writes the same value to both operators.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1671
|
|
Subversion-branch: /branches/opl-branch
Subversion-revision: 1670
|