BASSMIDI SF3 bug/issue

Started by klerg,

klerg

Hello

BASSMIDI 2.4.16 gives no sound with the SF3 below in Falcosoft's Midi Player, even 2.4.15 will not work, although 2.4.14 does, but is out of date. See attached SF3 and note.mid as well, how to fix this ?

Thanks

Ian @ un4seen

That appears to be an invalid file, so it fails to load, which explains the no sound :)

Polyphone fails to load it too. The problem is its "smpl" chunk has an odd length of 0x1a15 and then a padding byte is added. That would normally be correct for RIFF-based file formats, but not SF2. Despite what the SF2 spec says, Creative's tools (eg. Vienna) include any padding byte in the chunk length when writing files and don't consider padding when reading them, ie. the "smpl" chunk's length should be 0x1a16 in this case.

Do you know how the soundfont was created?

klerg

If that is an invalid file can you explain how BASSMIDI 2.4.14 loads it and has sound ?

Awave Studio loads it so Polyphone should too. I do not know what most of that means other than the size of a chunk is odd, but good to point it out. I thought what we are dealing with is RIFF-based, but this is SF3 not SF2 here. Again, I'm a bit lost on many of the things you said on Creative, SF2 spec, and Vienna besides the chunk has to be a different size, but this a SF3 file so I do not think we can apply any of that here, and hope that is right.

I have no clue how this soundfont was created, but can you fix it ?

Ian @ un4seen

Quote from: klergIf that is an invalid file can you explain how BASSMIDI 2.4.14 loads it and has sound ?

If I recall correctly, BASSMIDI did briefly switch to treating SF2 files like a standard RIFF-based format (with padding for odd length chunks), but it switched back when that was found to cause problems for some soundfonts.

Quote from: klergAwave Studio loads it so Polyphone should too. I do not know what most of that means other than the size of a chunk is odd, but good to point it out. I thought what we are dealing with is RIFF-based, but this is SF3 not SF2 here. Again, I'm a bit lost on many of the things you said on Creative, SF2 spec, and Vienna besides the chunk has to be a different size, but this a SF3 file so I do not think we can apply any of that here, and hope that is right.

The SF3 format has the same structure as SF2, but with compressed sample data in the "smpl" chunk. Creative created the SF2 format, so if their software doesn't expect padding in SF2 files, everyone else pretty much has to do the same to be compatible. But here's a BASSMIDI update that should detect when padding is used:

    www.un4seen.com/stuff/bassmidi.zip

klerg

Quote from: Ian @ un4seenIf I recall correctly, BASSMIDI did briefly switch to treating SF2 files like a standard RIFF-based format (with padding for odd length chunks), but it switched back when that was found to cause problems for some soundfonts.

I hope that is correct, good to know why this SF3 file does work with BASSMIDI 2.4.14 but what is the actual problem in some soundfonts which came from having SF2 files be as RIFF-based format with padding then ?

Quote from: Ian @ un4seenThe SF3 format has the same structure as SF2, but with compressed sample data in the "smpl" chunk. Creative created the SF2 format, so if their software doesn't expect padding in SF2 files, everyone else pretty much has to do the same to be compatible. But here's a BASSMIDI update that should detect when padding is used:

    www.un4seen.com/stuff/bassmidi.zip

I see it makes sense for SF3 to use same structure as SF2, but only have compressed data for 'smpl' chunk. Yes Creative did make the SF2 standard, and I assume they do not support padding in SF2 files, so that must mean other SF2 software follows that practice as well. Appreciate it, that SF3 file works fine from now on.