Implement per-channel fluid_synth_all_notes_off when seeking/stopping player #981
Replies: 2 comments 21 replies
-
Ok for me in general.
Pls. test how the behavior is when notes in the backing tracks are sustained: I.e. NoteOn, press sustain pedal, seek to a location where There shouldn't be any hanging notes in a), but for b) I'm not entirely sure. |
Beta Was this translation helpful? Give feedback.
-
Just one more general thought about what you want to achieve. If you don't stop notes immediately before the seek but let them transition into their release phase and die out, you might get weird effects for sounds with a long-ish release phase, especially if they where affected by any controllers. Say a glockenspiel with a long release tail, which the song pitched down using a controller. You seek to a different position in the song, arrive at a different controller value and your (still audible) glockenspiel release phase suddenly jumps to a new pitch. It seems to me that letting the sounds go into release instead of cutting them off opens up quite a few new edge cases. |
Beta Was this translation helpful? Give feedback.
-
I'm working on an app that uses FluidSynth to play backing tracks from a MIDI file on some channels while the user can also trigger notes on other channels with an attached MIDI controller. The features added to fluid_player are great for this, particularly the ability to seek within a midi file, which makes it possible to set up loop points, jump to verse/chorus, etc. However, seeking calls
fluid_synth_all_sounds_off(synth, -1)
, which creates an audible click as all playing sounds are cut off without being allowed to complete their release phase, and also stops any notes the user is playing on other MIDI channels.I propose two things:
fluid_synth_all_notes_off
above instead, so that notes can release smoothly when seeking.fluid_synth_all_notes_off
can already be called for specific channels, add a way of setting in the player which channels should receive an all_notes_off when seeking or stopping the player.This involves adding an array of type
int
to_fluid_player_t
and a function to the API for setting the array in a player object. I've created PR #980 that demonstrates/accomplishes this. The default behavior remains the same - if the user doesn't set the array, its initial value is-1
, and all channels receive the all_notes_off call.Beta Was this translation helpful? Give feedback.
All reactions