Creating the synthesizer

To create the synthesizer, you pass it the settings object, as in the following example:

#include <fluidsynth.h>

int main(int argc, char** argv) 
{
  fluid_settings_t* settings;
  fluid_synth_t* synth;

  fluid_settings_t* settings = new_fluid_settings();

  synth = new_fluid_synth(settings);

  /* Do useful things here */

  delete_fluid_synth(synth);
  delete_fluid_settings(settings);
  return 0;
}

The default settings should be fine for most uses. A detailed description of all the settings used by the synthesizer described below.

Table 1. Synthesizer settings

synth.gainTypenumber
 Default0.2
 Min-Max0.0-10.0
 DescriptionThe gain is applied to the final or master output of the synthesizer. It is set to a low value by default to avoid the saturation of the output when random MIDI files are played.
synth.sample-rateTypenumber
 Default44100
 Min-Max22050-96000
 DescriptionThe sample rate of the audio generated by the synthesizer.
synth.polyphonyTypeinteger
 Default256
 Min-Max16-4096
 DescriptionThe polyphony defines how many voices can be played in parallel. The number of voices is not necessarily equivalent to the number of notes played simultaniously. Indeed, when a note is struck on a specific MIDI channel, the preset on that channel may created several voices, for example, one for the left audio channel and one for the right audio channels. The number of voices activated depends on the number of instrument zones that fall in the correspond to the velocity and key of the played note.
synth.midi-channelsTypeinteger
 Default16
 Min-Max16-256
 DescriptionThis setting defines the number of MIDI channels of the synthesizer. The MIDI standard defines 16 channels, so most hardware keyboards are limited to 16. If you plan to use the synthesizer as a plugin in an application, it might be interesting to set the number of channels to a larger value. In this case you can program a greater number of presets.
synth.reverb.activeTypestring
 Default"yes"
 DescriptionWhen set to "yes" the reverb effects module is activated. Otherwise, no reverb will be added to the output signal. Note that when the reverb module is active, the amount of signal send to the reverb module depends on the "reverb send" generator defined in the SoundFont.
synth.chorus.activeTypestring
 Default"yes"
 DescriptionWhen set to "yes" the chorus effects module is activated. Otherwise, no chorus will be added to the output signal. Note that when the reverb module is active, the amount of signal send to the chorus module depends on the "chorus send" generator defined in the SoundFont.
synth.ladspa.activeTypestring
 Default"no"
 DescriptionWhen set to "yes" the LADSPA subsystem will be called. This subsystem allows to load and interconnect LADSPA plugins. The output of the synthesizer is processed by the LADSPA subsystem. Note that the synthesizer has to be compiled with LADSPA support. More information about the LADSPA subsystem later.
synth.audio-groupsTypeinteger
 Default1
 Min-Max1-128
 DescriptionBy default, the synthesizer outputs a single stereo signal. Using this option, the synthesizer can output multichannel audio.
synth.effects-channelsTypeinteger
 Default2
 Min-Max2-2
 Description 
synth.verboseTypestring
 Default"no"
 DescriptionWhen set to "yes" the synthesizer will print out information about the received MIDI events to the stdout. This can be helpful for debugging. This setting can not be changed after the synthesizer has started.
synth.dumpTypestring
 Default"no"
 Description