libfluidsynth  2.3.5
SoundFonts

SoundFont related functions. More...

Modules

 SoundFont Generators
 Functions and defines for SoundFont generator effects.
 
 SoundFont Loader
 Create custom SoundFont loaders.
 
 SoundFont Modulators
 SoundFont modulator functions and constants.
 
 Voice Manipulation
 Synthesis voice manipulation functions.
 

Functions

int fluid_synth_pin_preset (fluid_synth_t *synth, int sfont_id, int bank_num, int preset_num)
 Pins all samples of the given preset. More...
 
int fluid_synth_unpin_preset (fluid_synth_t *synth, int sfont_id, int bank_num, int preset_num)
 Unpin all samples of the given preset. More...
 

Detailed Description

SoundFont related functions.

This part of the API contains functions, defines and types that are mostly only used by internal or custom SoundFont loaders or client code that modifies loaded presets, SoundFonts or voices directly.

Function Documentation

◆ fluid_synth_pin_preset()

int fluid_synth_pin_preset ( fluid_synth_t synth,
int  sfont_id,
int  bank_num,
int  preset_num 
)

Pins all samples of the given preset.

Parameters
synthFluidSynth instance
sfont_idID of a loaded SoundFont
bank_numMIDI bank number
preset_numMIDI program number
Returns
FLUID_OK if the preset was found, pinned and loaded into memory successfully. FLUID_FAILED otherwise. Note that FLUID_OK is returned, even if synth.dynamic-sample-loading is disabled or the preset doesn't support dynamic-sample-loading.

This function will attempt to pin all samples of the given preset and load them into memory, if they are currently unloaded. "To pin" in this context means preventing them from being unloaded by an upcoming channel prog change.

Note
This function is only useful if synth.dynamic-sample-loading is enabled. By default, dynamic-sample-loading is disabled and all samples are kept in memory. Furthermore, this is only useful for presets which support dynamic-sample-loading (currently, only preset loaded with the default soundfont loader do).
Since
2.2.0

◆ fluid_synth_unpin_preset()

int fluid_synth_unpin_preset ( fluid_synth_t synth,
int  sfont_id,
int  bank_num,
int  preset_num 
)

Unpin all samples of the given preset.

Parameters
synthFluidSynth instance
sfont_idID of a loaded SoundFont
bank_numMIDI bank number
preset_numMIDI program number
Returns
FLUID_OK if preset was found, FLUID_FAILED otherwise

This function undoes the effect of fluid_synth_pin_preset(). If the preset is not currently used, its samples will be unloaded.

Note
Only useful for presets loaded with the default soundfont loader and only if synth.dynamic-sample-loading is enabled.
Since
2.2.0