Skip to content

Commit

Permalink
Add support for sample mode release
Browse files Browse the repository at this point in the history
  • Loading branch information
spessasus committed Oct 8, 2024
1 parent a825f99 commit f42ca72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/rvoice/fluid_rvoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ 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 */
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
Expand Down
2 changes: 1 addition & 1 deletion src/rvoice/fluid_rvoice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit f42ca72

Please sign in to comment.