Sf2 soundfonts are files edited by Polyphone. Each sf2 file comprises one or more musical virtual instruments, made of audio samples and a lot of parameters. Parameters define how the samples should be played throughout the keyboard, possibly modulated by predefined signals (modulators). Sf2 files are built according to a 3-level structure:
Soundfonts are used by software synthesizers, such as fluidsynth, using wavetables. These synthesizers are driven by MIDI signals. For a sound to be produced, the sample is read taking into account every parameter entered in the soundfont.
Further information on soundfonts may be found for example on Wikipedia. The sf2 specifications are available here
.