add Mix_SetMusicBeat and Mix_GetMusicBeat #481
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a use case where I must set the position of MIDI music to a particular beat index (something supported by the old allegro 4 midi player, and perhaps other midi players).
Example MIDI: https://drive.google.com/file/d/1qiE7sVyvQoVRxJftKhz-n4juuArfwri8/view?usp=share_link
And positions of tunes within:
Note: I'm not certain if there's an off-by-one error in this code, or in the source midi player these positions are defined to work in (allegro 4), but I found I need to take the beat values above and subtract one to get the exact right positioning.
You can use the
playmus
example program to seek to a specific tune (you'll need a timidity.cfg and soundfont within your build directory, as always):Draft until some feedback (then I'll update the other music interfaces with NULL stubs).