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

ID not found. #1

Closed
BenCollver opened this issue Sep 16, 2012 · 6 comments
Closed

ID not found. #1

BenCollver opened this issue Sep 16, 2012 · 6 comments

Comments

@BenCollver
Copy link

I downloaded "m3r organs.sfark" from the following location.
http://www.soundfonts.gonet.biz/list.php

I ran: ./unsfark "m3r organs.sfark"

I received the following error:
ID not found. File is corrupt or not a compressed soundfont

I ran: file "m3r organs.sfark"

I received the following output:
m3r organs.sfark: sfArk compressed Soundfont

@dennish
Copy link

dennish commented Oct 19, 2012

First, THANK YOU for this utility. This is desperately needed, especially on OS X Intel Macs. There is no other utility that I know of.

But...I'm having exactly the same issue as BenCollver. Steps to observe this problem: (i) Download "pianissimum.sfArk" from hammersound.com. (ii) Verify in hex editor that the "sfArk" ID is indeed located at byte offset 26. (iii) Run unsfark from the command line. (iv) Receive error message "ID not found. File is corrupt or not a compressed soundfont".

Compiled on "OS X" with this command:

gcc -Wall -g -mfpmath=387 -o unsfark unsfark.c unsfark-cli.c -lz

@dennish
Copy link

dennish commented Oct 19, 2012

OK, I figured out the "ID not found. File is corrupt or not a compressed soundfont" issue:

On many systems, "sizeof(SfArkId)" will return the size of the pointer, not the size of the string that the pointer points to. On OS X SfArkId is an 8-byte pointer, so sizeof(SfArkId) == 8, not 6 as expected. To fix this issue, replace "sizeof(SfArkId)" with "strlen(SfArkid)" everywhere.

So that's good. Unfortunately...although the program now outputs an SF2 file, that file seems to be corrupt. It isn't working in my MIDI player (in fact it is crashing the player, although other SF2 files work fine). Any ideas on (i) why this might be, or (ii) how to check the integrity of an SF2 file? If I knew what the SF2 file were supposed to look like then I might be able to fix it.

@raboof
Copy link
Owner

raboof commented Nov 3, 2012

Could you test 7a3a1de ? I sort of 'blindly' fixed the issue, i need to get a testsuite together :).

@BenCollver
Copy link
Author

I tested 7a3a1d3 and the problem still exists.

One last occurrence of sizeof(SfArkId) still remains. I tried changing it to strlen(SfArkId) and that change seemed to fix the problem.

@raboof
Copy link
Owner

raboof commented Nov 3, 2012

Woops, fixed that one too.

Does organs.sfark now actually convert correctly for you? I tried a couple of sfark's from the site you mentioned and haven't really had luck with any of them... (but didn't see an 'organs.sfark')

@BenCollver
Copy link
Author

Yes, organs.sfark converts correctly for me now. Thanks for the fix!

@raboof raboof closed this as completed Dec 30, 2012
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

No branches or pull requests

3 participants