mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 15:01:40 +00:00
avoid redundant zero checking
count will never become 0
This commit is contained in:
parent
e485129705
commit
27f2ed3750
1 changed files with 4 additions and 4 deletions
|
@ -1013,7 +1013,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
|
|||
fluid_clip(x, -12000.0f, 8000.0f);
|
||||
count = 1 + NUM_BUFFERS_ATTACK(x);
|
||||
fluid_voice_update_volenv(voice, FLUID_VOICE_ENVATTACK,
|
||||
count, 1.0f, count ? 1.0f / count : 0.0f, -1.0f, 1.0f);
|
||||
count, 1.0f, 1.0f / count, -1.0f, 1.0f);
|
||||
break;
|
||||
|
||||
case GEN_VOLENVHOLD: /* SF2.01 section 8.1.3 # 35 */
|
||||
|
@ -1038,7 +1038,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
|
|||
fluid_clip(x, FLUID_MIN_VOLENVRELEASE, 8000.0f);
|
||||
count = 1 + NUM_BUFFERS_RELEASE(x);
|
||||
fluid_voice_update_volenv(voice, FLUID_VOICE_ENVRELEASE,
|
||||
count, 1.0f, count ? -1.0f / count : 0.0f, 0.0f, 1.0f);
|
||||
count, 1.0f, -1.0f / count, 0.0f, 1.0f);
|
||||
break;
|
||||
|
||||
/* Modulation envelope */
|
||||
|
@ -1054,7 +1054,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
|
|||
fluid_clip(x, -12000.0f, 8000.0f);
|
||||
count = 1 + NUM_BUFFERS_ATTACK(x);
|
||||
fluid_voice_update_modenv(voice, FLUID_VOICE_ENVATTACK,
|
||||
count, 1.0f, count ? 1.0f / count : 0.0f, -1.0f, 1.0f);
|
||||
count, 1.0f, 1.0f / count, -1.0f, 1.0f);
|
||||
break;
|
||||
|
||||
case GEN_MODENVHOLD: /* SF2.01 section 8.1.3 # 27 */
|
||||
|
@ -1079,7 +1079,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
|
|||
fluid_clip(x, -12000.0f, 8000.0f);
|
||||
count = 1 + NUM_BUFFERS_RELEASE(x);
|
||||
fluid_voice_update_modenv(voice, FLUID_VOICE_ENVRELEASE,
|
||||
count, 1.0f, count ? -1.0f / count : 0.0f, 0.0f, 2.0f);
|
||||
count, 1.0f, -1.0f / count, 0.0f, 2.0f);
|
||||
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue