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

Fix for instrument & preset name having garbage characters #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amuhaimin02
Copy link
Contributor

Plenty of soundfonts like Airfont 380 and Ntonyx's 32MBGMStereo have corrupted names for instruments and presets when loaded. The reason is those names that are beyond 20-character limit has uninitialized characters past their null character (ASCII code 0)

Screenshot 2024-10-26 at 9 24 49 PM

This PR fixes the logic to ensure the name reading terminates on null character properly. Any extra characters beyond the null character will be discarded.

@chipweinberger
Copy link
Owner

this would be good for a helper util

String.fromNullTerminatedBytes(...)

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

Successfully merging this pull request may close these issues.

2 participants