_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.
char *(* get_name )(fluid_preset_t *preset)
 Method to get a virtual SoundFont preset name.
int(* get_banknum )(fluid_preset_t *preset)
 Method to get a virtual SoundFont preset MIDI bank number.
int(* get_num )(fluid_preset_t *preset)
 Method to get a virtual SoundFont preset MIDI program number.
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).
int(* notify )(fluid_preset_t *preset, int reason, int chan)
 Virtual SoundFont preset notify method.

Detailed Description

Virtual SoundFont preset.


Field Documentation

Method to free a virtual SoundFont preset.

Parameters:
preset Virtual SoundFont preset
Returns:
Should return 0

Method to get a virtual SoundFont preset name.

Parameters:
preset Virtual 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).

Method to get a virtual SoundFont preset MIDI bank number.

Parameters:
preset Virtual SoundFont preset
return The bank number of the preset

Method to get a virtual SoundFont preset MIDI program number.

Parameters:
preset Virtual SoundFont preset
return The program number of the preset
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:
preset Virtual SoundFont preset
synth Synthesizer instance
chan MIDI channel number of the note on event
key MIDI note number (0-127)
vel MIDI 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.

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

Virtual SoundFont preset notify method.

Parameters:
preset Virtual SoundFont preset
reason FLUID_PRESET_SELECTED or FLUID_PRESET_UNSELECTED
chan MIDI 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).


The documentation for this struct was generated from the following file:
Generated on Mon Sep 6 12:29:28 2010 for libfluidsynth by  doxygen 1.6.3