create new tag
, view all tags


Linux Audio > Soundfonts


If anything is missing, misleading, or whatever, please correct it (this is a Wiki wink ).



What is a Soundfont?

A Soundfont is a kind of package of soundfiles.

Here is a quote from computermusic.co.uk:
"SoundFonts are simply .wav file samples that have been transformed by a SoundFont editor, such as Vienna, into MIDI-controllable instruments which can be loaded onto your soundcard and triggered by your sequencer. They're also referred to as .sf2 files , patches or programs."

Soundfonts can also be used by appropriate Synthesizers or Softwaresythesizers. The two soft-synths I know are Timidity and Fluidsynth.

These make it possible to load a soundfont and play its soundfiles with a midi-keyboard, or transform MIDI to Audiodata. They also can be used as a replacement for wavetable-soundcards or bad sounding fm-synths.

A sound font file (.sf2) can contain several instruments at the same time. Each instrument is identified by a numer called program which can range from 0 to 127. In theory each program can contain any instrument, but there is a standard called General Midi (GM) which assign a particular "real" instrument to each program number (i.e. 0 for the grand piano, 48 for the strings, etc... ). A GM soundfont is one that follow that convention. If you play a midi file using a GM soundfont you will hear each part played from the right instrument, while if you play a midi file using a non GM soundfont you may hear (for example) the drum line played from a trumpet.

Generally, a non GM soundfont contain only few variation of the same instrument, assigning each variation to a program number.

Sound cards which support Soundfonts:

Get them:

From your Soundcard installation disk

If you have a sound card with soundfount support you can find some soundfont in the soundcard installation disk. For example, the Creative Labs Sound Blaster Audigy OEM has two soundfonts (a 4MB version and a 8MB version) in the cd. They can be founded in following path:


From the internet

For GM soundfonts you can look at those sites:

Uncompress them:

Sometimes you can find soundfonts compressed in various formats like the common RAR or the stranger sfPack and sfArk. Each distro has a package for the unrar program (non free software) which can be used to uncompress the RAR archives.

For the sfArk format there is command line utility for Linux (alas even this it's non free software) that can decompress the .sfArk files, You can find it here:

This utility, however, can only decompress the newer 2.x version of the sfArk format. I've found (on internet) several soundfonts in the 1.x version and I don't know to decompress them.

For the sfPack the situation is even worst. I don't know any utility to decompress them under Linux (I hope someone else can correct me).

I don't have tried to execute the various win32 utilities to decompress sfPack or sfArk v. 1.x under wine. Please report any succes with this.

However, the situation is non so bad as it can seem. In fact most soundfont on internet are in RAR archives or not compressed at all (.sf2 files). So you can still enjoy a lot using soundfont under Linux ;-).

Load them:

You can load a soundfont in RAM (!) and then play it though the soundcard wavetable. To this purpose follow those steps:

1. Install the awesfx package:

  • Debian and derivates: apt-get install awesfx
  • Other distros: ...

2. In a console write the command (require alsa):

asfxload /path_to_soundfont/SOUNDFONT.SF2

NOTE: Also in the awesfx package is a sfxload utility that can load the soundfont to be used by the OSS device /dev/sequencer (From Takashi Iwai's manpage: "There is no big difference between sfxload and asfxload except for that asfxload is for ALSA and sfxload is for OSS".)

You can also use the soundfont with timidity or with qsynth (a GUI for fluydsynth).

Play Them

You can play the soundfont with zero latency using the soundcard wavetable. To do this, after loading the soundfont, you need to connect the soundcard midi port to the internal synth with aconnect or with aconnectgui. Remember to set the proper volumes in alsamixer to hear what you play ;-).

For example with Creative Labs Sound Blaster Audigy OEM or similar you can connect the midi port to the wavetable internal synth with:

aconnect 64:0 65:0

and raise the slider named Music in alsamixer.


Revision Comment

  • %DATE% —

Page Ratings

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2007-04-09 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look