-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
MIDI File parse bug. #177
Comments
Thanks for the bug report. I've looked into this and the file is being successfully parsed, but there are two trailing bytes at the end of the file: 0x0D 0x0A. Because these bytes are unexpected, the file is technically considered malformed, even though these bytes are of no apparent consequence. Thus far I cannot find any reason for them being there. There is nothing in the SMF spec that mentions what they would be for. It's possible to ignore them but I'd rather get to the bottom of why they might be there in the first place if possible before resorting to that. |
Appears they are the \r\n characters. Maybe someone edited the file with a hex editor on windows, and when saved it added carriage return line feed? |
I have developed parsers using Antlr, and this was always a problem between Windows and Unix. Here is one from IBM. |
Yeah it's a Windows CRLF byte pair. Really odd. But if someone attempted editing the file in a text editor then maybe that explains it. Some of the MIDI files out in the wild have survived decades and who knows what happened along the way. On a related note: I sourced a zip file of about 30,000 crowd-sourced MIDI files from the web and ran all of them through a test harness that had |
Please Confirm
macOS Version(s) Used to Build
macOS 13 Ventura
Xcode Version(s)
Xcode 14
Description
The following file does not parse. The same file parses in two other MIDI Parsers, Logic Pro, and plays in AVAudioSequencer.
Anonim - Uzun Ince Bir Yoldayim.mid.zip
Crash Logs, Screenshots or Other Attachments (if applicable)
No response
The text was updated successfully, but these errors were encountered: