Do not use loop noise floor if sample continues in release phase (ticket #93)

Reported by Graham Goode.
This commit is contained in:
David Henningsson 2011-03-27 10:18:01 +00:00
parent abc4ffc5f4
commit cabb6ad315

View file

@ -195,8 +195,8 @@ fluid_rvoice_check_sample_sanity(fluid_rvoice_t* voice)
/* Is the voice loop within the sample loop? */
if ((int)voice->dsp.loopstart >= (int)voice->dsp.sample->loopstart
&& (int)voice->dsp.loopend <= (int)voice->dsp.sample->loopend){
/* Is there a valid peak amplitude available for the loop? */
if (voice->dsp.sample->amplitude_that_reaches_noise_floor_is_valid){
/* Is there a valid peak amplitude available for the loop, and can we use it? */
if (voice->dsp.sample->amplitude_that_reaches_noise_floor_is_valid && voice->dsp.samplemode == FLUID_LOOP_DURING_RELEASE){
voice->dsp.amplitude_that_reaches_noise_floor_loop=voice->dsp.sample->amplitude_that_reaches_noise_floor / voice->dsp.synth_gain;
} else {
/* Worst case */