Changeset - r25129:8d230cd22dd9
[Not reviewed]
master
0 1 0
Ghislain Antony Vaillant - 4 years ago 2021-04-05 15:26:41
ghisvail@gmail.com
Fix: Use FluidSynth default soundfont
1 file changed with 15 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/music/fluidsynth.cpp
Show inline comments
 
@@ -77,12 +77,22 @@ const char *MusicDriver_FluidSynth::Star
 
	/* Load a SoundFont and reset presets (so that new instruments
 
	 * get used from the SoundFont) */
 
	if (!sfont_name) {
 
		int i;
 
		sfont_id = FLUID_FAILED;
 
		for (i = 0; default_sf[i]; i++) {
 
			if (!fluid_is_soundfont(default_sf[i])) continue;
 
			sfont_id = fluid_synth_sfload(_midi.synth, default_sf[i], 1);
 
			if (sfont_id != FLUID_FAILED) break;
 

	
 
		/* Try loading the default soundfont registered with FluidSynth. */
 
		char *default_soundfont;
 
		fluid_settings_dupstr(_midi.settings, "synth.default-soundfont", &default_soundfont);
 
		if (fluid_is_soundfont(default_soundfont)) {
 
			sfont_id = fluid_synth_sfload(_midi.synth, default_soundfont, 1);
 
		}
 

	
 
		/* If no default soundfont found, try our own list. */
 
		if (sfont_id == FLUID_FAILED) {
 
			for (int i = 0; default_sf[i]; i++) {
 
				if (!fluid_is_soundfont(default_sf[i])) continue;
 
				sfont_id = fluid_synth_sfload(_midi.synth, default_sf[i], 1);
 
				if (sfont_id != FLUID_FAILED) break;
 
			}
 
		}
 
		if (sfont_id == FLUID_FAILED) return "Could not open any sound font";
 
	} else {
0 comments (0 inline, 0 general)