Go to the source code of this file.
Defines | |
#define | FLUID_REVERB_DEFAULT_ROOMSIZE 0.2f |
#define | FLUID_REVERB_DEFAULT_DAMP 0.0f |
#define | FLUID_REVERB_DEFAULT_WIDTH 0.5f |
#define | FLUID_REVERB_DEFAULT_LEVEL 0.9f |
#define | FLUID_CHORUS_DEFAULT_N 3 |
#define | FLUID_CHORUS_DEFAULT_LEVEL 2.0f |
#define | FLUID_CHORUS_DEFAULT_SPEED 0.3f |
#define | FLUID_CHORUS_DEFAULT_DEPTH 8.0f |
#define | FLUID_CHORUS_DEFAULT_TYPE FLUID_CHORUS_MOD_SINE |
Typedefs | |
typedef int(* | fluid_audio_callback_t )(fluid_synth_t *synth, int len, void *out1, int loff, int lincr, void *out2, int roff, int rincr) |
Enumerations | |
enum | fluid_chorus_mod { FLUID_CHORUS_MOD_SINE = 0, FLUID_CHORUS_MOD_TRIANGLE = 1 } |
enum | fluid_interp { FLUID_INTERP_NONE = 0, FLUID_INTERP_LINEAR = 1, FLUID_INTERP_DEFAULT = 4, FLUID_INTERP_4THORDER = 4, FLUID_INTERP_7THORDER = 7, FLUID_INTERP_HIGHEST = 7 } |
Functions | |
FLUIDSYNTH_API fluid_synth_t * | new_fluid_synth (fluid_settings_t *settings) |
Creates a new synthesizer object. | |
FLUIDSYNTH_API int | delete_fluid_synth (fluid_synth_t *synth) |
Deletes the synthesizer previously created with new_fluid_synth. | |
FLUIDSYNTH_API fluid_settings_t * | fluid_synth_get_settings (fluid_synth_t *synth) |
Get a reference to the settings of the synthesizer. | |
FLUIDSYNTH_API int | fluid_synth_noteon (fluid_synth_t *synth, int chan, int key, int vel) |
Send a noteon message. | |
FLUIDSYNTH_API int | fluid_synth_noteoff (fluid_synth_t *synth, int chan, int key) |
Send a noteoff message. | |
FLUIDSYNTH_API int | fluid_synth_cc (fluid_synth_t *synth, int chan, int ctrl, int val) |
Send a control change message. | |
FLUIDSYNTH_API int | fluid_synth_get_cc (fluid_synth_t *synth, int chan, int ctrl, int *pval) |
Get a control value. | |
FLUIDSYNTH_API int | fluid_synth_pitch_bend (fluid_synth_t *synth, int chan, int val) |
Send a pitch bend message. | |
FLUIDSYNTH_API int | fluid_synth_get_pitch_bend (fluid_synth_t *synth, int chan, int *ppitch_bend) |
Get the pitch bend value. | |
FLUIDSYNTH_API int | fluid_synth_pitch_wheel_sens (fluid_synth_t *synth, int chan, int val) |
Set the pitch wheel sensitivity. | |
FLUIDSYNTH_API int | fluid_synth_program_change (fluid_synth_t *synth, int chan, int program) |
Send a program change message. | |
FLUIDSYNTH_API int | fluid_synth_bank_select (fluid_synth_t *synth, int chan, unsigned int bank) |
Select a bank. | |
FLUIDSYNTH_API int | fluid_synth_sfont_select (fluid_synth_t *synth, int chan, unsigned int sfont_id) |
Select a sfont. | |
FLUIDSYNTH_API int | fluid_synth_program_select (fluid_synth_t *synth, int chan, unsigned int sfont_id, unsigned int bank_num, unsigned int preset_num) |
Select a preset for a channel. | |
FLUIDSYNTH_API int | fluid_synth_get_program (fluid_synth_t *synth, int chan, unsigned int *sfont_id, unsigned int *bank_num, unsigned int *preset_num) |
Returns the program, bank, and SoundFont number of the preset on a given channel. | |
FLUIDSYNTH_API int | fluid_synth_program_reset (fluid_synth_t *synth) |
Send a bank select and a program change to every channel to reinitialize the preset of the channel. | |
FLUIDSYNTH_API int | fluid_synth_system_reset (fluid_synth_t *synth) |
Send a reset. | |
FLUIDSYNTH_API int | fluid_synth_sfload (fluid_synth_t *synth, const char *filename, int reset_presets) |
Load a SoundFont. | |
FLUIDSYNTH_API int | fluid_synth_sfreload (fluid_synth_t *synth, unsigned int id) |
Reload a SoundFont. | |
FLUIDSYNTH_API int | fluid_synth_sfunload (fluid_synth_t *synth, unsigned int id, int reset_presets) |
Remove a SoundFont from the stack. | |
FLUIDSYNTH_API int | fluid_synth_add_sfont (fluid_synth_t *synth, fluid_sfont_t *sfont) |
Add a SoundFont. | |
FLUIDSYNTH_API int | fluid_synth_sfcount (fluid_synth_t *synth) |
Count the number of loaded SoundFonts. | |
FLUIDSYNTH_API fluid_sfont_t * | fluid_synth_get_sfont (fluid_synth_t *synth, unsigned int num) |
Get a SoundFont. | |
FLUIDSYNTH_API fluid_sfont_t * | fluid_synth_get_sfont_by_id (fluid_synth_t *synth, unsigned int id) |
Get a SoundFont. | |
FLUIDSYNTH_API fluid_preset_t * | fluid_synth_get_channel_preset (fluid_synth_t *synth, int chan) |
Get the preset of a channel. | |
FLUIDSYNTH_API void | fluid_synth_set_reverb (fluid_synth_t *synth, double roomsize, double damping, double width, double level) |
Set the parameters for the built-in reverb unit. | |
FLUIDSYNTH_API void | fluid_synth_set_reverb_on (fluid_synth_t *synth, int on) |
Turn on (1) / off (0) the built-in reverb unit. | |
FLUIDSYNTH_API double | fluid_synth_get_reverb_roomsize (fluid_synth_t *synth) |
Query the current state of the reverb. | |
FLUIDSYNTH_API double | fluid_synth_get_reverb_damp (fluid_synth_t *synth) |
FLUIDSYNTH_API double | fluid_synth_get_reverb_level (fluid_synth_t *synth) |
FLUIDSYNTH_API double | fluid_synth_get_reverb_width (fluid_synth_t *synth) |
FLUIDSYNTH_API void | fluid_synth_set_chorus (fluid_synth_t *synth, int nr, double level, double speed, double depth_ms, int type) |
Set up the chorus. | |
FLUIDSYNTH_API void | fluid_synth_set_chorus_on (fluid_synth_t *synth, int on) |
Turn on (1) / off (0) the built-in chorus unit. | |
FLUIDSYNTH_API int | fluid_synth_get_chorus_nr (fluid_synth_t *synth) |
Query the current state of the chorus. | |
FLUIDSYNTH_API double | fluid_synth_get_chorus_level (fluid_synth_t *synth) |
FLUIDSYNTH_API double | fluid_synth_get_chorus_speed_Hz (fluid_synth_t *synth) |
FLUIDSYNTH_API double | fluid_synth_get_chorus_depth_ms (fluid_synth_t *synth) |
FLUIDSYNTH_API int | fluid_synth_get_chorus_type (fluid_synth_t *synth) |
FLUIDSYNTH_API int | fluid_synth_count_midi_channels (fluid_synth_t *synth) |
Returns the number of MIDI channels that the synthesizer uses internally. | |
FLUIDSYNTH_API int | fluid_synth_count_audio_channels (fluid_synth_t *synth) |
Returns the number of audio channels that the synthesizer uses internally. | |
FLUIDSYNTH_API int | fluid_synth_count_audio_groups (fluid_synth_t *synth) |
Returns the number of audio groups that the synthesizer uses internally. | |
FLUIDSYNTH_API int | fluid_synth_count_effects_channels (fluid_synth_t *synth) |
Returns the number of effects channels that the synthesizer uses internally. | |
FLUIDSYNTH_API void | fluid_synth_set_gain (fluid_synth_t *synth, float gain) |
Set the master gain. | |
FLUIDSYNTH_API float | fluid_synth_get_gain (fluid_synth_t *synth) |
Get the master gain. | |
FLUIDSYNTH_API int | fluid_synth_get_internal_bufsize (fluid_synth_t *synth) |
Get the internal buffer size. | |
FLUIDSYNTH_API int | fluid_synth_set_interp_method (fluid_synth_t *synth, int chan, int interp_method) |
Set the interpolation method for one channel or all channels (chan = -1). | |
FLUIDSYNTH_API int | fluid_synth_set_gen (fluid_synth_t *synth, int chan, int param, float value) |
Change the value of a generator. | |
FLUIDSYNTH_API float | fluid_synth_get_gen (fluid_synth_t *synth, int chan, int param) |
Retreive the value of a generator. | |
FLUIDSYNTH_API int | fluid_synth_create_key_tuning (fluid_synth_t *synth, int tuning_bank, int tuning_prog, char *name, double *pitch) |
Create a new key-based tuning with given name, number, and pitches. | |
FLUIDSYNTH_API int | fluid_synth_create_octave_tuning (fluid_synth_t *synth, int tuning_bank, int tuning_prog, char *name, double *pitch) |
Create a new octave-based tuning with given name, number, and pitches. | |
FLUIDSYNTH_API int | fluid_synth_tune_notes (fluid_synth_t *synth, int tuning_bank, int tuning_prog, int len, int *keys, double *pitch, int apply) |
Request a note tuning changes. | |
FLUIDSYNTH_API int | fluid_synth_select_tuning (fluid_synth_t *synth, int chan, int tuning_bank, int tuning_prog) |
Select a tuning for a channel. | |
FLUIDSYNTH_API int | fluid_synth_reset_tuning (fluid_synth_t *synth, int chan) |
Set the tuning to the default well-tempered tuning on a channel. | |
FLUIDSYNTH_API void | fluid_synth_tuning_iteration_start (fluid_synth_t *synth) |
Start the iteration throught the list of available tunings. | |
FLUIDSYNTH_API int | fluid_synth_tuning_iteration_next (fluid_synth_t *synth, int *bank, int *prog) |
Get the next tuning in the iteration. | |
FLUIDSYNTH_API int | fluid_synth_tuning_dump (fluid_synth_t *synth, int bank, int prog, char *name, int len, double *pitch) |
Dump the data of a tuning. | |
FLUIDSYNTH_API double | fluid_synth_get_cpu_load (fluid_synth_t *synth) |
Get an estimation of the CPU load due to the audio synthesis. | |
FLUIDSYNTH_API char * | fluid_synth_error (fluid_synth_t *synth) |
Get a textual representation of the last error. | |
FLUIDSYNTH_API int | fluid_synth_write_s16 (fluid_synth_t *synth, int len, void *lout, int loff, int lincr, void *rout, int roff, int rincr) |
Generate a number of samples. | |
FLUIDSYNTH_API int | fluid_synth_write_float (fluid_synth_t *synth, int len, void *lout, int loff, int lincr, void *rout, int roff, int rincr) |
Generate a number of samples. | |
FLUIDSYNTH_API int | fluid_synth_nwrite_float (fluid_synth_t *synth, int len, float **left, float **right, float **fx_left, float **fx_right) |
FLUIDSYNTH_API int | fluid_synth_process (fluid_synth_t *synth, int len, int nin, float **in, int nout, float **out) |
Generate a number of samples. | |
FLUIDSYNTH_API void | fluid_synth_add_sfloader (fluid_synth_t *synth, fluid_sfloader_t *loader) |
Add a SoundFont loader to the synthesizer. | |
FLUIDSYNTH_API fluid_voice_t * | fluid_synth_alloc_voice (fluid_synth_t *synth, fluid_sample_t *sample, int channum, int key, int vel) |
Allocate a synthesis voice. | |
FLUIDSYNTH_API void | fluid_synth_start_voice (fluid_synth_t *synth, fluid_voice_t *voice) |
Start a synthesis voice. | |
FLUIDSYNTH_API void | fluid_synth_get_voicelist (fluid_synth_t *synth, fluid_voice_t *buf[], int bufsize, int ID) |
Write a list of all voices matching ID into buf, but not more than bufsize voices. | |
FLUIDSYNTH_API int | fluid_synth_handle_midi_event (void *data, fluid_midi_event_t *event) |
Callback function for the MIDI router. | |
FLUIDSYNTH_API void | fluid_synth_set_midi_router (fluid_synth_t *synth, fluid_midi_router_t *router) |
This is a hack to get command handlers working. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Deletes the synthesizer previously created with new_fluid_synth.
|
|
Add a SoundFont loader to the synthesizer. Note that SoundFont loader don't necessarily load SoundFonts. They can load any type of wavetable data but export a SoundFont interface. |
|
Add a SoundFont. The SoundFont will be put on top of the SoundFont stack.
|
|
Allocate a synthesis voice. This function is called by a soundfont's preset in response to a noteon event. The returned voice comes with default modulators installed (velocity-to-attenuation, velocity to filter, ...) Note: A single noteon event may create any number of voices, when the preset is layered. Typically 1 (mono) or 2 (stereo). |
|
Select a bank.
|
|
Send a control change message.
|
|
Returns the number of audio channels that the synthesizer uses internally.
|
|
Returns the number of audio groups that the synthesizer uses internally. This is usually identical to audio_channels. |
|
Returns the number of effects channels that the synthesizer uses internally.
|
|
Returns the number of MIDI channels that the synthesizer uses internally.
|
|
Create a new key-based tuning with given name, number, and pitches. The array 'pitches' should have length 128 and contains the pitch in cents of every key in cents. However, if 'pitches' is NULL, a new tuning is created with the well-tempered scale.
|
|
Create a new octave-based tuning with given name, number, and pitches. The array 'pitches' should have length 12 and contains derivation in cents from the well-tempered scale. For example, if pitches[0] equals -33, then the C-keys will be tuned 33 cents below the well-tempered C.
|
|
Get a textual representation of the last error.
|
|
Get a control value.
|
|
Get the preset of a channel.
|
|
|
|
|
|
Query the current state of the chorus.
|
|
|
|
|
|
Get an estimation of the CPU load due to the audio synthesis. Returns a percentage (0-100).
|
|
Get the master gain.
|
|
Retreive the value of a generator. This function returns the value set by a previous call 'fluid_synth_set_gen' or by an NRPN message.
|
|
Get the internal buffer size. The internal buffer size if not the same thing as the buffer size specified in the settings. Internally, the synth *always* uses a specific buffer size independent of the buffer size used by the audio driver. The internal buffer size is normally 64 samples. The reason why it uses an internal buffer size is to allow audio drivers to call the synthesizer with a variable buffer length. The internal buffer size is useful for client who want to optimize their buffer sizes. |
|
Get the pitch bend value.
|
|
Returns the program, bank, and SoundFont number of the preset on a given channel.
|
|
|
|
|
|
Query the current state of the reverb.
|
|
|
|
Get a reference to the settings of the synthesizer.
|
|
Get a SoundFont. The SoundFont is specified by its index on the stack. The top of the stack has index zero.
|
|
Get a SoundFont. The SoundFont is specified by its ID.
|
|
Write a list of all voices matching ID into buf, but not more than bufsize voices. If ID <0, return all voices. |
|
Callback function for the MIDI router. Any event goes through this. |
|
Send a noteoff message.
|
|
Send a noteon message.
|
|
|
|
Send a pitch bend message.
|
|
Set the pitch wheel sensitivity.
|
|
Generate a number of samples. This function implements the default interface defined in fluidsynth/audio.h. This function ignores the input buffers and expects at least two output buffer.
|
|
Send a program change message.
|
|
Send a bank select and a program change to every channel to reinitialize the preset of the channel. This function is useful mainly after a SoundFont has been loaded, unloaded or reloaded. |
|
Select a preset for a channel. The preset is specified by the SoundFont ID, the bank number, and the preset number. This allows any preset to be selected and circumvents preset masking due to previously loaded SoundFonts on the SoundFont stack.
|
|
Set the tuning to the default well-tempered tuning on a channel.
|
|
Select a tuning for a channel.
|
|
Set up the chorus. It should be turned on with fluid_synth_set_chorus_on. If faulty parameters are given, all new settings are discarded. Keep in mind, that the needed CPU time is proportional to 'nr'. |
|
Turn on (1) / off (0) the built-in chorus unit.
|
|
Set the master gain.
|
|
Change the value of a generator. This function allows to control all synthesis parameters in real-time. The changes are additive, i.e. they add up to the existing parameter value. This function is similar to sending an NRPN message to the synthesizer. The function accepts a float as the value of the parameter. The parameter numbers and ranges are described in the SoundFont 2.01 specification, paragraph 8.1.3, page 48. See also 'fluid_gen_type'.
|
|
Set the interpolation method for one channel or all channels (chan = -1).
|
|
This is a hack to get command handlers working.
|
|
Set the parameters for the built-in reverb unit.
|
|
Turn on (1) / off (0) the built-in reverb unit.
|
|
Count the number of loaded SoundFonts.
|
|
Load a SoundFont. 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.
|
|
Select a sfont.
|
|
Reload a SoundFont. The reloaded SoundFont retains its ID and index on the stack.
|
|
Remove a SoundFont from the stack.
|
|
Start a synthesis voice. This function is called by a soundfont's preset in response to a noteon event after the voice has been allocated with fluid_synth_alloc_voice() and initialized. Exclusive classes are processed here. |
|
Send a reset. A reset turns all the notes off and resets the controller values. |
|
Request a note tuning changes. Both they 'keys' and 'pitches' arrays should be of length 'num_pitches'. If 'apply' is non-zero, the changes should be applied in real-time, i.e. sounding notes will have their pitch updated. 'APPLY' IS CURRENTLY IGNORED. The changes will be available for newly triggered notes only.
|
|
Dump the data of a tuning. This functions stores the name and pitch values of a tuning in the pointers given as arguments. Both name and pitch can be NULL is the data is not needed.
|
|
Get the next tuning in the iteration. This functions stores the bank and program number of the next tuning in the pointers given as arguments.
|
|
Start the iteration throught the list of available tunings.
|
|
Generate a number of samples. This function expects two floating point buffers (left and right channel) that will be filled with samples.
|
|
Generate a number of samples. This function expects two signed 16bits buffers (left and right channel) that will be filled with samples.
|
|
Creates a new synthesizer object. Creates a new synthesizer object. As soon as the synthesizer is created, it will start playing.
|