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

[Feature] Add Bank Select LSB Support via other byte of wBank, as well as other features later #179

Open
stgiga opened this issue Mar 4, 2023 · 3 comments

Comments

@stgiga
Copy link

stgiga commented Mar 4, 2023

So according to the SoundFont standard, the value (known as wBank) normally used to store Controller Change 0 (Bank Select MSB) is actually a 16-bit value. If we use the OTHER byte to store the Controller Change 32 (Bank Select LSB) value, we can support Bank Se]ect LSB in SF2, thus proper Yamaha XG SoundFonts, and proper DLS-to-SF2 conversions can be made. The spec says to preserve (but not play) these values should the other byte than MSB be used. Also, the second percussion toggle is a bit that OpenMPT 1.30 will respond to as a percussion toggle. I have a test-of-LSB SF2 here: https://drive.google.com/file/d/1cerpko6kL4SctyHG9ozYFtwePmbHX7CW/view as well as an attached diagram of the bits for wBank with LSB support. LSB_on_SoundFont

Also, I have some further feature requests in a similar vein that also consist of relying on what the SoundFont specification does not explicitly say to reject.

Furthermore, the SoundFont specification says to not play SoundFonts which have the sm24 chunk (used to store the upper 8 bits of a 24-bit sample) but not the regular 16-bit sample chunk underneath. However, it does NOT tell us to reject these. So 8 bits-per-sample samples in SF2 are possible. Meaning that MOD samples-to-SF2-conversions could be outright 1:1.

In terms of priority, I would say that the 16-bit wBank part would be the best to support first. These three features are part of a project me and a collaborator have to improve the SF2 format via taking the standard completely literally.

We also rely on the spec not explicitly defining the RIFF used as 32-bit RIFF, so we have devised a RIFF64 extension, but given the differences between RIFF and RIFF64, there are some significant reworks needed, giving us room to add in features not possible on 32-bit RIFF. This 64-bit RIFF SF2 format is in its infancy and is not part of this present request.

The wBank LSB use is the feature we feel is the one that is of current most importance. The test SF2 was made by my collaborator via hex editing the wBank values in some XG-mapped patches to put them on their LSBs (Yamaha XG uses Bank Select LSB for its patch variations outside General MIDI rather than Bank Select MSB as is done in Roland GS) as is proper, while following the attached bit diagram of wBank.

This whole proposal has been in the works for months.

I know that it might seem a bit wild to do this, but having Bank Select LSB also opens the doors to more SoundFonts of other synthesizers, because a no-LSB beyond-GM synth outside Roland SoundCanvas lines in native mode is extremely rare. Furthermore, I have pitched the proposal to other people in the SoundFont player and editor community, such as FluidSynth's devs, and also Un4seen.

The gist of this proposal is that wBank LSB use is what we find to be of current most importance, but we have additional plans for later. Best wishes to everyone involved!

@davy7125
Copy link
Owner

davy7125 commented Nov 12, 2024

Understood! I'll add an extra spin box before "bank number" and "preset number", at the preset level, so that we can specify:

  • MSB bank number (0-128)
  • LSB bank number (0-128)
  • preset number (0-127)

This new field will be displayed if the opened soundfont contains at least one MSB bank number different from 0. Otherwise it will be hidden and a discrete option will enable the spin box.

@stgiga
Copy link
Author

stgiga commented Nov 15, 2024

FluidSynth/fluidsynth#1234

@davy7125

There's more information here about LSB that may prove useful.

@stgiga
Copy link
Author

stgiga commented Nov 15, 2024

Also wPreset is 16bit too, just to note. Creative allowed for truly powerful things without even realizing it. By using 16 bits for wBank, they accidentally allowed Yamaha XG, GM2, and other MIDI devices to work in SF2, and that's amazing and crucial. I'll be eager to see more XG SoundFonts thanks to this!

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

2 participants