From 9a4b95a7426a07df718a6c95e5dc7b6c1dd8f768 Mon Sep 17 00:00:00 2001 From: Marcus Weseloh Date: Wed, 24 Mar 2021 20:41:18 +0100 Subject: [PATCH 1/2] Reset the synth after the end, not before the start of a song This change prevents an unnecessary synth reset before the first MIDI song is played. It allows changing synth parameters via a config file without having to unset the player.reset-synth setting. --- src/midi/fluid_midi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index a5bac502..86166d8f 100644 --- a/src/midi/fluid_midi.c +++ b/src/midi/fluid_midi.c @@ -2059,11 +2059,6 @@ fluid_player_playlist_load(fluid_player_t *player, unsigned int msec) player->start_ticks = 0; player->cur_ticks = 0; - if(player->reset_synth_between_songs) - { - fluid_synth_system_reset(player->synth); - } - for(i = 0; i < player->ntracks; i++) { if(player->track[i] != NULL) @@ -2145,6 +2140,12 @@ fluid_player_callback(void *data, unsigned int msec) { FLUID_LOG(FLUID_DBG, "%s: %d: Duration=%.3f sec", __FILE__, __LINE__, (msec - player->begin_msec) / 1000.0); + + if(player->reset_synth_between_songs) + { + fluid_synth_system_reset(player->synth); + } + loadnextfile = 1; } From 7dd870f498104ac3e41f0ee6b77c9f8ffb3cb987 Mon Sep 17 00:00:00 2001 From: Marcus Weseloh Date: Wed, 24 Mar 2021 20:41:48 +0100 Subject: [PATCH 2/2] Update player.reset-synth doc with new behaviour --- doc/fluidsettings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/fluidsettings.xml b/doc/fluidsettings.xml index 55bd9662..19d674db 100644 --- a/doc/fluidsettings.xml +++ b/doc/fluidsettings.xml @@ -760,7 +760,7 @@ and commit the results. Refresh with the following command: bool 1 (TRUE) - If true, reset the synth before starting a new MIDI song, so the state of a previous song can't affect the new song. Turn it off for seamless looping of a song. + If true, reset the synth after the end of a MIDI song, so that the state of a previous song can't affect the next song. Turn it off for seamless looping of a song. timing-source