fluidsynth icon indicating copy to clipboard operation
fluidsynth copied to clipboard

Tracks cannot be restarted in player after reaching EOT

Open albedozero opened this issue 2 years ago • 0 comments

FluidSynth version

FluidSynth runtime version 2.2.8
Copyright (C) 2000-2022 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

FluidSynth executable version 2.2.8
Sample type=double

Describe the bug

When playing a type 1 MIDI file with tracks of different lengths, if the user seeks backward in the song after one of the tracks has finished, the track will no longer play. This is because the player callback will not call fluid_track_send_events() on a track if it has no events left to play, but fluid_track_send_events() is where the track is reset if there is a seek in progress.

Expected behavior

The player callback should call fluid_track_send_events() on all tracks regardless of EOT, since fluid_track_send_events() already checks to see if there are any events left to play in the track, but does this after checking to see if it needs to reset the track because a backwards seek has occurred.

Steps to reproduce

  1. Unzip the attached midi file and play it using the command below and a GM soundfont

funkjam5.tar.gz

fluidsynth funkjam5.mid FluidR3_GM.sf2
  1. After the electric piano stops playing in the chorus, enter player_seek -50000 to go back to the beginning of the song. The EP will no longer play.

Additional context

fixed by #1137

albedozero avatar Aug 05 '22 04:08 albedozero