Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seek does not work properly when notes start at the seek time #646

Closed
ThunkMonkey opened this issue May 1, 2020 · 2 comments
Closed

Seek does not work properly when notes start at the seek time #646

ThunkMonkey opened this issue May 1, 2020 · 2 comments
Labels
Milestone

Comments

@ThunkMonkey
Copy link

If you call fluid_player_seek(player, ticks), and the midi file has notes that start at exactly the value of ticks, they will not be played.

As far as I can tell, this happens because when seeking, all note on/off events are ignored as seen here:

        else if(seeking && (event->type == NOTE_ON || event->type == NOTE_OFF))
        {
            /* skip on/off messages */
        }

When we reach the seek ticks value, any note on events at that time will be ignored as well.

Not sure what the best solution is here. Perhaps one way to fix it is to modify the seeking flag here:

        if(track->ticks + event->dtime > ticks)
        {
            return;
        }

        if(track->ticks + event->dtime == ticks)
        {
            seeking = 0;
        }           
@ThunkMonkey ThunkMonkey added the bug label May 1, 2020
@derselbst derselbst added this to the 2.1 milestone May 2, 2020
@derselbst
Copy link
Member

Sorry for the delay. I've adapted your suggestion and committed a potential fix. Please test this branch:

https://github.com/FluidSynth/fluidsynth/tree/issue646

@ThunkMonkey
Copy link
Author

Works great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants