|
libfluidsynth 2.5.4
|
Functions to load and unload SoundFonts. More...
Functions | |
| int | fluid_synth_add_sfont (fluid_synth_t *synth, fluid_sfont_t *sfont) |
| Add a SoundFont. | |
| int | fluid_synth_get_bank_offset (fluid_synth_t *synth, int sfont_id) |
| Get bank offset of a loaded SoundFont. | |
| fluid_sfont_t * | fluid_synth_get_sfont (fluid_synth_t *synth, unsigned int num) |
| Get SoundFont by index. | |
| fluid_sfont_t * | fluid_synth_get_sfont_by_id (fluid_synth_t *synth, int id) |
| Get SoundFont by ID. | |
| fluid_sfont_t * | fluid_synth_get_sfont_by_name (fluid_synth_t *synth, const char *name) |
| Get SoundFont by name. | |
| int | fluid_synth_remove_sfont (fluid_synth_t *synth, fluid_sfont_t *sfont) |
| Remove a SoundFont from the SoundFont stack without deleting it. | |
| int | fluid_synth_set_bank_offset (fluid_synth_t *synth, int sfont_id, int offset) |
Offset the bank numbers of a loaded SoundFont, i.e. subtract offset from any bank number when assigning instruments. | |
| int | fluid_synth_sfcount (fluid_synth_t *synth) |
| Count number of loaded SoundFont files. | |
| int | fluid_synth_sfload (fluid_synth_t *synth, const char *filename, int reset_presets) |
| Load a SoundFont file. | |
| int | fluid_synth_sfreload (fluid_synth_t *synth, int id) |
| Reload a SoundFont. | |
| int | fluid_synth_sfunload (fluid_synth_t *synth, int id, int reset_presets) |
| Schedule a SoundFont for unloading. | |
Functions to load and unload SoundFonts.
| int fluid_synth_add_sfont | ( | fluid_synth_t * | synth, |
| fluid_sfont_t * | sfont ) |
Add a SoundFont.
The SoundFont will be added to the top of the SoundFont stack and ownership is transferred to synth.
| Synthesizer | FluidSynth instance |
| sfont | SoundFont to add |
| int fluid_synth_get_bank_offset | ( | fluid_synth_t * | synth, |
| int | sfont_id ) |
Get bank offset of a loaded SoundFont.
| Synthesizer | FluidSynth instance |
| sfont_id | ID of a loaded SoundFont |
| fluid_sfont_t * fluid_synth_get_sfont | ( | fluid_synth_t * | synth, |
| unsigned int | num ) |
Get SoundFont by index.
| Synthesizer | FluidSynth instance |
| num | SoundFont index on the stack (starting from 0 for top of stack). |
| fluid_sfont_t * fluid_synth_get_sfont_by_id | ( | fluid_synth_t * | synth, |
| int | id ) |
Get SoundFont by ID.
| Synthesizer | FluidSynth instance |
| id | SoundFont ID |
| fluid_sfont_t * fluid_synth_get_sfont_by_name | ( | fluid_synth_t * | synth, |
| const char * | name ) |
Get SoundFont by name.
| Synthesizer | FluidSynth instance |
| name | Name of SoundFont |
| int fluid_synth_remove_sfont | ( | fluid_synth_t * | synth, |
| fluid_sfont_t * | sfont ) |
Remove a SoundFont from the SoundFont stack without deleting it.
| Synthesizer | FluidSynth instance |
| sfont | SoundFont to remove |
sfont successfully removed, FLUID_FAILED otherwiseSoundFont is not freed and is left as the responsibility of the caller.
| int fluid_synth_set_bank_offset | ( | fluid_synth_t * | synth, |
| int | sfont_id, | ||
| int | offset ) |
Offset the bank numbers of a loaded SoundFont, i.e. subtract offset from any bank number when assigning instruments.
| Synthesizer | FluidSynth instance |
| sfont_id | ID of a loaded SoundFont |
| offset | Bank offset value to apply to all instruments |
| int fluid_synth_sfcount | ( | fluid_synth_t * | synth | ) |
Count number of loaded SoundFont files.
| Synthesizer | FluidSynth instance |
| int fluid_synth_sfload | ( | fluid_synth_t * | synth, |
| const char * | filename, | ||
| int | reset_presets ) |
Load a SoundFont file.
The filename is passed onto and interpreted by the SoundFont loaders. On success, 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.
If the SoundFont is structural defect, it will be rejected and the function will fail.
| Synthesizer | FluidSynth instance |
| filename | File to load |
| reset_presets | TRUE to re-assign presets for all MIDI channels (equivalent to calling fluid_synth_program_reset()) |
filename is treated as an UTF8 encoded string on Windows. FluidSynth will convert it to wide-char internally and then pass it to _wfopen(). Before FluidSynth 2.2.0, filename was treated as ANSI string on Windows. All other platforms directly pass it to fopen() without any conversion (usually, UTF8 is accepted). | int fluid_synth_sfreload | ( | fluid_synth_t * | synth, |
| int | id ) |
Reload a SoundFont.
The SoundFont retains its ID and index on the SoundFont stack.
| Synthesizer | FluidSynth instance |
| id | ID of SoundFont to reload |
| int fluid_synth_sfunload | ( | fluid_synth_t * | synth, |
| int | id, | ||
| int | reset_presets ) |
Schedule a SoundFont for unloading.
If the SoundFont isn't used anymore by any playing voices, it will be unloaded immediately.
If any samples of the given SoundFont are still required by active voices, the SoundFont will be unloaded in a lazy manner, once those voices have finished synthesizing. If you call delete_fluid_synth(), all voices will be destroyed and the SoundFont will be unloaded in any case. Once this function returned, fluid_synth_sfcount() and similar functions will behave as if the SoundFont has already been unloaded, even though the lazy-unloading is still pending.
| Synthesizer | FluidSynth instance |
| id | ID of SoundFont to unload |
| reset_presets | TRUE to re-assign presets for all MIDI channels |
id was found, FLUID_FAILED otherwise.