- removed volume testing output.

- final tweak to volume adjustment: Do this upon extraction for better results.

If this is done via the synth's parameters it will affect channel balance.
The given factor of 5 is necessary to roughly match the output of FluidSynth.
This commit is contained in:
Christoph Oelckers 2018-02-21 20:12:37 +01:00
parent 59352af486
commit af1de8ddc9
2 changed files with 2 additions and 10 deletions

View file

@ -219,14 +219,6 @@ void TimidityPPMIDIDevice::ComputeOutput(float *buffer, int len)
if (Renderer != nullptr)
Renderer->compute_data(buffer, len);
sampletime += len;
for (int i = 0; i < len * 2; i++)
{
if (buffer[i] < test[0]) test[0] = buffer[i];
if (buffer[i] > test[1]) test[1] = buffer[i];
test[2] += fabs(buffer[i]);
}
Printf("Min = %f, Max = %f, Avg = %f\n", test[0], test[1], test[2] / sampletime);
}
//==========================================================================

View file

@ -230,7 +230,7 @@ double Player::cnv_Hz_to_vib_ratio(double freq)
void Player::adjust_amplification(void)
{
static const double compensation_ratio = 5.0;
static const double compensation_ratio = 1.0;
/* compensate master volume */
master_volume = (double)(amplification) / 100.0 *
((double)master_volume_ratio * (compensation_ratio/0xFFFF));
@ -5033,7 +5033,7 @@ int Player::compute_data(float *buffer, int32_t count)
// pass to caller
for (int i = 0; i < process*2; i++)
{
*buffer++ = (common_buffer[i])*(1.f / 0x80000000u);
*buffer++ = (common_buffer[i])*(5.f / 0x80000000u);
}
}
return RC_OK;