-
Notifications
You must be signed in to change notification settings - Fork 151
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
Support Seek and other functions for fluidsynth 2+ #519
Comments
While making these changes it might be worth hooking Play and Stop into Resume and Pause because in fluidsynth they are equivalent. |
That sounds like a good idea. Do you want to submit a PR? |
I wouldn't mind but it may be awhile before I have time. If someone else beats me to it I'm just as happy. |
Hmmm, there's a problem with PR #521 in that FluidSynth's ticks are not milliseconds. For example, with this MIDI file, Some more information can be found in this issue: FluidSynth/fluidsynth#1151. The TL;DR is that FluidSynth deems reporting duration and seeking in milliseconds to be out-of-scope. |
Well, just tried it, and playmus program reports wrong position and 0 duration for a midi file I tried. So there is definitely something wrong with the patch. And I don't know fluidsynth much to offer a solution. @TheCycoONE ? |
The '0 duration' problem may be because FluidSynth's A simple hack I found for this issue is that if after calling So far I haven' t been able to find any good way to translate ticks For my similar use case I'm looking into using libsmf in addition to FluidSynth to deal with this problem more cleanly. |
I'm afraid it'll turn out to be way too much trouble than it's worth and we'll have to revert the patches |
I agree, let's revert the initial commit and this can come back as a new PR once everything is ironed out. |
Patch reverted from both SDL2 and main branches. That reverted the |
Yeah, I think that the right place to do this is in FluidSynth itself. And I don't think it's that complicated (famous last words?), since FluidSynth already has all the necessary pieces internally. • |
The main thing I was going for was resetting the track on Play and supporting Pause/Resume. My understanding of https://www.fluidsynth.org/api/group__sequencer.html#ga7f48dab4cde18da6e0fa76458849c19a was that ticks defaulted to ms but I admit I didn't test that aspect and reading more I see I was completely mistaken. Seek 0 on play is still useful though. |
Feel free to resubmit a PR with just those aspects implemented. |
Fluidsynth 2 supports:
Seek: https://www.fluidsynth.org/api/group__midi__player.html#gaab5fe5b25ff513919b138d77e079c75a
Tell: https://www.fluidsynth.org/api/group__midi__player.html#gabc2d114e2a6926f4db800286b2ebb1da
Duration: https://www.fluidsynth.org/api/group__midi__player.html#gab8bec2b53e07daf2313412e4663c0fa7
When Fluidsynth 2 is used, these functions should be available.
This would fix an issue for us where Mix_PlayMusic continues from where it left off instead of the beginning of the track: CorsixTH/CorsixTH#2328
The text was updated successfully, but these errors were encountered: