- 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)
This commit is contained in:
Randy Heit 2008-04-19 05:57:09 +00:00
commit f6866df0e6
12 changed files with 325 additions and 284 deletions

View file

@ -32,6 +32,7 @@
#include "files.h"
CVAR(String, timidity_config, CONFIG_FILE, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Int, timidity_voices, 32, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
namespace Timidity
{
@ -452,6 +453,7 @@ Renderer::Renderer(float sample_rate)
patches = NULL;
resample_buffer_size = 0;
resample_buffer = NULL;
voice = NULL;
adjust_panning_immediately = false;
control_ratio = clamp(int(rate / CONTROLS_PER_SECOND), 1, MAX_CONTROL_RATIO);
@ -464,7 +466,8 @@ Renderer::Renderer(float sample_rate)
if (def_instr_name.IsNotEmpty())
set_default_instrument(def_instr_name);
voices = DEFAULT_VOICES;
voices = clamp<int>(timidity_voices, 16, 256);
voice = new Voice[voices];
drumchannels = DEFAULT_DRUMCHANNELS;
}
@ -474,6 +477,10 @@ Renderer::~Renderer()
{
M_Free(resample_buffer);
}
if (voice != NULL)
{
delete[] voice;
}
}
void Renderer::ComputeOutput(float *buffer, int count)