libfluidsynth
2.1.1
|
Embeddable SoundFont synthesizer. More...
Functions | |
FLUIDSYNTH_API fluid_synth_t * | new_fluid_synth (fluid_settings_t *settings) |
Create new FluidSynth instance. More... | |
FLUIDSYNTH_API void | delete_fluid_synth (fluid_synth_t *synth) |
Delete a FluidSynth instance. More... | |
FLUIDSYNTH_API fluid_settings_t * | fluid_synth_get_settings (fluid_synth_t *synth) |
Get settings assigned to a synth. More... | |
FLUIDSYNTH_API int | fluid_synth_noteon (fluid_synth_t *synth, int chan, int key, int vel) |
Send a note-on event to a FluidSynth object. More... | |
FLUIDSYNTH_API int | fluid_synth_noteoff (fluid_synth_t *synth, int chan, int key) |
Sends a note-off event to a FluidSynth object. More... | |
FLUIDSYNTH_API int | fluid_synth_cc (fluid_synth_t *synth, int chan, int ctrl, int val) |
Send a MIDI controller event on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_get_cc (fluid_synth_t *synth, int chan, int ctrl, int *pval) |
Get current MIDI controller value on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_sysex (fluid_synth_t *synth, const char *data, int len, char *response, int *response_len, int *handled, int dryrun) |
Process a MIDI SYSEX (system exclusive) message. More... | |
FLUIDSYNTH_API int | fluid_synth_pitch_bend (fluid_synth_t *synth, int chan, int val) |
Set the MIDI pitch bend controller value on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_get_pitch_bend (fluid_synth_t *synth, int chan, int *ppitch_bend) |
Get the MIDI pitch bend controller value on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_pitch_wheel_sens (fluid_synth_t *synth, int chan, int val) |
Set MIDI pitch wheel sensitivity on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_get_pitch_wheel_sens (fluid_synth_t *synth, int chan, int *pval) |
Get MIDI pitch wheel sensitivity on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_program_change (fluid_synth_t *synth, int chan, int program) |
Send a program change event on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_channel_pressure (fluid_synth_t *synth, int chan, int val) |
Set the MIDI channel pressure controller value. More... | |
FLUIDSYNTH_API int | fluid_synth_key_pressure (fluid_synth_t *synth, int chan, int key, int val) |
Set the MIDI polyphonic key pressure controller value. More... | |
FLUIDSYNTH_API int | fluid_synth_bank_select (fluid_synth_t *synth, int chan, int bank) |
Set instrument bank number on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_sfont_select (fluid_synth_t *synth, int chan, int sfont_id) |
Set SoundFont ID on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_program_select (fluid_synth_t *synth, int chan, int sfont_id, int bank_num, int preset_num) |
Select an instrument on a MIDI channel by SoundFont ID, bank and program numbers. More... | |
FLUIDSYNTH_API int | fluid_synth_program_select_by_sfont_name (fluid_synth_t *synth, int chan, const char *sfont_name, int bank_num, int preset_num) |
Select an instrument on a MIDI channel by SoundFont name, bank and program numbers. More... | |
FLUIDSYNTH_API int | fluid_synth_get_program (fluid_synth_t *synth, int chan, int *sfont_id, int *bank_num, int *preset_num) |
Get current SoundFont ID, bank number and program number for a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_unset_program (fluid_synth_t *synth, int chan) |
Set the preset of a MIDI channel to an unassigned state. More... | |
FLUIDSYNTH_API int | fluid_synth_program_reset (fluid_synth_t *synth) |
Resend a bank select and a program change for every channel and assign corresponding instruments. More... | |
FLUIDSYNTH_API int | fluid_synth_system_reset (fluid_synth_t *synth) |
Send MIDI system reset command (big red 'panic' button), turns off notes, resets controllers and restores initial basic channel configuration. More... | |
FLUIDSYNTH_API int | fluid_synth_all_notes_off (fluid_synth_t *synth, int chan) |
Turn off all voices that are playing on the given MIDI channel, by putting them into release phase. More... | |
FLUIDSYNTH_API int | fluid_synth_all_sounds_off (fluid_synth_t *synth, int chan) |
Immediately stop all voices on the given MIDI channel (skips release phase). More... | |
FLUIDSYNTH_API int | fluid_synth_set_channel_type (fluid_synth_t *synth, int chan, int type) |
Set midi channel type. More... | |
FLUIDSYNTH_API fluid_preset_t * | fluid_synth_get_channel_preset (fluid_synth_t *synth, int chan) |
Get active preset on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_start (fluid_synth_t *synth, unsigned int id, fluid_preset_t *preset, int audio_chan, int midi_chan, int key, int vel) |
Create and start voices using a preset and a MIDI note on event. More... | |
FLUIDSYNTH_API int | fluid_synth_stop (fluid_synth_t *synth, unsigned int id) |
Stop notes for a given note event voice ID. More... | |
FLUIDSYNTH_API int | fluid_synth_sfload (fluid_synth_t *synth, const char *filename, int reset_presets) |
Load a SoundFont file (filename is interpreted by SoundFont loaders). More... | |
FLUIDSYNTH_API int | fluid_synth_sfreload (fluid_synth_t *synth, int id) |
Reload a SoundFont. More... | |
FLUIDSYNTH_API int | fluid_synth_sfunload (fluid_synth_t *synth, int id, int reset_presets) |
Unload a SoundFont. More... | |
FLUIDSYNTH_API int | fluid_synth_add_sfont (fluid_synth_t *synth, fluid_sfont_t *sfont) |
Add a SoundFont. More... | |
FLUIDSYNTH_API int | fluid_synth_remove_sfont (fluid_synth_t *synth, fluid_sfont_t *sfont) |
Remove a SoundFont from the SoundFont stack without deleting it. More... | |
FLUIDSYNTH_API int | fluid_synth_sfcount (fluid_synth_t *synth) |
Count number of loaded SoundFont files. More... | |
FLUIDSYNTH_API fluid_sfont_t * | fluid_synth_get_sfont (fluid_synth_t *synth, unsigned int num) |
Get SoundFont by index. More... | |
FLUIDSYNTH_API fluid_sfont_t * | fluid_synth_get_sfont_by_id (fluid_synth_t *synth, int id) |
Get SoundFont by ID. More... | |
FLUIDSYNTH_API fluid_sfont_t * | fluid_synth_get_sfont_by_name (fluid_synth_t *synth, const char *name) |
Get SoundFont by name. More... | |
FLUIDSYNTH_API int | fluid_synth_set_bank_offset (fluid_synth_t *synth, int sfont_id, int offset) |
Offset the bank numbers of a loaded SoundFont, i.e. subtract offset from any bank number when assigning instruments. More... | |
FLUIDSYNTH_API int | fluid_synth_get_bank_offset (fluid_synth_t *synth, int sfont_id) |
Get bank offset of a loaded SoundFont. More... | |
FLUIDSYNTH_API int | fluid_synth_set_reverb (fluid_synth_t *synth, double roomsize, double damping, double width, double level) |
Set reverb parameters. More... | |
FLUIDSYNTH_API int | fluid_synth_set_reverb_roomsize (fluid_synth_t *synth, double roomsize) |
Set reverb roomsize. More... | |
FLUIDSYNTH_API int | fluid_synth_set_reverb_damp (fluid_synth_t *synth, double damping) |
Set reverb damping. More... | |
FLUIDSYNTH_API int | fluid_synth_set_reverb_width (fluid_synth_t *synth, double width) |
Set reverb width. More... | |
FLUIDSYNTH_API int | fluid_synth_set_reverb_level (fluid_synth_t *synth, double level) |
Set reverb level. More... | |
FLUIDSYNTH_API void | fluid_synth_set_reverb_on (fluid_synth_t *synth, int on) |
Enable or disable reverb effect. More... | |
FLUIDSYNTH_API double | fluid_synth_get_reverb_roomsize (fluid_synth_t *synth) |
Get reverb room size. More... | |
FLUIDSYNTH_API double | fluid_synth_get_reverb_damp (fluid_synth_t *synth) |
Get reverb damping. More... | |
FLUIDSYNTH_API double | fluid_synth_get_reverb_level (fluid_synth_t *synth) |
Get reverb level. More... | |
FLUIDSYNTH_API double | fluid_synth_get_reverb_width (fluid_synth_t *synth) |
Get reverb width. More... | |
FLUIDSYNTH_API int | fluid_synth_set_chorus (fluid_synth_t *synth, int nr, double level, double speed, double depth_ms, int type) |
Set chorus parameters. More... | |
FLUIDSYNTH_API int | fluid_synth_set_chorus_nr (fluid_synth_t *synth, int nr) |
Set the chorus voice count. More... | |
FLUIDSYNTH_API int | fluid_synth_set_chorus_level (fluid_synth_t *synth, double level) |
Set the chorus level. More... | |
FLUIDSYNTH_API int | fluid_synth_set_chorus_speed (fluid_synth_t *synth, double speed) |
Set the chorus speed. More... | |
FLUIDSYNTH_API int | fluid_synth_set_chorus_depth (fluid_synth_t *synth, double depth_ms) |
Set the chorus depth. More... | |
FLUIDSYNTH_API int | fluid_synth_set_chorus_type (fluid_synth_t *synth, int type) |
Set the chorus type. More... | |
FLUIDSYNTH_API void | fluid_synth_set_chorus_on (fluid_synth_t *synth, int on) |
Enable or disable chorus effect. More... | |
FLUIDSYNTH_API int | fluid_synth_get_chorus_nr (fluid_synth_t *synth) |
Get chorus voice number (delay line count) value. More... | |
FLUIDSYNTH_API double | fluid_synth_get_chorus_level (fluid_synth_t *synth) |
Get chorus level. More... | |
FLUIDSYNTH_API double | fluid_synth_get_chorus_speed (fluid_synth_t *synth) |
Get chorus speed in Hz. More... | |
FLUIDSYNTH_API double | fluid_synth_get_chorus_depth (fluid_synth_t *synth) |
Get chorus depth. More... | |
FLUIDSYNTH_API int | fluid_synth_get_chorus_type (fluid_synth_t *synth) |
Get chorus waveform type. More... | |
FLUIDSYNTH_API int | fluid_synth_count_midi_channels (fluid_synth_t *synth) |
Get the total count of MIDI channels. More... | |
FLUIDSYNTH_API int | fluid_synth_count_audio_channels (fluid_synth_t *synth) |
Get the total count of audio channels. More... | |
FLUIDSYNTH_API int | fluid_synth_count_audio_groups (fluid_synth_t *synth) |
Get the total number of allocated audio channels. More... | |
FLUIDSYNTH_API int | fluid_synth_count_effects_channels (fluid_synth_t *synth) |
Get the total number of allocated effects channels. More... | |
FLUIDSYNTH_API int | fluid_synth_count_effects_groups (fluid_synth_t *synth) |
Get the total number of allocated effects units. More... | |
FLUID_DEPRECATED FLUIDSYNTH_API void | fluid_synth_set_sample_rate (fluid_synth_t *synth, float sample_rate) |
Set up an event to change the sample-rate of the synth during the next rendering call. More... | |
FLUIDSYNTH_API void | fluid_synth_set_gain (fluid_synth_t *synth, float gain) |
Set synth output gain value. More... | |
FLUIDSYNTH_API float | fluid_synth_get_gain (fluid_synth_t *synth) |
Get synth output gain value. More... | |
FLUIDSYNTH_API int | fluid_synth_set_polyphony (fluid_synth_t *synth, int polyphony) |
Set synthesizer polyphony (max number of voices). More... | |
FLUIDSYNTH_API int | fluid_synth_get_polyphony (fluid_synth_t *synth) |
Get current synthesizer polyphony (max number of voices). More... | |
FLUIDSYNTH_API int | fluid_synth_get_active_voice_count (fluid_synth_t *synth) |
Get current number of active voices. More... | |
FLUIDSYNTH_API int | fluid_synth_get_internal_bufsize (fluid_synth_t *synth) |
Get the internal synthesis buffer size value. More... | |
FLUIDSYNTH_API int | fluid_synth_set_interp_method (fluid_synth_t *synth, int chan, int interp_method) |
Set synthesis interpolation method on one or all MIDI channels. More... | |
FLUIDSYNTH_API int | fluid_synth_set_gen (fluid_synth_t *synth, int chan, int param, float value) |
Apply an offset to a SoundFont generator on a MIDI channel. More... | |
FLUIDSYNTH_API float | fluid_synth_get_gen (fluid_synth_t *synth, int chan, int param) |
Retrieve the generator NRPN offset assigned to a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_activate_key_tuning (fluid_synth_t *synth, int bank, int prog, const char *name, const double *pitch, int apply) |
Set the tuning of the entire MIDI note scale. More... | |
FLUIDSYNTH_API int | fluid_synth_activate_octave_tuning (fluid_synth_t *synth, int bank, int prog, const char *name, const double *pitch, int apply) |
Activate an octave tuning on every octave in the MIDI note scale. More... | |
FLUIDSYNTH_API int | fluid_synth_tune_notes (fluid_synth_t *synth, int bank, int prog, int len, const int *keys, const double *pitch, int apply) |
Set tuning values for one or more MIDI notes for an existing tuning. More... | |
FLUIDSYNTH_API int | fluid_synth_activate_tuning (fluid_synth_t *synth, int chan, int bank, int prog, int apply) |
Activate a tuning scale on a MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_deactivate_tuning (fluid_synth_t *synth, int chan, int apply) |
Clear tuning scale on a MIDI channel (use default equal tempered scale). More... | |
FLUIDSYNTH_API void | fluid_synth_tuning_iteration_start (fluid_synth_t *synth) |
Start tuning iteration. More... | |
FLUIDSYNTH_API int | fluid_synth_tuning_iteration_next (fluid_synth_t *synth, int *bank, int *prog) |
Advance to next tuning. More... | |
FLUIDSYNTH_API int | fluid_synth_tuning_dump (fluid_synth_t *synth, int bank, int prog, char *name, int len, double *pitch) |
Get the entire note tuning for a given MIDI bank and program. More... | |
FLUIDSYNTH_API double | fluid_synth_get_cpu_load (fluid_synth_t *synth) |
Get the synth CPU load value. More... | |
FLUID_DEPRECATED FLUIDSYNTH_API const char * | fluid_synth_error (fluid_synth_t *synth) |
Get a textual representation of the last error. More... | |
FLUIDSYNTH_API int | fluid_synth_add_default_mod (fluid_synth_t *synth, const fluid_mod_t *mod, int mode) |
Adds the specified modulator mod as default modulator to the synth. More... | |
FLUIDSYNTH_API int | fluid_synth_remove_default_mod (fluid_synth_t *synth, const fluid_mod_t *mod) |
Removes the specified modulator mod from the synth's default modulator list. More... | |
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) |
Synthesize a block of 16 bit audio samples to audio buffers. More... | |
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) |
Synthesize a block of floating point audio samples to audio buffers. More... | |
FLUID_DEPRECATED FLUIDSYNTH_API int | fluid_synth_nwrite_float (fluid_synth_t *synth, int len, float **left, float **right, float **fx_left, float **fx_right) |
Synthesize a block of floating point audio to separate audio buffers (multichannel rendering). More... | |
FLUIDSYNTH_API int | fluid_synth_process (fluid_synth_t *synth, int len, int nfx, float *fx[], int nout, float *out[]) |
Synthesize floating point audio to stereo audio channels (implements the default interface fluid_audio_func_t). More... | |
FLUIDSYNTH_API void | fluid_synth_add_sfloader (fluid_synth_t *synth, fluid_sfloader_t *loader) |
Add a SoundFont loader to the synth. More... | |
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. More... | |
FLUIDSYNTH_API void | fluid_synth_start_voice (fluid_synth_t *synth, fluid_voice_t *voice) |
Activate a voice previously allocated with fluid_synth_alloc_voice(). More... | |
FLUIDSYNTH_API void | fluid_synth_get_voicelist (fluid_synth_t *synth, fluid_voice_t *buf[], int bufsize, int ID) |
Get list of currently playing voices. More... | |
FLUIDSYNTH_API int | fluid_synth_handle_midi_event (void *data, fluid_midi_event_t *event) |
Handle MIDI event from MIDI router, used as a callback function. More... | |
FLUIDSYNTH_API int | fluid_synth_set_custom_filter (fluid_synth_t *, int type, int flags) |
Configure a general-purpose IIR biquad filter. More... | |
FLUIDSYNTH_API fluid_ladspa_fx_t * | fluid_synth_get_ladspa_fx (fluid_synth_t *synth) |
Return the LADSPA effects instance used by FluidSynth. More... | |
FLUIDSYNTH_API int | fluid_synth_reset_basic_channel (fluid_synth_t *synth, int chan) |
Disables and unassigns all channels from a basic channel group. More... | |
FLUIDSYNTH_API int | fluid_synth_get_basic_channel (fluid_synth_t *synth, int chan, int *basic_chan_out, int *mode_chan_out, int *basic_val_out) |
Returns poly mono mode information of any MIDI channel. More... | |
FLUIDSYNTH_API int | fluid_synth_set_basic_channel (fluid_synth_t *synth, int chan, int mode, int val) |
Sets a new basic channel group only. More... | |
FLUIDSYNTH_API int | fluid_synth_set_legato_mode (fluid_synth_t *synth, int chan, int legatomode) |
API legato mode. More... | |
FLUIDSYNTH_API int | fluid_synth_get_legato_mode (fluid_synth_t *synth, int chan, int *legatomode) |
Gets the legato mode of a channel. More... | |
FLUIDSYNTH_API int | fluid_synth_set_portamento_mode (fluid_synth_t *synth, int chan, int portamentomode) |
API portamento mode. More... | |
FLUIDSYNTH_API int | fluid_synth_get_portamento_mode (fluid_synth_t *synth, int chan, int *portamentomode) |
Gets the portamento mode of a channel. More... | |
FLUIDSYNTH_API int | fluid_synth_set_breath_mode (fluid_synth_t *synth, int chan, int breathmode) |
API breath mode. More... | |
FLUIDSYNTH_API int | fluid_synth_get_breath_mode (fluid_synth_t *synth, int chan, int *breathmode) |
Gets the breath mode of a channel. More... | |
Embeddable SoundFont synthesizer.
You create a new synthesizer with new_fluid_synth() and you destroy it with delete_fluid_synth(). Use the fluid_settings_t structure to specify the synthesizer characteristics.
You have to load a SoundFont in order to hear any sound. For that you use the fluid_synth_sfload() function.
You can use the audio driver functions to open the audio device and create a background audio thread.
The API for sending MIDI events is probably what you expect: fluid_synth_noteon(), fluid_synth_noteoff(), ...
The midi channel type used by fluid_synth_set_channel_type()
Enumerator | |
---|---|
CHANNEL_TYPE_MELODIC | Melodic midi channel. |
CHANNEL_TYPE_DRUM | Drum midi channel. |
enum fluid_chorus_mod |
enum fluid_interp |
Synthesis interpolation method.
enum fluid_synth_add_mod |
Enum used with fluid_synth_add_default_mod() to specify how to handle duplicate modulators.
Enumerator | |
---|---|
FLUID_SYNTH_OVERWRITE | Overwrite any existing matching modulator. |
FLUID_SYNTH_ADD | Sum up modulator amounts. |
Specifies optional settings to use for the custom IIR filter.
Can be bitwise ORed.
Interface to poly/mono mode variables.
Channel mode bits OR-ed together so that it matches with the midi spec: poly omnion (0), mono omnion (1), poly omnioff (2), mono omnioff (3)
Indicates the breath mode a channel is set to.
Indicates the mode a basic channel is set to.
Enumerator | |
---|---|
FLUID_CHANNEL_MODE_MASK | Mask Poly and Omni bits of fluid_channel_mode_flags, usually only used internally. |
FLUID_CHANNEL_MODE_OMNION_POLY | corresponds to MIDI mode 0 |
FLUID_CHANNEL_MODE_OMNION_MONO | corresponds to MIDI mode 1 |
FLUID_CHANNEL_MODE_OMNIOFF_POLY | corresponds to MIDI mode 2 |
FLUID_CHANNEL_MODE_OMNIOFF_MONO | corresponds to MIDI mode 3 |
Interface to mono legato mode.
Indicates the legato mode a channel is set to n1,n2,n3,.. is a legato passage. n1 is the first note, and n2,n3,n4 are played legato with previous note.
Interface to portamento mode.
Indicates the portamento mode a channel is set to
FLUIDSYNTH_API fluid_synth_t* new_fluid_synth | ( | fluid_settings_t * | settings | ) |
Create new FluidSynth instance.
settings | Configuration parameters to use (used directly). |
settings
parameter is used directly and should freed after the synth has been deleted. Further note that you may modify FluidSettings of the settings
instance. However, only those FluidSettings marked as 'realtime' will affect the synth immediately. References delete_fluid_synth(), FLUID_CHANNEL_MODE_OMNION_POLY, FLUID_ERR, FLUID_OK, fluid_settings_dupstr(), fluid_settings_getint(), fluid_settings_getnum(), fluid_settings_setint(), fluid_settings_str_equal(), FLUID_SYNTH_ADD, fluid_synth_add_default_mod(), fluid_synth_add_sfloader(), fluid_synth_set_chorus_on(), fluid_synth_set_reverb_on(), FLUID_WARN, and new_fluid_defsfloader().
FLUIDSYNTH_API void delete_fluid_synth | ( | fluid_synth_t * | synth | ) |
Delete a FluidSynth instance.
synth | FluidSynth instance to delete |
References fluid_voice_is_playing().
Referenced by new_fluid_synth().
FLUIDSYNTH_API fluid_settings_t* fluid_synth_get_settings | ( | fluid_synth_t * | synth | ) |
Get settings assigned to a synth.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_noteon | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | key, | ||
int | vel | ||
) |
Send a note-on event to a FluidSynth object.
This function will take care of proper legato playing. If a note on channel chan
is already playing at the given key key
, it will be released (even if it is sustained). In other words, overlapping notes are not allowed.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
key | MIDI note number (0-127) |
vel | MIDI velocity (0-127, 0=noteoff) |
References FLUID_FAILED.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_noteoff | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | key | ||
) |
Sends a note-off event to a FluidSynth object.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
key | MIDI note number (0-127) |
References FLUID_FAILED.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_cc | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | num, | ||
int | val | ||
) |
Send a MIDI controller event on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
num | MIDI controller number (0-127) |
val | MIDI controller value (0-127) |
References FLUID_CHANNEL_MODE_MASK, FLUID_CHANNEL_MODE_OMNIOFF_MONO, FLUID_FAILED, and FLUID_INFO.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_get_cc | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | num, | ||
int * | pval | ||
) |
Get current MIDI controller value on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
num | MIDI controller number (0-127) |
pval | Location to store MIDI controller value (0-127) |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_sysex | ( | fluid_synth_t * | synth, |
const char * | data, | ||
int | len, | ||
char * | response, | ||
int * | response_len, | ||
int * | handled, | ||
int | dryrun | ||
) |
Process a MIDI SYSEX (system exclusive) message.
synth | FluidSynth instance |
data | Buffer containing SYSEX data (not including 0xF0 and 0xF7) |
len | Length of data in buffer |
response | Buffer to store response to or NULL to ignore |
response_len | IN/OUT parameter, in: size of response buffer, out: amount of data written to response buffer (if FLUID_FAILED is returned and this value is non-zero, it indicates the response buffer is too small) |
handled | Optional location to store boolean value if message was recognized and handled or not (set to TRUE if it was handled) |
dryrun | TRUE to just do a dry run but not actually execute the SYSEX command (useful for checking if a SYSEX message would be handled) |
References FLUID_FAILED, and FLUID_OK.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_pitch_bend | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | val | ||
) |
Set the MIDI pitch bend controller value on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
val | MIDI pitch bend value (0-16383 with 8192 being center) |
References FLUID_FAILED, and FLUID_INFO.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_get_pitch_bend | ( | fluid_synth_t * | synth, |
int | chan, | ||
int * | ppitch_bend | ||
) |
Get the MIDI pitch bend controller value on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
ppitch_bend | Location to store MIDI pitch bend value (0-16383 with 8192 being center) |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_pitch_wheel_sens | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | val | ||
) |
Set MIDI pitch wheel sensitivity on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
val | Pitch wheel sensitivity value in semitones |
References FLUID_FAILED, and FLUID_INFO.
FLUIDSYNTH_API int fluid_synth_get_pitch_wheel_sens | ( | fluid_synth_t * | synth, |
int | chan, | ||
int * | pval | ||
) |
Get MIDI pitch wheel sensitivity on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
pval | Location to store pitch wheel sensitivity value in semitones |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_program_change | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | prognum | ||
) |
Send a program change event on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
prognum | MIDI program number (0-127) |
References CHANNEL_TYPE_DRUM, FLUID_FAILED, FLUID_INFO, fluid_sfont_get_id(), and FLUID_WARN.
Referenced by fluid_synth_handle_midi_event(), fluid_synth_program_reset(), and fluid_synth_unset_program().
FLUIDSYNTH_API int fluid_synth_channel_pressure | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | val | ||
) |
Set the MIDI channel pressure controller value.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
val | MIDI channel pressure value (0-127) |
References FLUID_FAILED, and FLUID_INFO.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_key_pressure | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | key, | ||
int | val | ||
) |
Set the MIDI polyphonic key pressure controller value.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
key | MIDI key number (0-127) |
val | MIDI key pressure value (0-127) |
References FLUID_FAILED, and FLUID_INFO.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_bank_select | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | bank | ||
) |
Set instrument bank number on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
bank | MIDI bank number |
chan
, as it is usually called prior to fluid_synth_program_change(). If you still want instrument changes to take effect immediately, call fluid_synth_program_reset() after having set up the bank configuration. References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_sfont_select | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | sfont_id | ||
) |
Set SoundFont ID on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
sfont_id | ID of a loaded SoundFont |
chan
, as it is usually called prior to fluid_synth_bank_select() or fluid_synth_program_change(). If you still want instrument changes to take effect immediately, call fluid_synth_program_reset() after having selected the soundfont. References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_program_select | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | sfont_id, | ||
int | bank_num, | ||
int | preset_num | ||
) |
Select an instrument on a MIDI channel by SoundFont ID, bank and program numbers.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
sfont_id | ID of a loaded SoundFont |
bank_num | MIDI bank number |
preset_num | MIDI program number |
References FLUID_ERR, and FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_program_select_by_sfont_name | ( | fluid_synth_t * | synth, |
int | chan, | ||
const char * | sfont_name, | ||
int | bank_num, | ||
int | preset_num | ||
) |
Select an instrument on a MIDI channel by SoundFont name, bank and program numbers.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
sfont_name | Name of a loaded SoundFont |
bank_num | MIDI bank number |
preset_num | MIDI program number |
References FLUID_ERR, FLUID_FAILED, and fluid_sfont_get_id().
FLUIDSYNTH_API int fluid_synth_get_program | ( | fluid_synth_t * | synth, |
int | chan, | ||
int * | sfont_id, | ||
int * | bank_num, | ||
int * | preset_num | ||
) |
Get current SoundFont ID, bank number and program number for a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
sfont_id | Location to store SoundFont ID |
bank_num | Location to store MIDI bank number |
preset_num | Location to store MIDI program number |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_unset_program | ( | fluid_synth_t * | synth, |
int | chan | ||
) |
Set the preset of a MIDI channel to an unassigned state.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
References FLUID_FAILED, and fluid_synth_program_change().
FLUIDSYNTH_API int fluid_synth_program_reset | ( | fluid_synth_t * | synth | ) |
Resend a bank select and a program change for every channel and assign corresponding instruments.
synth | FluidSynth instance |
This function is called mainly after a SoundFont has been loaded, unloaded or reloaded.
References FLUID_FAILED, FLUID_OK, and fluid_synth_program_change().
Referenced by fluid_synth_add_sfont(), fluid_synth_remove_sfont(), fluid_synth_sfload(), and fluid_synth_sfunload().
FLUIDSYNTH_API int fluid_synth_system_reset | ( | fluid_synth_t * | synth | ) |
Send MIDI system reset command (big red 'panic' button), turns off notes, resets controllers and restores initial basic channel configuration.
synth | FluidSynth instance |
References FLUID_FAILED.
Referenced by fluid_synth_handle_midi_event().
FLUIDSYNTH_API int fluid_synth_all_notes_off | ( | fluid_synth_t * | synth, |
int | chan | ||
) |
Turn off all voices that are playing on the given MIDI channel, by putting them into release phase.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1), (chan=-1 selects all channels) |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_all_sounds_off | ( | fluid_synth_t * | synth, |
int | chan | ||
) |
Immediately stop all voices on the given MIDI channel (skips release phase).
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1), (chan=-1 selects all channels) |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_set_channel_type | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | type | ||
) |
Set midi channel type.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
type | MIDI channel type (fluid_midi_channel_type) |
References CHANNEL_TYPE_DRUM, CHANNEL_TYPE_MELODIC, FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API fluid_preset_t* fluid_synth_get_channel_preset | ( | fluid_synth_t * | synth, |
int | chan | ||
) |
Get active preset on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
chan
FLUIDSYNTH_API int fluid_synth_start | ( | fluid_synth_t * | synth, |
unsigned int | id, | ||
fluid_preset_t * | preset, | ||
int | audio_chan, | ||
int | chan, | ||
int | key, | ||
int | vel | ||
) |
Create and start voices using a preset and a MIDI note on event.
synth | FluidSynth instance |
id | Voice group ID to use (can be used with fluid_synth_stop()). |
preset | Preset to synthesize |
audio_chan | Unused currently, set to 0 |
chan | MIDI channel number (0 to MIDI channel count - 1) |
key | MIDI note number (0-127) |
vel | MIDI velocity number (1-127) |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_stop | ( | fluid_synth_t * | synth, |
unsigned int | id | ||
) |
Stop notes for a given note event voice ID.
synth | FluidSynth instance |
id | Voice note event ID |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_sfload | ( | fluid_synth_t * | synth, |
const char * | filename, | ||
int | reset_presets | ||
) |
Load a SoundFont file (filename is interpreted by SoundFont loaders).
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.
synth | FluidSynth instance |
filename | File to load |
reset_presets | TRUE to re-assign presets for all MIDI channels (equivalent to calling fluid_synth_program_reset()) |
References FLUID_ERR, FLUID_FAILED, and fluid_synth_program_reset().
FLUIDSYNTH_API int fluid_synth_sfreload | ( | fluid_synth_t * | synth, |
int | id | ||
) |
Reload a SoundFont.
The SoundFont retains its ID and index on the SoundFont stack.
synth | FluidSynth instance |
id | ID of SoundFont to reload |
References FLUID_ERR, FLUID_FAILED, FLUID_OK, fluid_sfont_get_id(), fluid_sfont_get_name(), and fluid_synth_sfunload().
FLUIDSYNTH_API int fluid_synth_sfunload | ( | fluid_synth_t * | synth, |
int | id, | ||
int | reset_presets | ||
) |
Unload a SoundFont.
synth | FluidSynth instance |
id | ID of SoundFont to unload |
reset_presets | TRUE to re-assign presets for all MIDI channels |
References FLUID_ERR, FLUID_FAILED, FLUID_OK, fluid_sfont_get_id(), and fluid_synth_program_reset().
Referenced by fluid_synth_sfreload().
FLUIDSYNTH_API int fluid_synth_add_sfont | ( | fluid_synth_t * | synth, |
fluid_sfont_t * | sfont | ||
) |
Add a SoundFont.
The SoundFont will be added to the top of the SoundFont stack.
synth | FluidSynth instance |
sfont | SoundFont to add |
References FLUID_FAILED, and fluid_synth_program_reset().
FLUIDSYNTH_API int fluid_synth_remove_sfont | ( | fluid_synth_t * | synth, |
fluid_sfont_t * | sfont | ||
) |
Remove a SoundFont from the SoundFont stack without deleting it.
synth | FluidSynth instance |
sfont | SoundFont to remove |
sfont
successfully removed, FLUID_FAILED otherwiseSoundFont is not freed and is left as the responsibility of the caller.
References FLUID_FAILED, FLUID_OK, and fluid_synth_program_reset().
FLUIDSYNTH_API int fluid_synth_sfcount | ( | fluid_synth_t * | synth | ) |
Count number of loaded SoundFont files.
synth | FluidSynth instance |
FLUIDSYNTH_API fluid_sfont_t* fluid_synth_get_sfont | ( | fluid_synth_t * | synth, |
unsigned int | num | ||
) |
Get SoundFont by index.
synth | FluidSynth instance |
num | SoundFont index on the stack (starting from 0 for top of stack). |
FLUIDSYNTH_API fluid_sfont_t* fluid_synth_get_sfont_by_id | ( | fluid_synth_t * | synth, |
int | id | ||
) |
Get SoundFont by ID.
synth | FluidSynth instance |
id | SoundFont ID |
References fluid_sfont_get_id().
FLUIDSYNTH_API fluid_sfont_t* fluid_synth_get_sfont_by_name | ( | fluid_synth_t * | synth, |
const char * | name | ||
) |
Get SoundFont by name.
synth | FluidSynth instance |
name | Name of SoundFont |
References fluid_sfont_get_name().
FLUIDSYNTH_API int fluid_synth_set_bank_offset | ( | fluid_synth_t * | synth, |
int | sfont_id, | ||
int | offset | ||
) |
Offset the bank numbers of a loaded SoundFont, i.e. subtract offset
from any bank number when assigning instruments.
synth | FluidSynth instance |
sfont_id | ID of a loaded SoundFont |
offset | Bank offset value to apply to all instruments |
References FLUID_ERR, FLUID_FAILED, FLUID_OK, and fluid_sfont_get_id().
FLUIDSYNTH_API int fluid_synth_get_bank_offset | ( | fluid_synth_t * | synth, |
int | sfont_id | ||
) |
Get bank offset of a loaded SoundFont.
synth | FluidSynth instance |
sfont_id | ID of a loaded SoundFont |
References FLUID_ERR, and fluid_sfont_get_id().
FLUIDSYNTH_API int fluid_synth_set_reverb | ( | fluid_synth_t * | synth, |
double | roomsize, | ||
double | damping, | ||
double | width, | ||
double | level | ||
) |
Set reverb parameters.
synth | FluidSynth instance |
roomsize | Reverb room size value (0.0-1.0) |
damping | Reverb damping value (0.0-1.0) |
width | Reverb width value (0.0-100.0) |
level | Reverb level value (0.0-1.0) |
FLUIDSYNTH_API int fluid_synth_set_reverb_roomsize | ( | fluid_synth_t * | synth, |
double | roomsize | ||
) |
Set reverb roomsize.
See fluid_synth_set_reverb() for further info.
FLUIDSYNTH_API int fluid_synth_set_reverb_damp | ( | fluid_synth_t * | synth, |
double | damping | ||
) |
Set reverb damping.
See fluid_synth_set_reverb() for further info.
FLUIDSYNTH_API int fluid_synth_set_reverb_width | ( | fluid_synth_t * | synth, |
double | width | ||
) |
Set reverb width.
See fluid_synth_set_reverb() for further info.
FLUIDSYNTH_API int fluid_synth_set_reverb_level | ( | fluid_synth_t * | synth, |
double | level | ||
) |
Set reverb level.
See fluid_synth_set_reverb() for further info.
FLUIDSYNTH_API void fluid_synth_set_reverb_on | ( | fluid_synth_t * | synth, |
int | on | ||
) |
Enable or disable reverb effect.
synth | FluidSynth instance |
on | TRUE to enable reverb, FALSE to disable |
Referenced by new_fluid_synth().
FLUIDSYNTH_API double fluid_synth_get_reverb_roomsize | ( | fluid_synth_t * | synth | ) |
Get reverb room size.
synth | FluidSynth instance |
FLUIDSYNTH_API double fluid_synth_get_reverb_damp | ( | fluid_synth_t * | synth | ) |
Get reverb damping.
synth | FluidSynth instance |
FLUIDSYNTH_API double fluid_synth_get_reverb_level | ( | fluid_synth_t * | synth | ) |
Get reverb level.
synth | FluidSynth instance |
FLUIDSYNTH_API double fluid_synth_get_reverb_width | ( | fluid_synth_t * | synth | ) |
Get reverb width.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_set_chorus | ( | fluid_synth_t * | synth, |
int | nr, | ||
double | level, | ||
double | speed, | ||
double | depth_ms, | ||
int | type | ||
) |
Set chorus parameters.
It should be turned on with fluid_synth_set_chorus_on(). Keep in mind, that the needed CPU time is proportional to 'nr'.
synth | FluidSynth instance |
nr | Chorus voice count (0-99, CPU time consumption proportional to this value) |
level | Chorus level (0.0-10.0) |
speed | Chorus speed in Hz (0.1-5.0) |
depth_ms | Chorus depth (max value depends on synth sample-rate, 0.0-21.0 is safe for sample-rate values up to 96KHz) |
type | Chorus waveform type (fluid_chorus_mod) |
FLUIDSYNTH_API int fluid_synth_set_chorus_nr | ( | fluid_synth_t * | synth, |
int | nr | ||
) |
Set the chorus voice count.
See fluid_synth_set_chorus() for further info.
FLUIDSYNTH_API int fluid_synth_set_chorus_level | ( | fluid_synth_t * | synth, |
double | level | ||
) |
Set the chorus level.
See fluid_synth_set_chorus() for further info.
FLUIDSYNTH_API int fluid_synth_set_chorus_speed | ( | fluid_synth_t * | synth, |
double | speed | ||
) |
Set the chorus speed.
See fluid_synth_set_chorus() for further info.
FLUIDSYNTH_API int fluid_synth_set_chorus_depth | ( | fluid_synth_t * | synth, |
double | depth_ms | ||
) |
Set the chorus depth.
See fluid_synth_set_chorus() for further info.
FLUIDSYNTH_API int fluid_synth_set_chorus_type | ( | fluid_synth_t * | synth, |
int | type | ||
) |
Set the chorus type.
See fluid_synth_set_chorus() for further info.
FLUIDSYNTH_API void fluid_synth_set_chorus_on | ( | fluid_synth_t * | synth, |
int | on | ||
) |
Enable or disable chorus effect.
synth | FluidSynth instance |
on | TRUE to enable chorus, FALSE to disable |
Referenced by new_fluid_synth().
FLUIDSYNTH_API int fluid_synth_get_chorus_nr | ( | fluid_synth_t * | synth | ) |
Get chorus voice number (delay line count) value.
synth | FluidSynth instance |
FLUIDSYNTH_API double fluid_synth_get_chorus_level | ( | fluid_synth_t * | synth | ) |
Get chorus level.
synth | FluidSynth instance |
FLUIDSYNTH_API double fluid_synth_get_chorus_speed | ( | fluid_synth_t * | synth | ) |
Get chorus speed in Hz.
synth | FluidSynth instance |
FLUIDSYNTH_API double fluid_synth_get_chorus_depth | ( | fluid_synth_t * | synth | ) |
Get chorus depth.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_get_chorus_type | ( | fluid_synth_t * | synth | ) |
Get chorus waveform type.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_count_midi_channels | ( | fluid_synth_t * | synth | ) |
Get the total count of MIDI channels.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_count_audio_channels | ( | fluid_synth_t * | synth | ) |
Get the total count of audio channels.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_count_audio_groups | ( | fluid_synth_t * | synth | ) |
Get the total number of allocated audio channels.
Usually identical to the number of audio channels. Can be employed by LADSPA effects subsystem.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_count_effects_channels | ( | fluid_synth_t * | synth | ) |
Get the total number of allocated effects channels.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_count_effects_groups | ( | fluid_synth_t * | synth | ) |
Get the total number of allocated effects units.
synth | FluidSynth instance |
FLUID_DEPRECATED FLUIDSYNTH_API void fluid_synth_set_sample_rate | ( | fluid_synth_t * | synth, |
float | sample_rate | ||
) |
Set up an event to change the sample-rate of the synth during the next rendering call.
synth
instance is used by an audio driver, because the audio driver cannot be notified by this sample-rate change. Long story short: don't use it. synth | FluidSynth instance |
sample_rate | New sample-rate (Hz) |
FLUIDSYNTH_API void fluid_synth_set_gain | ( | fluid_synth_t * | synth, |
float | gain | ||
) |
Set synth output gain value.
synth | FluidSynth instance |
gain | Gain value (function clamps value to the range 0.0 to 10.0) |
FLUIDSYNTH_API float fluid_synth_get_gain | ( | fluid_synth_t * | synth | ) |
Get synth output gain value.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_set_polyphony | ( | fluid_synth_t * | synth, |
int | polyphony | ||
) |
Set synthesizer polyphony (max number of voices).
synth | FluidSynth instance |
polyphony | Polyphony to assign |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_get_polyphony | ( | fluid_synth_t * | synth | ) |
Get current synthesizer polyphony (max number of voices).
synth | FluidSynth instance |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_get_active_voice_count | ( | fluid_synth_t * | synth | ) |
Get current number of active voices.
I.e. the no. of voices that have been started and have not yet finished. Unless called from synthesis context, this number does not necessarily have to be equal to the number of voices currently processed by the DSP loop, see below.
synth | FluidSynth instance |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_get_internal_bufsize | ( | fluid_synth_t * | synth | ) |
Get the internal synthesis buffer size value.
synth | FluidSynth instance |
Audio is synthesized this number of frames at a time. Defaults to 64 frames.
FLUIDSYNTH_API int fluid_synth_set_interp_method | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | interp_method | ||
) |
Set synthesis interpolation method on one or all MIDI channels.
synth | FluidSynth instance |
chan | MIDI channel to set interpolation method on or -1 for all channels |
interp_method | Interpolation method (fluid_interp) |
References FLUID_ERR, FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_set_gen | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | param, | ||
float | value | ||
) |
Apply an offset to a SoundFont generator on a MIDI channel.
This function allows to set an offset for the specified destination generator in real-time. The offset will be applied immediately to all voices that are currently and subsequently playing on the given MIDI channel. This functionality works equivalent to using NRPN MIDI messages to manipulate synthesis parameters. See SoundFont spec, paragraph 8.1.3, for details on SoundFont generator parameters and valid ranges, as well as paragraph 9.6 for details on NRPN messages.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
param | SoundFont generator ID (fluid_gen_type) |
value | Offset value (in native units of the generator) to assign to the MIDI channel |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API float fluid_synth_get_gen | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | param | ||
) |
Retrieve the generator NRPN offset assigned to a MIDI channel.
The value returned is in native units of the generator. By default, the offset is zero.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
param | SoundFont generator ID (fluid_gen_type) |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_activate_key_tuning | ( | fluid_synth_t * | synth, |
int | bank, | ||
int | prog, | ||
const char * | name, | ||
const double * | pitch, | ||
int | apply | ||
) |
Set the tuning of the entire MIDI note scale.
synth | FluidSynth instance |
bank | Tuning bank number (0-127), not related to MIDI instrument bank |
prog | Tuning preset number (0-127), not related to MIDI instrument program |
name | Label name for this tuning |
pitch | Array of pitch values (length of 128, each value is number of cents, for example normally note 0 is 0.0, 1 is 100.0, 60 is 6000.0, etc). Pass NULL to create a equal tempered (normal) scale. |
apply | TRUE to apply new tuning in realtime to existing notes which are using the replaced tuning (if any), FALSE otherwise |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_activate_octave_tuning | ( | fluid_synth_t * | synth, |
int | bank, | ||
int | prog, | ||
const char * | name, | ||
const double * | pitch, | ||
int | apply | ||
) |
Activate an octave tuning on every octave in the MIDI note scale.
synth | FluidSynth instance |
bank | Tuning bank number (0-127), not related to MIDI instrument bank |
prog | Tuning preset number (0-127), not related to MIDI instrument program |
name | Label name for this tuning |
pitch | Array of pitch values (length of 12 for each note of an octave starting at note C, values are number of offset cents to add to the normal tuning amount) |
apply | TRUE to apply new tuning in realtime to existing notes which are using the replaced tuning (if any), FALSE otherwise |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_tune_notes | ( | fluid_synth_t * | synth, |
int | bank, | ||
int | prog, | ||
int | len, | ||
const int * | key, | ||
const double * | pitch, | ||
int | apply | ||
) |
Set tuning values for one or more MIDI notes for an existing tuning.
synth | FluidSynth instance |
bank | Tuning bank number (0-127), not related to MIDI instrument bank |
prog | Tuning preset number (0-127), not related to MIDI instrument program |
len | Number of MIDI notes to assign |
key | Array of MIDI key numbers (length of 'len', values 0-127) |
pitch | Array of pitch values (length of 'len', values are number of cents from MIDI note 0) |
apply | TRUE to apply tuning change in realtime to existing notes using the specified tuning, FALSE otherwise |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_activate_tuning | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | bank, | ||
int | prog, | ||
int | apply | ||
) |
Activate a tuning scale on a MIDI channel.
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
bank | Tuning bank number (0-127), not related to MIDI instrument bank |
prog | Tuning preset number (0-127), not related to MIDI instrument program |
apply | TRUE to apply tuning change to active notes, FALSE otherwise |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_deactivate_tuning | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | apply | ||
) |
Clear tuning scale on a MIDI channel (use default equal tempered scale).
synth | FluidSynth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
apply | TRUE to apply tuning change to active notes, FALSE otherwise |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API void fluid_synth_tuning_iteration_start | ( | fluid_synth_t * | synth | ) |
Start tuning iteration.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_tuning_iteration_next | ( | fluid_synth_t * | synth, |
int * | bank, | ||
int * | prog | ||
) |
Advance to next tuning.
synth | FluidSynth instance |
bank | Location to store MIDI bank number of next tuning scale |
prog | Location to store MIDI program number of next tuning scale |
FLUIDSYNTH_API int fluid_synth_tuning_dump | ( | fluid_synth_t * | synth, |
int | bank, | ||
int | prog, | ||
char * | name, | ||
int | len, | ||
double * | pitch | ||
) |
Get the entire note tuning for a given MIDI bank and program.
synth | FluidSynth instance |
bank | MIDI bank number of tuning |
prog | MIDI program number of tuning |
name | Location to store tuning name or NULL to ignore |
len | Maximum number of chars to store to 'name' (including NULL byte) |
pitch | Array to store tuning scale to or NULL to ignore (len of 128) |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API double fluid_synth_get_cpu_load | ( | fluid_synth_t * | synth | ) |
Get the synth CPU load value.
synth | FluidSynth instance |
FLUID_DEPRECATED FLUIDSYNTH_API const char* fluid_synth_error | ( | fluid_synth_t * | synth | ) |
Get a textual representation of the last error.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_add_default_mod | ( | fluid_synth_t * | synth, |
const fluid_mod_t * | mod, | ||
int | mode | ||
) |
Adds the specified modulator mod
as default modulator to the synth.
mod
will take effect for any subsequently created voice.
synth | FluidSynth instance |
mod | Modulator info (values copied, passed in object can be freed immediately afterwards) |
mode | Determines how to handle an existing identical modulator (fluid_synth_add_mod) |
References FLUID_FAILED, fluid_mod_clone(), fluid_mod_test_identity(), FLUID_OK, FLUID_SYNTH_ADD, FLUID_SYNTH_OVERWRITE, and new_fluid_mod().
Referenced by new_fluid_synth().
FLUIDSYNTH_API int fluid_synth_remove_default_mod | ( | fluid_synth_t * | synth, |
const fluid_mod_t * | mod | ||
) |
Removes the specified modulator mod
from the synth's default modulator list.
fluid_mod_test_identity() will be used to test modulator matching.
synth | synth instance |
mod | The modulator to remove |
References delete_fluid_mod(), FLUID_FAILED, fluid_mod_test_identity(), and FLUID_OK.
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 | ||
) |
Synthesize a block of 16 bit audio samples to audio buffers.
synth | FluidSynth instance |
len | Count of audio frames to synthesize |
lout | Array of 16 bit words to store left channel of audio |
loff | Offset index in 'lout' for first sample |
lincr | Increment between samples stored to 'lout' |
rout | Array of 16 bit words to store right channel of audio |
roff | Offset index in 'rout' for first sample |
rincr | Increment between samples stored to 'rout' |
Useful for storing interleaved stereo (lout = rout, loff = 0, roff = 1, lincr = 2, rincr = 2).
lout
resp. rout
. References FLUID_FAILED, and FLUID_OK.
Referenced by fluid_file_renderer_process_block().
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 | ||
) |
Synthesize a block of floating point audio samples to audio buffers.
synth | FluidSynth instance |
len | Count of audio frames to synthesize |
lout | Array of floats to store left channel of audio |
loff | Offset index in 'lout' for first sample |
lincr | Increment between samples stored to 'lout' |
rout | Array of floats to store right channel of audio |
roff | Offset index in 'rout' for first sample |
rincr | Increment between samples stored to 'rout' |
Useful for storing interleaved stereo (lout = rout, loff = 0, roff = 1, lincr = 2, rincr = 2).
lout
resp. rout
. Referenced by fluid_file_renderer_process_block().
FLUID_DEPRECATED FLUIDSYNTH_API int fluid_synth_nwrite_float | ( | fluid_synth_t * | synth, |
int | len, | ||
float ** | left, | ||
float ** | right, | ||
float ** | fx_left, | ||
float ** | fx_right | ||
) |
Synthesize a block of floating point audio to separate audio buffers (multichannel rendering).
First effect channel used by reverb, second for chorus.
synth | FluidSynth instance |
len | Count of audio frames to synthesize |
left | Array of float buffers to store left channel of planar audio (as many as synth.audio-channels buffers, each of len in size) |
right | Array of float buffers to store right channel of planar audio (size: dito) |
fx_left | Since 1.1.7: If not NULL , array of float buffers to store left effect channels (as many as synth.effects-channels buffers, each of len in size) |
fx_right | Since 1.1.7: If not NULL , array of float buffers to store right effect channels (size: dito) |
Usage example:
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_process | ( | fluid_synth_t * | synth, |
int | len, | ||
int | nfx, | ||
float * | fx[], | ||
int | nout, | ||
float * | out[] | ||
) |
Synthesize floating point audio to stereo audio channels (implements the default interface fluid_audio_func_t).
Synthesize and mix audio to a given number of planar audio buffers. Therefore pass nout = N*2
float buffers to out
in order to render the synthesized audio to N
stereo channels. Each float buffer must be able to hold len
elements.
out
contains an array of planar buffers for normal, dry, stereo audio (alternating left and right). Like:
for zero-based channel index i
. The buffer layout of fx
used for storing effects like reverb and chorus looks similar:
where 0 <= k < fluid_synth_count_effects_groups()
is a zero-based index denoting the effects unit and 0 <= j < fluid_synth_count_effects_channels()
is a zero-based index denoting the effect channel within unit k
.
Any voice playing is assigned to audio channels based on the MIDI channel its playing on. Let chan
be the zero-based MIDI channel index an arbitrary voice is playing on. To determine the audio channel and effects unit it is going to be rendered to use:
i = chan % fluid_synth_count_audio_groups()
k = chan % fluid_synth_count_effects_groups()
synth | FluidSynth instance |
len | Count of audio frames to synthesize and store in every single buffer provided by out and fx . |
nfx | Count of arrays in fx . Must be a multiple of 2 (because of stereo) and in the range 0 <= nfx/2 <= (fluid_synth_count_effects_channels() * fluid_synth_count_effects_groups()) . |
fx | Array of buffers to store effects audio to. Buffers may alias with buffers of out . NULL buffers are permitted and will cause to skip mixing any audio into that buffer. |
nout | Count of arrays in out . Must be a multiple of 2 (because of stereo) and in the range 0 <= nout/2 <= fluid_synth_count_audio_channels() . |
out | Array of buffers to store (dry) audio to. Buffers may alias with buffers of fx . NULL buffers are permitted and will cause to skip mixing any audio into that buffer. |
out
and all effects channels to the buffers in fx
, provided that nout > 0
and nfx > 0
respectively. If nout/2 < fluid_synth_count_audio_channels()
it will wrap around. Same is true for effects audio if nfx/2 < (fluid_synth_count_effects_channels() * fluid_synth_count_effects_groups())
. See usage examples below. FLUIDSYNTH_API void fluid_synth_add_sfloader | ( | fluid_synth_t * | synth, |
fluid_sfloader_t * | loader | ||
) |
Add a SoundFont loader to the synth.
This function takes ownership of loader
and frees it automatically upon synth
destruction.
synth | FluidSynth instance |
loader | Loader API structure |
SoundFont loaders are used to add custom instrument loading to FluidSynth. The caller supplied functions for loading files, allocating presets, retrieving information on them and synthesizing note-on events. Using this method even non SoundFont instruments can be synthesized, although limited to the SoundFont synthesis model.
Referenced by new_fluid_synth().
FLUIDSYNTH_API fluid_voice_t* fluid_synth_alloc_voice | ( | fluid_synth_t * | synth, |
fluid_sample_t * | sample, | ||
int | chan, | ||
int | key, | ||
int | vel | ||
) |
Allocate a synthesis voice.
synth | FluidSynth instance |
sample | Sample to assign to the voice |
chan | MIDI channel number (0 to MIDI channel count - 1) |
key | MIDI note number for the voice (0-127) |
vel | MIDI velocity for the voice (0-127) |
This function is called by a SoundFont's preset in response to a noteon event. The returned voice comes with default modulators and generators. A single noteon event may create any number of voices, when the preset is layered.
FLUIDSYNTH_API void fluid_synth_start_voice | ( | fluid_synth_t * | synth, |
fluid_voice_t * | voice | ||
) |
Activate a voice previously allocated with fluid_synth_alloc_voice().
synth | FluidSynth instance |
voice | Voice to activate |
This function is called by a SoundFont's preset in response to a noteon event. Exclusive classes are processed here.
FLUIDSYNTH_API void fluid_synth_get_voicelist | ( | fluid_synth_t * | synth, |
fluid_voice_t * | buf[], | ||
int | bufsize, | ||
int | id | ||
) |
Get list of currently playing voices.
synth | FluidSynth instance |
buf | Array to store voices to (NULL terminated if not filled completely) |
bufsize | Count of indexes in buf |
id | Voice ID to search for or < 0 to return list of all playing voices |
References fluid_voice_is_playing().
FLUIDSYNTH_API int fluid_synth_handle_midi_event | ( | void * | data, |
fluid_midi_event_t * | event | ||
) |
Handle MIDI event from MIDI router, used as a callback function.
data | FluidSynth instance |
event | MIDI event to handle |
References FLUID_FAILED, fluid_midi_event_get_channel(), fluid_midi_event_get_control(), fluid_midi_event_get_key(), fluid_midi_event_get_pitch(), fluid_midi_event_get_program(), fluid_midi_event_get_type(), fluid_midi_event_get_value(), fluid_midi_event_get_velocity(), FLUID_OK, fluid_synth_cc(), fluid_synth_channel_pressure(), fluid_synth_key_pressure(), fluid_synth_noteoff(), fluid_synth_noteon(), fluid_synth_pitch_bend(), fluid_synth_program_change(), fluid_synth_sysex(), and fluid_synth_system_reset().
Referenced by fluid_midi_dump_postrouter(), and new_fluid_player().
FLUIDSYNTH_API int fluid_synth_set_custom_filter | ( | fluid_synth_t * | synth, |
int | type, | ||
int | flags | ||
) |
Configure a general-purpose IIR biquad filter.
This is an optional, additional filter that operates independently from the default low-pass filter required by the Soundfont2 standard. By default this filter is off (FLUID_IIR_DISABLED).
synth | FluidSynth instance |
type | Type of the IIR filter to use (see fluid_iir_filter_type) |
flags | Additional flags to customize this filter or zero to stay with the default (see fluid_iir_filter_flags) |
References FLUID_FAILED, and FLUID_IIR_DISABLED.
FLUIDSYNTH_API fluid_ladspa_fx_t* fluid_synth_get_ladspa_fx | ( | fluid_synth_t * | synth | ) |
Return the LADSPA effects instance used by FluidSynth.
synth | FluidSynth instance |
FLUIDSYNTH_API int fluid_synth_reset_basic_channel | ( | fluid_synth_t * | synth, |
int | chan | ||
) |
Disables and unassigns all channels from a basic channel group.
synth | The synth instance. |
chan | The basic channel of the group to reset or -1 to reset all channels. |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_get_basic_channel | ( | fluid_synth_t * | synth, |
int | chan, | ||
int * | basic_chan_out, | ||
int * | mode_out, | ||
int * | val_out | ||
) |
Returns poly mono mode information of any MIDI channel.
synth | the synth instance |
chan | MIDI channel number (0 to MIDI channel count - 1) |
basic_chan_out | Buffer to store the basic channel chan belongs to or FLUID_FAILED if chan is disabled. |
mode_out | Buffer to store the mode of chan (see fluid_basic_channel_modes) or FLUID_FAILED if chan is disabled. |
val_out | Buffer to store the total number of channels in this basic channel group or FLUID_FAILED if chan is disabled. |
References FLUID_CHANNEL_MODE_MASK, FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_set_basic_channel | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | mode, | ||
int | val | ||
) |
Sets a new basic channel group only.
The function doesn't allow to change an existing basic channel.
The function fails if any channel overlaps any existing basic channel group. To make room if necessary, basic channel groups can be cleared using fluid_synth_reset_basic_channel().
synth | the synth instance. |
chan | the basic Channel number (0 to MIDI channel count-1). |
mode | the MIDI mode to use for chan (see fluid_basic_channel_modes). |
val | number of channels in the group. |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_set_legato_mode | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | legatomode | ||
) |
API legato mode.
Sets the legato mode of a channel.
synth | the synth instance. |
chan | MIDI channel number (0 to MIDI channel count - 1). |
legatomode | The legato mode as indicated by fluid_channel_legato_mode. |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_get_legato_mode | ( | fluid_synth_t * | synth, |
int | chan, | ||
int * | legatomode | ||
) |
Gets the legato mode of a channel.
synth | the synth instance. |
chan | MIDI channel number (0 to MIDI channel count - 1). |
legatomode | The legato mode as indicated by fluid_channel_legato_mode. |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_set_portamento_mode | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | portamentomode | ||
) |
API portamento mode.
Sets the portamento mode of a channel.
synth | the synth instance. |
chan | MIDI channel number (0 to MIDI channel count - 1). |
portamentomode | The portamento mode as indicated by fluid_channel_portamento_mode. |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_synth_get_portamento_mode | ( | fluid_synth_t * | synth, |
int | chan, | ||
int * | portamentomode | ||
) |
Gets the portamento mode of a channel.
synth | the synth instance. |
chan | MIDI channel number (0 to MIDI channel count - 1). |
portamentomode | Pointer to the portamento mode as indicated by fluid_channel_portamento_mode. |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_set_breath_mode | ( | fluid_synth_t * | synth, |
int | chan, | ||
int | breathmode | ||
) |
API breath mode.
Sets the breath mode of a channel.
synth | the synth instance. |
chan | MIDI channel number (0 to MIDI channel count - 1). |
breathmode | The breath mode as indicated by fluid_channel_breath_flags. |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_synth_get_breath_mode | ( | fluid_synth_t * | synth, |
int | chan, | ||
int * | breathmode | ||
) |
Gets the breath mode of a channel.
synth | the synth instance. |
chan | MIDI channel number (0 to MIDI channel count - 1). |
breathmode | Pointer to the returned breath mode as indicated by fluid_channel_breath_flags. |
References FLUID_FAILED, and FLUID_OK.