CMF: Fix typo in comparison, this fixes 'slowdown' of certain CMF files#186
Merged
Conversation
Member
|
I think there's another typo here - all the other events with two data bytes have |
Contributor
Author
|
Noted, fixed the comparison condition again. |
Contributor
|
We should probably add a test file too |
Contributor
Author
|
Okay, will add one. |
Contributor
Author
|
Added a testing file. |
Contributor
|
Thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
There's a typo in checking the end of the song in the note off command: '>' confused with '<'.
As a result, some cmf files were played greatly slowed down, because the whole stream of events is messed up.
This is a fix.
This means that the note-off command was totally broken, because on each note-off the stream pointer was updated incorrectly, pointing to the velocity byte and not to the next delta-time value. Velocity was interpreted as an extra delta value and the next delta value as a running event (which happened still to be 0x80). That's why there appeared extra pauses in some tunes.
Incidentally, all testing tunes didn't have a note-off command apparently, because it's optional for cmf. But other tunes, converted from midi, were affected.
Tunes affected by this bug:
1001.CMF, HF048.CMF: https://file.io/fk4R228SNyaH
TMNT.CMF from this archive: http://os4depot.net/?function=showcontent&file=audio/play/adplay.lha
https://sid.ethz.ch/debian/adlib/Creative%20Music%20Format/Drum%20Blaster/MAMBO.CMF
https://sid.ethz.ch/debian/adlib/Creative%20Music%20Format/Drum%20Blaster/NEWAGE.CMF
https://sid.ethz.ch/debian/adlib/Creative%20Music%20Format/Drum%20Blaster/REGGAE.CMF
https://sid.ethz.ch/debian/adlib/Creative%20Music%20Format/Drum%20Blaster/SNDTRACK.CMF