Crate fluidlite_sys[][src]

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

Constants

< DOCME

< Generator value is set

< Generator value is not set

< Initial volume attenuation

< Chorus send amount

< Coarse tuning

< Sample end address coarse offset (X 32768)

< Sample end address offset (-32767-0)

< Sample end loop address coarse offset (X 32768)

< Sample loop end address offset (-32767-32767)

< Exclusive class number

< Filter cutoff

< Filter Q

< Fine tuning

< Instrument ID (shouldn’t be set by user)

< Fixed MIDI note number

< MIDI note range

< Key to modulation envelope decay

< Key to modulation envelope hold

< Key to volume envelope decay

< Key to volume envelope hold

< Value defines the count of generators (#fluid_gen_type)

< Modulation envelope attack

< Modulation envelope decay

< Modulation envelope delay

< Modulation envelope hold

< Modulation envelope release

< Modulation envelope sustain

< Modulation envelope to filter cutoff

< Modulation envelope to pitch

< Modulation LFO delay

< Modulation LFO frequency

< Modulation LFO to filter cutoff

< Modulation LFO to pitch

< Modulation LFO to volume

< Sample root note override

< Stereo panning

< Pitch (NOTE: Not a real SoundFont generator)

< Reserved

< Reserved

< Reserved

< Reverb send amount

< Sample ID (shouldn’t be set by user)

< Sample mode flags

< Scale tuning

< Sample start address coarse offset (X 32768)

< Sample start address offset (0-32767)

< Sample start loop address coarse offset (X 32768)

< Sample loop start address offset (-32767-32767)

< Unused

< Unused

< Unused

< Unused

< Fixed MIDI velocity value

< MIDI velocity range

< Vibrato LFO delay

< Vibrato LFO frequency

< Vibrato LFO to pitch

< Volume envelope attack

< Volume envelope decay

< Volume envelope delay

< Volume envelope hold

< Volume envelope release

< Volume envelope sustain

< Debugging messages

< Serious error occurred

< Verbose informational messages

< The synth can’t function correctly any more

< Warning

Functions

Deletes the synthesizer previously created with new_fluid_synth.

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 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.

Creates a fluid_sfont_t wrapping an fluid_ramsfont_t

ramsfont specific API

returns 1 if the value exists, 0 otherwise

Get the default value of a string setting.

Get the range of values of a numeric settings.

returns 1 if the value exists, 0 otherwise

Get the default value of a string setting.

Get the range of values of a numeric settings.

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.

Get the default value of a string setting.

Returns whether the setting is changeable in real-time.

returns 1 if the value has been set, 0 otherwise

returns 1 if the value has been set, 0 otherwise

returns 1 if the value has been set, 0 otherwise

Get the value of a numeric setting.

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. Returns 0 if no error occurred, -1 otherwise.

Send a control change message. Returns 0 if no error occurred, -1 otherwise.

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 the offset of the bank numbers in a SoundFont.

Get a control value. Returns 0 if no error occurred, -1 otherwise.

Get the preset of a channel

Query the current state of the chorus.

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 0 if no error occurred, -1 otherwise.

Get the pitch wheel sensitivity. Returns 0 if no error occurred, -1 otherwise.

Get the polyphony limit (FluidSynth >= 1.0.6)

Returns the program, bank, and SoundFont number of the preset on a given channel. Returns 0 if no error occurred, -1 otherwise.

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.

Send a noteoff message. Returns 0 if no error occurred, -1 otherwise.

Send a noteon message. Returns 0 if no error occurred, -1 otherwise.

Send a pitch bend message. Returns 0 if no error occurred, -1 otherwise.

Set the pitch wheel sensitivity. Returns 0 if no error occurred, -1 otherwise.

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. Returns 0 if no error occurred, -1 otherwise.

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.

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.

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.

Set the tuning to the default well-tempered tuning on a channel.

Select a tuning for a channel.

Offset the bank numbers in a SoundFont. Returns -1 if an error occured (out of memory or negative offset)

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)

Set the polyphony limit (FluidSynth >= 1.0.6)

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)

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.

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.

Select a sfont. Returns 0 if no error occurred, -1 otherwise.

Reload a SoundFont. The reloaded SoundFont retains its ID and index on the stack.

Removes a SoundFont from the stack and deallocates it.

Create and start voices using a preset. The id passed as argument will be used as the voice group id.

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.

Stop the voices in the voice group defined by id.

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.

Get the value of a generator

Modify the value of a generator by val

Set the value of a generator

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.

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.

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.

sample_t specific API for ramsfont

Creates a new synthesizer object.

Type Definitions

SoundFont plugins

Enum value for ‘flags’ field of #_fluid_gen_t (not really flags).

SoundFont generator structure.

Generator (effect) numbers (Soundfont 2.01 specifications section 8.1.3)

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().

FluidSynth log levels.