Commit graph

13 commits

Author SHA1 Message Date
Randy Heit
0e5587812e - Fixed: Timidity::Renderer::reset_voices() must completely zero the
voices. Because this wasn't done, note_on() could try to access
  the sample for a voice that had never been played yet and access
  random memory. There may be other places where it's a problem, but
  this is where I noticed it, by chance.


SVN r1182 (trunk)
2008-08-23 02:38:00 +00:00
Randy Heit
d4563767ee - Added a new cvar: midi_timiditylike. This re-enables TiMidity handling of
GUS patch flags, envelopes, and volume levels, while trying to be closer
  to TiMidity++ than original TiMidity.
- Renamed timidity_config and timidity_voices to midi_config and midi_voices
  respectively.


SVN r959 (trunk)
2008-05-10 01:35:50 +00:00
Randy Heit
e64586d86f - Reduced volume, expression, and panning controllers back to 7 bits.
- Added very basic Soundfont support to the internal TiMidity. Things missing:
  filter, LFOs, modulation envelope, chorus, reverb, and modulators. May or
  may not be compatible with TiMidity++'s soundfont extensions.
- Added support for quoted strings to the TiMidity config parser.


SVN r957 (trunk)
2008-05-09 03:54:06 +00:00
Randy Heit
16d18c707a - Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
  kill_note(). This can be clearly heard in the final cymbal crashes of
  D_DM2TTL where TiMidity cuts them off because the final cymbals are played
  with a velocity of 1 before the preceding cymbals have finished. (I wonder
  if I should be setting the self_nonexclusive flag for GUS patches to
  disable even this behavior, though, since gf1note.c doesn't turn off
  duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
  egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
  bit. This is not what it does; every sample has an envelope. Rather, this
  is a "no sampled release" flag. Also, despite fiddling with the
  PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
  used it. Nor did it do anything at all with the PATCH_FAST_REL flag.


SVN r934 (trunk)
2008-04-24 04:18:49 +00:00
Randy Heit
effe9427fd - Added the writewave command to write the internal TiMidity's output to a
wave file.
- Changed the default channel velocity for MUS files from 64 to 100 to
  better match apparent MIDI practice. (Would like to know what this is
  supposed to be.)
- Changed the mus2midi channel assignments to match the internal player's.
- Fixed: apply_envelope_to_amp() should clamp the mix levels to 0.


SVN r926 (trunk)
2008-04-19 21:36:53 +00:00
Randy Heit
f6866df0e6 - Made the maximum number of TiMidity voices configurable through the
timidity_voices cvar.
- Added stats lines for the OPL and Timidity MIDI devices.
- Completely changed the way TiMidity volume calculations are done. It
  should now be extremely close to the output a real GUS would produce with
  its official MIDI player (excepting where TiMidity normalizes sample
  volumes). The new equations more closely match what is specified by the DLS
  and SF2 specs (but not quite), so I presume it's also more musically
  correct than what TiMidity (and TiMidity++) do.


SVN r925 (trunk)
2008-04-19 05:57:09 +00:00
Randy Heit
42c80b3ee5 - Updated fmod_wrap.h for FMOD 4.14.
- Set note velocity back to using a linear sounding volume curve, although
  it's now used to scale channel volume and expression, so recompute_amp()
  is still only doing one volume curve lookup.
- Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song.


SVN r920 (trunk)
2008-04-16 20:02:16 +00:00
Randy Heit
9450db3cec parameters. These seem to be used primarily to restrict percussion
instruments to specific notes.
- Changed note velocity to not use the volume curve in recompute_amp(), since
  this sounds closer to TiMidity++, although I don't believe it's correct
  MIDI behavior. Also changed expression so that it scales the channel volume
  before going through the curve.
- Reworked load_instrument to be less opaque.
- Went through the TiMidity code and removed pretty much all of the SDL_mixer
  extensions. The only exception would be kill_others(), which I reworked
  into a kill_key_group() function, which should be useful for DLS
  instruments in the future.


SVN r918 (trunk)
2008-04-16 05:41:03 +00:00
Randy Heit
e7ff22457e - Changed FMOD_INIT_ENABLE_DSPNET use to its replacement from 4.14.00,
FMOD_INIT_ENABLE_PROFILE. Renamed the corresponding cvar to snd_profile.
- Removed the normalize parameter from SoundStream::Play().
- Disabled the chorus and reverb effects added to SDL_mixer's Timidity,
  because they were probably never tested well, either. Thanks to the bug
  in vc_alloc(), they were never even activated.
- Restored the exact frequency range search that was missing from SDL_mixer's
  verion of select_sample().
- Fixed: vc_alloc(), kill_others(), and note_on() treated Voice::status as a
  bit mask, when it's not. These were changes made to SDL_mixer's Timidity.
- Restored the original Timidity volume equation. The other louder one was
  put in when I didn't realize all channels were mono and many notes sounded
  too quiet because they never completed their attack phase.
- Fixed: FileReader::Gets() acted as if fgets() always read the maximum
  number of characters.
- Fixed: FileReader::Open() did not set FilePos and StartPos to 0.


SVN r908 (trunk)
2008-04-13 03:23:33 +00:00
Randy Heit
b340f9c762 - Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
  failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
  pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.


SVN r904 (trunk)
2008-04-12 05:33:20 +00:00
Randy Heit
0d18580ff0 - Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
  which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
  need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
  shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
  of the new wave data uninitialized.


SVN r903 (trunk)
2008-04-12 05:04:37 +00:00
Randy Heit
1809870824 - Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
  tables.cpp. (And interestingly, VC++ automatically renamed the object file,
  so I wasn't aware of the problem with GCC.)


SVN r902 (trunk)
2008-04-12 00:32:26 +00:00
Randy Heit
10c0d67b78 - Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
  event which only has a 1 in 127 chance of being for a note that's playing
  on that channel. Then I decided it would probably be a good idea to reset
  all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
  (copied from the OPL player) improved its sound dramatically, so apparently
  Timidity has issues with short stream buffers. It's now at 1/2 sec in
  length. However, there seems to be something weird going on with
  corazonazul_ff6boss.mid near the beginning where it stops and immediately
  restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
  oscilloscopes and spectrums.
- Internal TiMidity now plays music.
- Changed the progdir global variable into an FString.

SVN r900 (trunk)
2008-04-11 04:59:23 +00:00