Skip to content

Commit

Permalink
implement setting
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Jan 18, 2025
1 parent 8bd7e06 commit ac95d97
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/synth/fluid_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -6882,28 +6882,25 @@ fluid_synth_release_voice_on_same_note_LOCAL(fluid_synth_t *synth, int chan,
&& (fluid_voice_get_id(voice) != synth->noteid))
{
enum fluid_midi_channel_type type = synth->channel[chan]->channel_type;
enum fluid_msgs_note_cut note_cut_mode = synth->msgs_note_cut_mode;

/* Id of voices that was sustained by sostenuto */
if(fluid_voice_is_sostenuto(voice))
{
synth->storeid = fluid_voice_get_id(voice);
}

switch(type)
if(note_cut_mode == FLUID_MSGS_DISABLED || (note_cut_mode == FLUID_MSGS_DRUM_CUT && type == CHANNEL_TYPE_MELODIC))
{
case CHANNEL_TYPE_DRUM:
/* release the voice, this should make riding hi-hats or snares sound more
* realistic (Discussion #1196) */
fluid_voice_off(voice);
break;
case CHANNEL_TYPE_MELODIC:
/* Force the voice into release stage except if pedaling (sostenuto or sustain) is active.
* This gives a more realistic sound to pianos and possibly other instruments (see PR #905). */
fluid_voice_noteoff(voice);
break;
default:
FLUID_LOG(FLUID_ERR, "This should never happen: unknown channel type %d", (int)type);
break;
/* Force the voice into release stage except if pedaling (sostenuto or sustain) is active.
* This gives a more realistic sound to pianos and possibly other instruments (see PR #905). */
fluid_voice_noteoff(voice);
}
else // i.e. if((note_cut_mode == FLUID_MSGS_ALL_CUT) || (note_cut_mode == FLUID_MSGS_DRUM_CUT && type == CHANNEL_TYPE_DRUM))
{
/* release the voice, this should make riding hi-hats or snares sound more realistic (Discussion #1196)
* Note however, that this is not a SF2 compliant behavior, see #1466 */
fluid_voice_off(voice);
}
}
}
Expand Down

0 comments on commit ac95d97

Please sign in to comment.