Main Page | Data Structures | File List | Data Fields | Globals

voice.h File Reference

Go to the source code of this file.

Enumerations

enum  fluid_voice_add_mod { FLUID_VOICE_OVERWRITE, FLUID_VOICE_ADD, FLUID_VOICE_DEFAULT }

Functions

FLUIDSYNTH_API void fluid_voice_update_param (fluid_voice_t *voice, int gen)
 Update all the synthesis parameters, which depend on generator gen.

FLUIDSYNTH_API void fluid_voice_add_mod (fluid_voice_t *voice, fluid_mod_t *mod, int mode)
FLUIDSYNTH_API void fluid_voice_gen_set (fluid_voice_t *voice, int gen, float val)
 Set the value of a generator.

FLUIDSYNTH_API float fluid_voice_gen_get (fluid_voice_t *voice, int gen)
 Get the value of a generator.

FLUIDSYNTH_API void fluid_voice_gen_incr (fluid_voice_t *voice, int gen, float val)
 Modify the value of a generator by val.

FLUIDSYNTH_API unsigned int fluid_voice_get_id (fluid_voice_t *voice)
 Return the unique ID of the noteon-event.

FLUIDSYNTH_API int fluid_voice_is_playing (fluid_voice_t *voice)
FLUIDSYNTH_API int fluid_voice_optimize_sample (fluid_sample_t *s)
 If the peak volume during the loop is known, then the voice can be released earlier during the release phase.


Enumeration Type Documentation

enum fluid_voice_add_mod
 

Enumeration values:
FLUID_VOICE_OVERWRITE 
FLUID_VOICE_ADD 
FLUID_VOICE_DEFAULT 

Definition at line 42 of file voice.h.


Function Documentation

FLUIDSYNTH_API void fluid_voice_add_mod fluid_voice_t voice,
fluid_mod_t mod,
int  mode
 

FLUIDSYNTH_API float fluid_voice_gen_get fluid_voice_t voice,
int  gen
 

Get the value of a generator.

FLUIDSYNTH_API void fluid_voice_gen_incr fluid_voice_t voice,
int  gen,
float  val
 

Modify the value of a generator by val.

FLUIDSYNTH_API void fluid_voice_gen_set fluid_voice_t voice,
int  gen,
float  val
 

Set the value of a generator.

FLUIDSYNTH_API unsigned int fluid_voice_get_id fluid_voice_t voice  ) 
 

Return the unique ID of the noteon-event.

A sound font loader may store the voice processes it has created for * real-time control during the operation of a voice (for example: parameter changes in sound font editor). The synth uses a pool of voices, which are 'recycled' and never deallocated.

Before modifying an existing voice, check

  • that its state is still 'playing'
  • that the ID is still the same Otherwise the voice has finished playing.

FLUIDSYNTH_API int fluid_voice_is_playing fluid_voice_t voice  ) 
 

FLUIDSYNTH_API int fluid_voice_optimize_sample fluid_sample_t s  ) 
 

If the peak volume during the loop is known, then the voice can be released earlier during the release phase.

Otherwise, the voice will operate (inaudibly), until the envelope is at the nominal turnoff point. In many cases the loop volume is many dB below the maximum volume. For example, the loop volume for a typical acoustic piano is 20 dB below max. Taking that into account in the turn-off algorithm we can save 20 dB / 100 dB => 1/5 of the total release time. So it's a good idea to call fluid_voice_optimize_sample on each sample once.

FLUIDSYNTH_API void fluid_voice_update_param fluid_voice_t voice,
int  gen
 

Update all the synthesis parameters, which depend on generator gen.

This is only necessary after changing a generator of an already operating voice. Most applications will not need this function.


Generated on Sun Nov 30 06:16:37 2003 for libfluidsynth by doxygen 1.3.3