libfluidsynth  1.1.11
Data Fields
_fluid_preset_t Struct Reference

Virtual SoundFont preset. More...

Data Fields

void * data
 User supplied data.
 
fluid_sfont_tsfont
 Parent virtual SoundFont.
 
int(* free )(fluid_preset_t *preset)
 Method to free a virtual SoundFont preset. More...
 
char *(* get_name )(fluid_preset_t *preset)
 Method to get a virtual SoundFont preset name. More...
 
int(* get_banknum )(fluid_preset_t *preset)
 Method to get a virtual SoundFont preset MIDI bank number. More...
 
int(* get_num )(fluid_preset_t *preset)
 Method to get a virtual SoundFont preset MIDI program number. More...
 
int(* noteon )(fluid_preset_t *preset, fluid_synth_t *synth, int chan, int key, int vel)
 Method to handle a noteon event (synthesize the instrument). More...
 
int(* notify )(fluid_preset_t *preset, int reason, int chan)
 Virtual SoundFont preset notify method. More...
 

Detailed Description

Virtual SoundFont preset.

Field Documentation

◆ free

int(* _fluid_preset_t::free) (fluid_preset_t *preset)

Method to free a virtual SoundFont preset.

Parameters
presetVirtual SoundFont preset
Returns
Should return 0

Referenced by fluid_ramsfont_create_sfont().

◆ get_name

char*(* _fluid_preset_t::get_name) (fluid_preset_t *preset)

Method to get a virtual SoundFont preset name.

Parameters
presetVirtual SoundFont preset
Returns
Should return the name of the preset. The returned string must be valid for the duration of the virtual preset (or the duration of the SoundFont, in the case of preset iteration).

Referenced by fluid_ramsfont_create_sfont().

◆ get_banknum

int(* _fluid_preset_t::get_banknum) (fluid_preset_t *preset)

Method to get a virtual SoundFont preset MIDI bank number.

Parameters
presetVirtual SoundFont preset
returnThe bank number of the preset

Referenced by fluid_ramsfont_create_sfont().

◆ get_num

int(* _fluid_preset_t::get_num) (fluid_preset_t *preset)

Method to get a virtual SoundFont preset MIDI program number.

Parameters
presetVirtual SoundFont preset
returnThe program number of the preset

Referenced by fluid_ramsfont_create_sfont().

◆ noteon

int(* _fluid_preset_t::noteon) (fluid_preset_t *preset, fluid_synth_t *synth, int chan, int key, int vel)

Method to handle a noteon event (synthesize the instrument).

Parameters
presetVirtual SoundFont preset
synthSynthesizer instance
chanMIDI channel number of the note on event
keyMIDI note number (0-127)
velMIDI velocity (0-127)
Returns
FLUID_OK on success (0) or FLUID_FAILED (-1) otherwise

This method may be called from within synthesis context and therefore should be as efficient as possible and not perform any operations considered bad for realtime audio output (memory allocations and other OS calls).

Call fluid_synth_alloc_voice() for every sample that has to be played. fluid_synth_alloc_voice() expects a pointer to a fluid_sample_t structure and returns a pointer to the opaque fluid_voice_t structure. To set or increment the values of a generator, use fluid_voice_gen_set() or fluid_voice_gen_incr(). When you are finished initializing the voice call fluid_voice_start() to start playing the synthesis voice. Starting with FluidSynth 1.1.0 all voices created will be started at the same time.

Referenced by fluid_ramsfont_create_sfont().

◆ notify

int(* _fluid_preset_t::notify) (fluid_preset_t *preset, int reason, int chan)

Virtual SoundFont preset notify method.

Parameters
presetVirtual SoundFont preset
reasonFLUID_PRESET_SELECTED or FLUID_PRESET_UNSELECTED
chanMIDI channel number
Returns
Should return FLUID_OK

Implement this optional method if the preset needs to be notified about preset select and unselect events.

This method may be called from within synthesis context and therefore should be as efficient as possible and not perform any operations considered bad for realtime audio output (memory allocations and other OS calls).

Referenced by fluid_ramsfont_create_sfont().


The documentation for this struct was generated from the following file: