Recommit fix for voice stealing algorithm

This commit is contained in:
David Henningsson 2009-11-18 19:14:29 +00:00
parent 35f5a739a2
commit 836a6b45d8

View file

@ -3530,8 +3530,10 @@ fluid_synth_free_voice_by_kill_LOCAL(fluid_synth_t* synth)
this_voice_prio -= (synth->noteid - fluid_voice_get_id(voice));
/* take a rough estimate of loudness into account. Louder voices are more important. */
if (voice->volenv_section != FLUID_VOICE_ENVATTACK){
if (voice->volenv_section > FLUID_VOICE_ENVATTACK){
this_voice_prio += voice->volenv_val * 1000.;
} else {
this_voice_prio += voice->volenv_data[FLUID_VOICE_ENVATTACK].max * 1000.;
}
/* check if this voice has less priority than the previous candidate. */