diff --git a/src/rvoice/fluid_rvoice.c b/src/rvoice/fluid_rvoice.c index 212ee2734..9c0ea28a5 100644 --- a/src/rvoice/fluid_rvoice.c +++ b/src/rvoice/fluid_rvoice.c @@ -422,6 +422,14 @@ fluid_rvoice_write(fluid_rvoice_t *voice, fluid_real_t *dsp_buf) voice->dsp.phase_incr = 1; } + /* loop mode release? if not in release, the voice is silent + * note: this intentionally processes the volenv before returning silence, + * since that's what polyphone does (PR #1400) */ + if(voice->dsp.samplemode == FLUID_START_ON_RELEASE && fluid_adsr_env_get_section(&voice->envlfo.volenv) < FLUID_VOICE_ENVRELEASE) + { + return -1; + } + /* voice is currently looping? */ is_looping = voice->dsp.samplemode == FLUID_LOOP_DURING_RELEASE || (voice->dsp.samplemode == FLUID_LOOP_UNTIL_RELEASE diff --git a/src/rvoice/fluid_rvoice.h b/src/rvoice/fluid_rvoice.h index 610afd725..229e88337 100644 --- a/src/rvoice/fluid_rvoice.h +++ b/src/rvoice/fluid_rvoice.h @@ -45,7 +45,7 @@ enum fluid_loop { FLUID_UNLOOPED = 0, FLUID_LOOP_DURING_RELEASE = 1, - FLUID_NOTUSED = 2, + FLUID_START_ON_RELEASE = 2, /* this is a looping mode introduced by Polyphone, see #1398 for more info */ FLUID_LOOP_UNTIL_RELEASE = 3 };