From 27f2ed3750f2598a0922e2f3c8e27c4ed9c79af7 Mon Sep 17 00:00:00 2001 From: derselbst Date: Wed, 25 Oct 2017 10:42:59 +0200 Subject: [PATCH] avoid redundant zero checking count will never become 0 --- src/synth/fluid_voice.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/synth/fluid_voice.c b/src/synth/fluid_voice.c index a3a2cdb8..b3c1764d 100644 --- a/src/synth/fluid_voice.c +++ b/src/synth/fluid_voice.c @@ -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;