Main Page   Data Structures   File List   Data Fields   Globals  

sfont.h File Reference

Go to the source code of this file.

Data Structures

struct  _fluid_preset_t
struct  _fluid_sample_t
struct  _fluid_sfloader_t
struct  _fluid_sfont_t

Defines

#define fluid_sfont_get_id(_sf)   ((_sf)->id)
#define fluid_sample_refcount(_sample)   ((_sample)->refcount)
#define FLUID_SAMPLETYPE_MONO   1
 Sample types. More...

#define FLUID_SAMPLETYPE_RIGHT   2
#define FLUID_SAMPLETYPE_LEFT   4
#define FLUID_SAMPLETYPE_LINKED   8
#define FLUID_SAMPLETYPE_ROM   0x8000

Enumerations

enum  { FLUID_PRESET_SELECTED, FLUID_PRESET_UNSELECTED, FLUID_SAMPLE_DONE }
 SoundFont plugins. More...


Define Documentation

#define fluid_sample_refcount _sample       ((_sample)->refcount)
 

Definition at line 163 of file sfont.h.

#define FLUID_SAMPLETYPE_LEFT   4
 

Definition at line 170 of file sfont.h.

#define FLUID_SAMPLETYPE_LINKED   8
 

Definition at line 171 of file sfont.h.

#define FLUID_SAMPLETYPE_MONO   1
 

Sample types.

Definition at line 168 of file sfont.h.

#define FLUID_SAMPLETYPE_RIGHT   2
 

Definition at line 169 of file sfont.h.

#define FLUID_SAMPLETYPE_ROM   0x8000
 

Definition at line 172 of file sfont.h.

#define fluid_sfont_get_id _sf       ((_sf)->id)
 

Definition at line 102 of file sfont.h.


Enumeration Type Documentation

anonymous enum
 

SoundFont plugins.

It is possible to add new SoundFont loaders to the synthesizer. The API uses a couple of "interfaces" (structures with callback functions): fluid_sfloader_t, fluid_sfont_t, and fluid_preset_t.

To add a new SoundFont loader to the synthesizer, you call fluid_synth_add_sfloader() and pass a pointer to an fluid_sfloader_t structure. The important callback function in this structure os "load", which should try to load a file and returns a fluid_sfont_t structure, or NULL if it fails.

The fluid_sfont_t structure contains a callback to obtain the name of the soundfont. It contains two functions to iterate though the contained presets, and one function to obtain a preset corresponding to a bank and preset number. This function should return an fluid_preset_t structure.

The fluid_preset_t structure contains some functions to obtain information from the preset (name, bank, number). The most important callback is the noteon function. The noteon function should 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 increments the values of a generator, use fluid_voice_gen_{set,incr}. When you are finished initializing the voice call fluid_voice_start() to start playing the synthesis voice.

Enumeration values:
FLUID_PRESET_SELECTED 
FLUID_PRESET_UNSELECTED 
FLUID_SAMPLE_DONE 

Definition at line 63 of file sfont.h.


Generated on Thu Mar 13 19:09:35 2003 for libfluidsynth by doxygen1.2.15