You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mix_SetSoundFonts includes this in its documentation:
You may specify multiple paths in a single string by separating them with semicolons; they will be searched in the order listed.
I assume "searched in the order listed" means that the first-listed will be prioritized. However, this is not correct. In fact, the last-listed has the highest priority, when used with FluidSynth. The Mac backend looks like it also uses SoundFonts, but I'm not sure if this applies to it: I don't know what order things are loaded there.
Which iterates over the provided SoundFonts in order, calling fluidsynth_load_soundfont for each one. fluidsynth_load_soundfont calls fluid_synth_sfload, which is documented:
The newly loaded SoundFont will be put on top of the SoundFont stack. Presets are searched starting from the SoundFont on the top of the stack, working the way down the stack until a preset is found.
So, the last added SoundFont goes on the top of the stack, and the stack is searched downward.
Testing agrees with this: the last-listed SoundFont does take priority, i.e. its instruments are used, with earlier-listed SoundFonts only being consulted for missing instruments.
A fix is simple (either change the docs or iterate backward over the list), but I'm not sure which is preferred.
The text was updated successfully, but these errors were encountered:
Mix_SetSoundFonts
includes this in its documentation:I assume "searched in the order listed" means that the first-listed will be prioritized. However, this is not correct. In fact, the last-listed has the highest priority, when used with FluidSynth. The Mac backend looks like it also uses SoundFonts, but I'm not sure if this applies to it: I don't know what order things are loaded there.
The FluidSynth backend does this:
Which iterates over the provided SoundFonts in order, calling
fluidsynth_load_soundfont
for each one.fluidsynth_load_soundfont
callsfluid_synth_sfload
, which is documented:So, the last added SoundFont goes on the top of the stack, and the stack is searched downward.
Testing agrees with this: the last-listed SoundFont does take priority, i.e. its instruments are used, with earlier-listed SoundFonts only being consulted for missing instruments.
A fix is simple (either change the docs or iterate backward over the list), but I'm not sure which is preferred.
The text was updated successfully, but these errors were encountered: