Soundfond bank/patch remap within FluidSynth #809
Replies: 2 comments 4 replies
-
It probably wouldn't be hard to implement, I agree. The question I'm asking myself is: how many people would actually use this feature? From your description I'm not quite clear if that is just an idea you had and you think other people might need it, or if it is a solution to a problem that you have personally. If we were to implement this, then I would vote against a separate map file and rather add shell commands to add or change mappings. And in my opinion, the feature would need to be available via the API as well. Cheers |
Beta Was this translation helpful? Give feedback.
-
If I remember correctly, if you load multiple soundfonts into the same bank, later loaded instruments replace earlier loaded instruments. That is what I understand yukulele to say happens with the example of the recorder.sf2 patches replacing piano patches. Would making a modified version of a soundfont being used to replace instruments in an earlier loaded soundfont to renumber the presets to merge properly be an acceptable answer? That is easy to do with a program like Polyphone. Or is there a need to be able to change the preset numbers at the time FluidSynth is being set up? |
Beta Was this translation helpful? Give feedback.
-
The main idea is to allow arbitrarily remap presets (using e.g. a map config file), especially when using multiple soundfonts at once
Why it may be needed:
For example, GS (mostly extended versions like SC-88) and XG have their presets largely intersecting (outside of GM, namely, presets like "12-String Guitar", "Jazz Bass", "Rotary Organ" etc.), but unfortunately, they are available at different bank numbers. Since there exist some free soundfonts which allow complete (or nearly complete) coverage of these standards (for example, this one), it would be comfortable to use single set of soundfonts to play MIDI files of both types (without modifying the SF2s themselves). Also, it would be a more convenient way to manipulate banks (rather than already-present bank offset feature, which may not work for standard MIDI files since it only allows offsetting all the banks present in an SF2 file by a fixed amount).
Another potential use-case is to play non-GM-compliant MIDI files with GM soundfonts and vice versa (by mapping not only banks, but also program numbers).
How it can work:
For example, a GS soundfont (loaded into FluidSynth in slot (SFID) 0) may contain the "Mute Picked Bass" preset on bank 8, program number 35 (using 1-128 range).
The map file could contain the following settings (in some format):
So, when the bank select mode is set to MMA, both GS and XG files containing that preset could play correctly. One should be able to even mix GS and XG patches in one file.
How it can be implemented:
Actually, it's very easily to implement - one just needs to find the preset in the map (if remapping is enabled) when a program change event arrives, similarly to the already implemented bank offset, with reasonable defaults, such as setting to bank 0 when the requested preset is not found in the map (of course, one will need additionally the code to parse the map file). Since the feature is designed to be completely optional, it should not introduce any backwards incompatibility (either API or ABI).
Beta Was this translation helpful? Give feedback.
All reactions