Crate fluidlite_sys

Crate fluidlite_sys 

Source
Expand description

§Unsafe fluidlite bindings

github crate docs LGPL-2.1 CI

This crate provides generated unsafe Rust bindings to fluidlite C library.

Probably this isn’t that you really need. See safe bindings.

Structs§

_fluid_audio_driver_t
_fluid_event_t
_fluid_fileapi_t
File callback structure to enable custom soundfont loading (e.g. from memory).
_fluid_gen_t
SoundFont generator structure.
_fluid_hashtable_t
_fluid_midi_driver_t
_fluid_midi_event_t
_fluid_midi_router_rule_t
_fluid_midi_router_t
_fluid_mod_t
_fluid_player_t
_fluid_preset_t
_fluid_rampreset_t
_fluid_ramsfont_t
_fluid_sample_t
_fluid_sequencer_t
_fluid_server_t
_fluid_sfloader_t
_fluid_sfont_t
_fluid_shell_t
_fluid_synth_t
_fluid_voice_t

Constants§

FLUID_CHORUS_DEFAULT_DEPTH
FLUID_CHORUS_DEFAULT_LEVEL
FLUID_CHORUS_DEFAULT_N
FLUID_CHORUS_DEFAULT_SPEED
FLUID_FAILED
FLUID_HINT_BOUNDED_ABOVE
FLUID_HINT_BOUNDED_BELOW
FLUID_HINT_FILENAME
FLUID_HINT_INTEGER
FLUID_HINT_LOGARITHMIC
FLUID_HINT_OPTIONLIST
FLUID_HINT_SAMPLE_RATE
FLUID_HINT_TOGGLED
FLUID_NUM_MOD
FLUID_OK
FLUID_PRESET_SELECTED
FLUID_PRESET_UNSELECTED
FLUID_REVERB_DEFAULT_DAMP
FLUID_REVERB_DEFAULT_LEVEL
FLUID_REVERB_DEFAULT_ROOMSIZE
FLUID_REVERB_DEFAULT_WIDTH
FLUID_SAMPLETYPE_LEFT
FLUID_SAMPLETYPE_LINKED
FLUID_SAMPLETYPE_MONO
FLUID_SAMPLETYPE_OGG_VORBIS
FLUID_SAMPLETYPE_OGG_VORBIS_UNPACKED
FLUID_SAMPLETYPE_RIGHT
FLUID_SAMPLETYPE_ROM
FLUID_SAMPLE_DONE
SEEK_CUR
SEEK_END
SEEK_SET
fluid_chorus_mod_FLUID_CHORUS_MOD_SINE
fluid_chorus_mod_FLUID_CHORUS_MOD_TRIANGLE
fluid_gen_flags_GEN_ABS_NRPN
< DOCME
fluid_gen_flags_GEN_SET
< Generator value is set
fluid_gen_flags_GEN_UNUSED
< Generator value is not set
fluid_gen_type_GEN_ATTENUATION
< Initial volume attenuation
fluid_gen_type_GEN_CHORUSSEND
< Chorus send amount
fluid_gen_type_GEN_COARSETUNE
< Coarse tuning
fluid_gen_type_GEN_ENDADDRCOARSEOFS
< Sample end address coarse offset (X 32768)
fluid_gen_type_GEN_ENDADDROFS
< Sample end address offset (-32767-0)
fluid_gen_type_GEN_ENDLOOPADDRCOARSEOFS
< Sample end loop address coarse offset (X 32768)
fluid_gen_type_GEN_ENDLOOPADDROFS
< Sample loop end address offset (-32767-32767)
fluid_gen_type_GEN_EXCLUSIVECLASS
< Exclusive class number
fluid_gen_type_GEN_FILTERFC
< Filter cutoff
fluid_gen_type_GEN_FILTERQ
< Filter Q
fluid_gen_type_GEN_FINETUNE
< Fine tuning
fluid_gen_type_GEN_INSTRUMENT
< Instrument ID (shouldn’t be set by user)
fluid_gen_type_GEN_KEYNUM
< Fixed MIDI note number
fluid_gen_type_GEN_KEYRANGE
< MIDI note range
fluid_gen_type_GEN_KEYTOMODENVDECAY
< Key to modulation envelope decay
fluid_gen_type_GEN_KEYTOMODENVHOLD
< Key to modulation envelope hold
fluid_gen_type_GEN_KEYTOVOLENVDECAY
< Key to volume envelope decay
fluid_gen_type_GEN_KEYTOVOLENVHOLD
< Key to volume envelope hold
fluid_gen_type_GEN_LAST
< Value defines the count of generators (#fluid_gen_type)
fluid_gen_type_GEN_MODENVATTACK
< Modulation envelope attack
fluid_gen_type_GEN_MODENVDECAY
< Modulation envelope decay
fluid_gen_type_GEN_MODENVDELAY
< Modulation envelope delay
fluid_gen_type_GEN_MODENVHOLD
< Modulation envelope hold
fluid_gen_type_GEN_MODENVRELEASE
< Modulation envelope release
fluid_gen_type_GEN_MODENVSUSTAIN
< Modulation envelope sustain
fluid_gen_type_GEN_MODENVTOFILTERFC
< Modulation envelope to filter cutoff
fluid_gen_type_GEN_MODENVTOPITCH
< Modulation envelope to pitch
fluid_gen_type_GEN_MODLFODELAY
< Modulation LFO delay
fluid_gen_type_GEN_MODLFOFREQ
< Modulation LFO frequency
fluid_gen_type_GEN_MODLFOTOFILTERFC
< Modulation LFO to filter cutoff
fluid_gen_type_GEN_MODLFOTOPITCH
< Modulation LFO to pitch
fluid_gen_type_GEN_MODLFOTOVOL
< Modulation LFO to volume
fluid_gen_type_GEN_OVERRIDEROOTKEY
< Sample root note override
fluid_gen_type_GEN_PAN
< Stereo panning
fluid_gen_type_GEN_PITCH
< Pitch (NOTE: Not a real SoundFont generator)
fluid_gen_type_GEN_RESERVED1
< Reserved
fluid_gen_type_GEN_RESERVED2
< Reserved
fluid_gen_type_GEN_RESERVED3
< Reserved
fluid_gen_type_GEN_REVERBSEND
< Reverb send amount
fluid_gen_type_GEN_SAMPLEID
< Sample ID (shouldn’t be set by user)
fluid_gen_type_GEN_SAMPLEMODE
< Sample mode flags
fluid_gen_type_GEN_SCALETUNE
< Scale tuning
fluid_gen_type_GEN_STARTADDRCOARSEOFS
< Sample start address coarse offset (X 32768)
fluid_gen_type_GEN_STARTADDROFS
< Sample start address offset (0-32767)
fluid_gen_type_GEN_STARTLOOPADDRCOARSEOFS
< Sample start loop address coarse offset (X 32768)
fluid_gen_type_GEN_STARTLOOPADDROFS
< Sample loop start address offset (-32767-32767)
fluid_gen_type_GEN_UNUSED1
< Unused
fluid_gen_type_GEN_UNUSED2
< Unused
fluid_gen_type_GEN_UNUSED3
< Unused
fluid_gen_type_GEN_UNUSED4
< Unused
fluid_gen_type_GEN_VELOCITY
< Fixed MIDI velocity value
fluid_gen_type_GEN_VELRANGE
< MIDI velocity range
fluid_gen_type_GEN_VIBLFODELAY
< Vibrato LFO delay
fluid_gen_type_GEN_VIBLFOFREQ
< Vibrato LFO frequency
fluid_gen_type_GEN_VIBLFOTOPITCH
< Vibrato LFO to pitch
fluid_gen_type_GEN_VOLENVATTACK
< Volume envelope attack
fluid_gen_type_GEN_VOLENVDECAY
< Volume envelope decay
fluid_gen_type_GEN_VOLENVDELAY
< Volume envelope delay
fluid_gen_type_GEN_VOLENVHOLD
< Volume envelope hold
fluid_gen_type_GEN_VOLENVRELEASE
< Volume envelope release
fluid_gen_type_GEN_VOLENVSUSTAIN
< Volume envelope sustain
fluid_interp_FLUID_INTERP_4THORDER
fluid_interp_FLUID_INTERP_7THORDER
fluid_interp_FLUID_INTERP_DEFAULT
fluid_interp_FLUID_INTERP_HIGHEST
fluid_interp_FLUID_INTERP_LINEAR
fluid_interp_FLUID_INTERP_NONE
fluid_log_level_FLUID_DBG
< Debugging messages
fluid_log_level_FLUID_ERR
< Serious error occurred
fluid_log_level_FLUID_INFO
< Verbose informational messages
fluid_log_level_FLUID_PANIC
< The synth can’t function correctly any more
fluid_log_level_FLUID_WARN
< Warning
fluid_log_level_LAST_LOG_LEVEL
fluid_mod_flags_FLUID_MOD_BIPOLAR
fluid_mod_flags_FLUID_MOD_CC
fluid_mod_flags_FLUID_MOD_CONCAVE
fluid_mod_flags_FLUID_MOD_CONVEX
fluid_mod_flags_FLUID_MOD_GC
fluid_mod_flags_FLUID_MOD_LINEAR
fluid_mod_flags_FLUID_MOD_NEGATIVE
fluid_mod_flags_FLUID_MOD_POSITIVE
fluid_mod_flags_FLUID_MOD_SWITCH
fluid_mod_flags_FLUID_MOD_UNIPOLAR
fluid_mod_src_FLUID_MOD_CHANNELPRESSURE
fluid_mod_src_FLUID_MOD_KEY
fluid_mod_src_FLUID_MOD_KEYPRESSURE
fluid_mod_src_FLUID_MOD_NONE
fluid_mod_src_FLUID_MOD_PITCHWHEEL
fluid_mod_src_FLUID_MOD_PITCHWHEELSENS
fluid_mod_src_FLUID_MOD_VELOCITY
fluid_types_enum_FLUID_INT_TYPE
fluid_types_enum_FLUID_NO_TYPE
fluid_types_enum_FLUID_NUM_TYPE
fluid_types_enum_FLUID_SET_TYPE
fluid_types_enum_FLUID_STR_TYPE
fluid_voice_add_mod_FLUID_VOICE_ADD
fluid_voice_add_mod_FLUID_VOICE_DEFAULT
fluid_voice_add_mod_FLUID_VOICE_OVERWRITE

Functions§

delete_fluid_defsfloader
delete_fluid_ramsample
delete_fluid_settings
delete_fluid_synth
Deletes the synthesizer previously created with new_fluid_synth.
fluid_default_log_function
fluid_gen_set_default_values
fluid_init_default_fileapi
fluid_is_midifile
fluid_is_midifile returns 1 if the specified filename is a MIDI file. It retuns 0 otherwise. The current implementation only checks for the “MThd” header in the file.
fluid_is_soundfont
fluid_is_soundfont returns 1 if the specified filename is a soundfont. It retuns 0 otherwise. The current implementation only checks for the “RIFF” header in the file. It is useful only to distinguish between SoundFonts and MIDI files.
fluid_log
fluid_mod_delete
fluid_mod_get_amount
fluid_mod_get_dest
fluid_mod_get_flags1
fluid_mod_get_flags2
fluid_mod_get_source1
fluid_mod_get_source2
fluid_mod_new
fluid_mod_set_amount
fluid_mod_set_dest
fluid_mod_set_source1
fluid_mod_set_source2
fluid_mod_test_identity
fluid_ramsfont_add_izone
fluid_ramsfont_create_sfont
Creates a fluid_sfont_t wrapping an fluid_ramsfont_t
fluid_ramsfont_izone_set_gen
fluid_ramsfont_izone_set_loop
fluid_ramsfont_remove_izone
fluid_ramsfont_set_name
ramsfont specific API
fluid_sample_set_name
fluid_sample_set_sound_data
fluid_set_default_fileapi
fluid_set_log_function
fluid_settings_get_hints
fluid_settings_get_type
fluid_settings_getint
returns 1 if the value exists, 0 otherwise
fluid_settings_getint_default
Get the default value of a string setting.
fluid_settings_getint_range
Get the range of values of a numeric settings.
fluid_settings_getnum
returns 1 if the value exists, 0 otherwise
fluid_settings_getnum_default
Get the default value of a string setting.
fluid_settings_getnum_range
Get the range of values of a numeric settings.
fluid_settings_getstr
Get the value of a string setting. If the value does not exists, ‘str’ is set to NULL. Otherwise, ‘str’ will point to the value. The application does not own the returned value. Instead, the application should make a copy of the value if it needs it later.
fluid_settings_getstr_default
Get the default value of a string setting.
fluid_settings_is_realtime
Returns whether the setting is changeable in real-time.
fluid_settings_setint
returns 1 if the value has been set, 0 otherwise
fluid_settings_setnum
returns 1 if the value has been set, 0 otherwise
fluid_settings_setstr
returns 1 if the value has been set, 0 otherwise
fluid_settings_str_equal
Get the value of a numeric setting.
fluid_synth_activate_octave_tuning
fluid_synth_activate_tuning
fluid_synth_add_sfloader
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.
fluid_synth_add_sfont
Add a SoundFont. The SoundFont will be put on top of the SoundFont stack.
fluid_synth_alloc_voice
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).
fluid_synth_bank_select
Select a bank. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_cc
Send a control change message. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_channel_pressure
fluid_synth_count_audio_channels
Returns the number of audio channels that the synthesizer uses internally
fluid_synth_count_audio_groups
Returns the number of audio groups that the synthesizer uses internally. This is usually identical to audio_channels.
fluid_synth_count_effects_channels
Returns the number of effects channels that the synthesizer uses internally
fluid_synth_count_midi_channels
Returns the number of MIDI channels that the synthesizer uses internally
fluid_synth_create_key_tuning
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.
fluid_synth_create_octave_tuning
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.
fluid_synth_error
Get a textual representation of the last error
fluid_synth_get_bank_offset
Get the offset of the bank numbers in a SoundFont.
fluid_synth_get_cc
Get a control value. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_get_channel_preset
Get the preset of a channel
fluid_synth_get_chorus_depth_ms
fluid_synth_get_chorus_level
fluid_synth_get_chorus_nr
Query the current state of the chorus.
fluid_synth_get_chorus_speed_Hz
fluid_synth_get_chorus_type
fluid_synth_get_gain
Get the master gain
fluid_synth_get_gen
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.
fluid_synth_get_internal_bufsize
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.
fluid_synth_get_pitch_bend
Get the pitch bend value. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_get_pitch_wheel_sens
Get the pitch wheel sensitivity. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_get_polyphony
Get the polyphony limit (FluidSynth >= 1.0.6)
fluid_synth_get_program
Returns the program, bank, and SoundFont number of the preset on a given channel. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_get_reverb_damp
fluid_synth_get_reverb_level
fluid_synth_get_reverb_roomsize
Query the current state of the reverb.
fluid_synth_get_reverb_width
fluid_synth_get_settings
Get a reference to the settings of the synthesizer.
fluid_synth_get_sfont
Get a SoundFont. The SoundFont is specified by its index on the stack. The top of the stack has index zero.
fluid_synth_get_sfont_by_id
Get a SoundFont. The SoundFont is specified by its ID.
fluid_synth_get_voicelist
Write a list of all voices matching ID into buf, but not more than bufsize voices. If ID <0, return all voices.
fluid_synth_key_pressure
fluid_synth_noteoff
Send a noteoff message. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_noteon
Send a noteon message. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_nwrite_float
fluid_synth_pitch_bend
Send a pitch bend message. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_pitch_wheel_sens
Set the pitch wheel sensitivity. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_process
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.
fluid_synth_program_change
Send a program change message. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_program_reset
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. . Returns 0 if no error occurred, -1 otherwise.
fluid_synth_program_select
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.
fluid_synth_remove_sfont
Remove a SoundFont that was previously added using fluid_synth_add_sfont(). The synthesizer does not delete the SoundFont; this is responsability of the caller.
fluid_synth_reset_tuning
Set the tuning to the default well-tempered tuning on a channel.
fluid_synth_select_tuning
Select a tuning for a channel.
fluid_synth_set_bank_offset
Offset the bank numbers in a SoundFont. Returns -1 if an error occured (out of memory or negative offset)
fluid_synth_set_chorus
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’.
fluid_synth_set_chorus_on
Turn on (1) / off (0) the built-in chorus unit
fluid_synth_set_gain
Set the master gain
fluid_synth_set_gen
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’.
fluid_synth_set_interp_method
Set the interpolation method for one channel or all channels (chan = -1)
fluid_synth_set_polyphony
Set the polyphony limit (FluidSynth >= 1.0.6)
fluid_synth_set_preset_callback
Set an optional function callback each time a preset has finished loading. This can be useful when calling fluid_synth_sfload asynchronously. The function must be formatted like this: void my_callback_function(int bank, int num, char* name)
fluid_synth_set_reverb
Set the parameters for the built-in reverb unit
fluid_synth_set_reverb_on
Turn on (1) / off (0) the built-in reverb unit
fluid_synth_set_sample_rate
fluid_synth_sfcount
Count the number of loaded SoundFonts.
fluid_synth_sfload
Loads a SoundFont file and creates a new 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.
fluid_synth_sfont_select
Select a sfont. Returns 0 if no error occurred, -1 otherwise.
fluid_synth_sfreload
Reload a SoundFont. The reloaded SoundFont retains its ID and index on the stack.
fluid_synth_sfunload
Removes a SoundFont from the stack and deallocates it.
fluid_synth_start
Create and start voices using a preset. The id passed as argument will be used as the voice group id.
fluid_synth_start_voice
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.
fluid_synth_stop
Stop the voices in the voice group defined by id.
fluid_synth_sysex
fluid_synth_system_reset
Send a reset. A reset turns all the notes off and resets the controller values.
fluid_synth_tune_notes
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.
fluid_synth_tuning_dump
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.
fluid_synth_tuning_iteration_next
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.
fluid_synth_tuning_iteration_start
Start the iteration throught the list of available tunings.
fluid_synth_write_float
Generate a number of samples. This function expects two floating point buffers (left and right channel) that will be filled with samples.
fluid_synth_write_s16
Generate a number of samples. This function expects two signed 16bits buffers (left and right channel) that will be filled with samples.
fluid_version
fluid_version_str
fluid_voice_add_mod
fluid_voice_gen_get
Get the value of a generator
fluid_voice_gen_incr
Modify the value of a generator by val
fluid_voice_gen_set
Set the value of a generator
fluid_voice_get_id
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.
fluid_voice_is_playing
fluid_voice_optimize_sample
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.
fluid_voice_update_param
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.
new_fluid_defsfloader
new_fluid_ramsample
sample_t specific API for ramsfont
new_fluid_settings
new_fluid_synth
Creates a new synthesizer object.

