libfluidsynth  1.1.2
Data Structures | Defines | Typedefs | Enumerations
synth.h File Reference

Embeddable SoundFont synthesizer. More...

Data Structures

struct  _fluid_synth_channel_info_t
 Channel information structure for fluid_synth_get_channel_info(). More...

Defines

#define FLUID_SYNTH_CHANNEL_INFO_NAME_SIZE   32
 Length of channel info name field (including zero terminator)
#define FLUID_REVERB_DEFAULT_ROOMSIZE   0.2f
 Default reverb room size.
#define FLUID_REVERB_DEFAULT_DAMP   0.0f
 Default reverb damping.
#define FLUID_REVERB_DEFAULT_WIDTH   0.5f
 Default reverb width.
#define FLUID_REVERB_DEFAULT_LEVEL   0.9f
 Default reverb level.
#define FLUID_CHORUS_DEFAULT_N   3
 Default chorus voice count.
#define FLUID_CHORUS_DEFAULT_LEVEL   2.0f
 Default chorus level.
#define FLUID_CHORUS_DEFAULT_SPEED   0.3f
 Default chorus speed.
#define FLUID_CHORUS_DEFAULT_DEPTH   8.0f
 Default chorus depth.
#define FLUID_CHORUS_DEFAULT_TYPE   FLUID_CHORUS_MOD_SINE
 Default chorus waveform type.
#define FLUID_INTERP_DEFAULT   FLUID_INTERP_4THORDER
 Default interpolation method from fluid_interp.
#define FLUID_INTERP_HIGHEST   FLUID_INTERP_7THORDER
 Highest interpolation method from fluid_interp.

Typedefs

typedef int(* fluid_audio_callback_t )(fluid_synth_t *synth, int len, void *out1, int loff, int lincr, void *out2, int roff, int rincr)
 Type definition of the synthesizer's audio callback function.

Enumerations

enum  fluid_chorus_mod { FLUID_CHORUS_MOD_SINE = 0, FLUID_CHORUS_MOD_TRIANGLE = 1 }
 Chorus modulation waveform type. More...
enum  fluid_interp { FLUID_INTERP_NONE = 0, FLUID_INTERP_LINEAR = 1, FLUID_INTERP_4THORDER = 4, FLUID_INTERP_7THORDER = 7 }
 Synthesis interpolation method. More...

Detailed Description

Embeddable SoundFont synthesizer.

You create a new synthesizer with new_fluid_synth() and you destroy if with delete_fluid_synth(). Use the settings 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 described below 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(), ...


Define Documentation

Default interpolation method from fluid_interp.

Highest interpolation method from fluid_interp.


Typedef Documentation

typedef int(* fluid_audio_callback_t)(fluid_synth_t *synth, int len, void *out1, int loff, int lincr, void *out2, int roff, int rincr)

Type definition of the synthesizer's audio callback function.

Parameters:
synthFluidSynth instance
lenCount of audio frames to synthesize
out1Array to store left channel of audio to
loffOffset index in 'out1' for first sample
lincrIncrement between samples stored to 'out1'
out2Array to store right channel of audio to
roffOffset index in 'out2' for first sample
rincrIncrement between samples stored to 'out2'

Enumeration Type Documentation

Chorus modulation waveform type.

Enumerator:
FLUID_CHORUS_MOD_SINE 

Sine wave chorus modulation.

FLUID_CHORUS_MOD_TRIANGLE 

Triangle wave chorus modulation.

Synthesis interpolation method.

Enumerator:
FLUID_INTERP_NONE 

No interpolation: Fastest, but questionable audio quality.

FLUID_INTERP_LINEAR 

Straight-line interpolation: A bit slower, reasonable audio quality.

FLUID_INTERP_4THORDER 

Fourth-order interpolation, good quality, the default.

FLUID_INTERP_7THORDER 

Seventh-order interpolation.