Type Aliases§

_bindgen_ty_1
SoundFont plugins
fluid_audio_callback_t
fluid_audio_driver_t
fluid_chorus_mod
fluid_cmd_handler_t
fluid_event_t
fluid_fileapi_t
fluid_gen_flags
Enum value for ‘flags’ field of #_fluid_gen_t (not really flags).
fluid_gen_t
SoundFont generator structure.
fluid_gen_type
Generator (effect) numbers (Soundfont 2.01 specifications section 8.1.3)
fluid_interp
fluid_istream_t
fluid_log_function_t
Log function handler callback type used by fluid_set_log_function(). @param level Log level (#fluid_log_level) @param message Log message text @param data User data pointer supplied to fluid_set_log_function().
fluid_log_level
FluidSynth log levels.
fluid_midi_driver_t
fluid_midi_event_t
fluid_midi_router_rule_t
fluid_midi_router_t
fluid_mod_flags
fluid_mod_src
fluid_mod_t
fluid_ostream_t
fluid_player_t
fluid_preset_t
fluid_rampreset_t
fluid_ramsfont_t
fluid_sample_t
fluid_sequencer_t
fluid_server_t
fluid_settings_t
fluid_sfloader_t
fluid_sfont_t
fluid_shell_t
fluid_synth_t
fluid_types_enum
fluid_voice_add_mod
fluid_voice_t