QSFM Quick Soundfont Manager

Manual $Revision: 1.10 $  last changed by $Author: eppelman $ at $Date: 2008/10/07 18:15:43 $ - UTC

Reasons and History of the development

The reason of the development was , that there was no easy way to use or better no GUI to quick load soundfonts into an emu8000 or emu10k chip of a Creative Soundblaster AWE32 or Live Card on the Linux platform using asfxload. So the simple goal was to write a simple application which allows to load a soundfont just with one click of a button. The focus was to do this click via a small touchscreen in the near ( now reached ) future, to even use this progam for live organ and piano concerts.

The idea to use high quality soundfonts for a Live performance in a sacral environment came from Karl-Heinz Granath. This was mainly to play and hear a adequate organ instrument where a physical real intrument is not available.
And the beginning of the usage of soundfonts within the emu-chip was on Windows! But indeed, as we all know, this Platform is not stable and solid enough to to work in a Live Environment.
So the idea was to do the same on Linux, that he has performed in more or less fear about a BSOD ;) - without these window's leaks.

Unfortunately there was no convenient way to load a sounfont in the emu chip nor to swich between several soundfonts with different presets or organ registrations.

So I decided to develop a One-Click Load Programm for Soundfonts in 2006. The first version was developed with WxWidgets, but in an early stage I realized, that the needed keyboard-contol (for cursor contolled navigation and selection) was rudimentary in WxWindows. I evaluated Qt sucessfully, and startet to port the first 1600 wx-lines to Qt. Unfortunatelly I had not really understand Qts mechanics and objectarchictecture, so I had to rewrite and refactor most of  the code to have a more modular object design.

Basic Concept

The basic concept is, to store all the several related soundfonts in common "family" folders. The Parent folder of these families is the Soundfont Basefolder. These can be selected, if you click on the [New] - Button.
The following picture should illustrate this:

>basefolder  ....(the Basefolder)
   +strings ....... (family-folder)
        +viola.sf2 (Soundfonts of the Strings-family)
        +cello.sf2
        +violine_and_cello.sf2
   +brass 
         +trumpet.sf3
         +trumped_and_horn.sf2
    +flutes (family-folder)

You are free and have to build your own Folder and Family Structures according to your performance needs and practices.

Some notes of the Order. - The Families and its children Soundfonts are always lexicaly sorted / ordered. So in  the sample structure above, the brass family is displayed first then the flutes family and at last the strings.
If you want to have another order, you can prepend a number to the foder name (such as "0_strings") to show the strings-folder at the first place - but, of cource these "pre_number" will also displayed on the "worksheet". note: hidden files and folders, starting with "." will also be displayed.

A very simple Example to start

Lets assume you have two basefolders,  one as shown above and another with several prepared organ and piano soundfonts as shown in the screenshot below.
The folders must be exists, must contain valid sf2 files, an the sf2 files must be readable for you.

keyboards
|-- 0 Clavier
|   |-- Fluegel.SF2
|   |-- Roland-Piano.SF2
|   `-- Steinway.SF2
`-- 1 Organ
    |-- 01 I P 8.SF2
    |-- 03 I P 8-4-2.SF2
    `-- 05 I Tutti-02.SF2

tree-basefolder

A) The first basefolder should be assigned as asfxload source, which means, that all soundfonts in its family-folders will be automatically loaded in the first EMU Wavetable Instance, if you click on one of the button of their worksheet.

So, if QSFM shows its startup dialog, select the option (o) asfxload (EMU-Chip/Hardware basiert). Confirm with click on OK. Now maybe the QSFM-Kaconnect windows appears for 4 seconds above in the Mainwindow. Wait the 4 seconds, or close this QSFM-Kaconnect window with click on its [X]-Button. I will explain its properties in the "Embedded Add-ons" Section below.

Now click on the [New]-Button in the Mainwindow's Main-Toolbar above and select the asfxload Basefolder. In the example above, this is /home/marc/qsfm/sf2/asfxload. Confirm your selection with a click on OK.

The selected Folder will now be in the centered listbox above, right from the [New], [Clear] and [Clear a.]-Buttons. Now click on the [Load]-Button.

The asfxload-family folders will be scanned for sf2 files and for each folder a column and for each file in this folder a button in this column on this tabbed worksheet
 will be created. The name of the family folder will be drawed Bold as Headline of the column. Each Button is labeled with its assigned Soundfont filename except the sf2 extension, which will be truncated.

Ok. Lets go to the next step:
Click once again on the [New]-Button and select the first wished Fluidsynth-folder, in the example above: "/home/marc/qsfm/sf2/fluidsynth". Confirm with OK.
The fluidsynth folder should also appeas in the List.

Now click on the [asfxload]-Button. If a Question-Dialog appears, which asks, if you want tho also toggle the current tab, answer with "no" with click on the "NO"-Button. Now click on the [Load]-Button again. The fluidsynth instance will be created and its assigned worksheed will be created with the same rules as the asfxload worksheet, except that the worksheets background will be gray.

Now lets assign the Midi-In  devices to the wished Output's.

In this Example a USB MIDI-Sport Midi Masterkeyboard should be asigned to the EMU-Wavetable chip, or better to the asfxload-worksheet.
The second Midikeyboard is conected to the Soundblaster  MPU401/Gameport and theirfore the fluidsynth instance / worksheet is connect with the general MPU-401 Midi-In Device. All these connections can be done in this application. You dont need to open kaconnect or another application, just click on the Window>Kaconnect entry in the Main Menu.

If you familar with Kaconnect, just connect as whished. Otherwise play and try intuitive or read the Section "Embedded Add-ons".

""" Once you have similar connected as shown in the Screenshot above, this is hardly depend on your special Midi-Hardware.
you can select the asfxload tab/worksheet, click on one of the buttons to load its assigned soundfont and play on the connected Midi-In Device. In this example, on the Midi-Sport Masterkeyboard. And if all is right, and the Speakers, and volume sliders of your soundcard are well "calibrated", you should hear , what you play.

Now toggle to the other fluidsynth/tab, and if you can play with and hear the sound of a soundfont, loaded in the fluidsynth instance, with a click on a "fluidsynth button", and with the Midi-Keyboard connected on the GameMPU401 port, as in the example above, this section will be close up. Otherwise, check you connections and volumesliders or read the Troubleshooting section.

You are now familar with the basic Concepts of QSFM. The next Section explains the two kinds of Wavetable Synths, basically, for practical musicians.

Hard- vs. Softwaresynth

The additive wavetable sound synthese is based on samples of a real instrument or voice, which are played accordingly, if you press the assigned key. Now you can assign to each key of a keyboard a sample or let a special DSP/wavetable chip calculate interpolate the sounds of a octave depended of the base sound i.e. C1 in realtime. The same calculations can be made in realtime by the current CPUs easyly. The diffence is the stability. The ChipSolution will ever work, independed from the CPU load of the machine, even live on Stage, but its algorithms are fix-burned in the chip and cannot be changed nor tuned or optimized.
On the other Hand, the Softwaresysnth aka fluidsynth can changed, spezialized, or optimized, but works maybe instable and is high CPU load depended and requires Realtime Prozessing, a Realtime Kernelsystem.

For more informations consult http://en.wikipedia.org/wiki/Wavetable_synthesis , http://en.wikipedia.org/wiki/Sampler_(musical_instrument) and http://en.wikipedia.org/wiki/SoundFont 

The QSFM supports both kind of and a combination of both is recommened to use for Multi-manual Play. See the Section "A very simple Example to start" above for a sample usage.

Advanced options

Volume Slider

There is a Volume Slider centered in the bottom status bar of the MainWindow of QSFM.

At the time of writing of this section (2008/08/27, Version 0.9.9rc2) the Volume Slider will only applied on fresh new or reloaded Samples. This can be used, if one of the samples is not able to be played in accords produces ugly missounded overdrives if played more than one note btw. pressed more than one keys. To apply the Slider, just move the slider to the whished position and load a new or reload the current instrument with klick on the assigned Button. Also the the time of writing,
this Feature is just implemented for asfxload mode. It will maybe also be implemented for fluidsynth in one of the next releases.

Generic Settings

The Hotkey STRG+F12 or the Menu Extras->Settings offers the Generic Settings Dialog. In this Dialog you can modify
visual things as well as serveral program behaviours.

The Dialog has a List of categories at the left side and a MultiTabPanel with the category-specific section-tabs at the right Main Side.

User Interface Modifications

To Modify the Ui Settings you have to select the UI-Settings Entry in the Categories List. Then at the right Side the Tabs with the UI specific sections will be displayed.
FontSettings
The leftmost tab is a generic mostly selfexplanationed dialog were you can select and adjust the GUI Font. 

There can be selected a Font family, such as Times, Courier, Helvetica and so on.
Also you can select one of the fontstyles, roman , italic, bold and bold-italic. And you can adjust the font size between 6-99.

The GUI font modifications will be immediatelly applied to the entire GUI of QSFM, if you  leave the settings -dialog with click on [OK]. So be sure you don't have selected an "unreadable" Font - because, afterwards the Settings dialog will also displayed with these Font.  

To reset the Systems Default Font, this Font is marked with a (*) at the End of its Name.
ColorSettings
The next Tab right of the Font Tab offers the uncompleted (at the time of writing of this section 2008/08/27, Version 0.9.9rc2) Color Settings Tab.

Here you can select a Color Schema in the List at Left. The Schemes are transformed from the KDE - Colorschemes and the detailed color assignments in RGB-format are shown in the right list. To modify or create a new schema use the KDE ControlCenter. Your own Schemas should be appear in the list too.

As on the FontsTab, the selected Schema will also be applied if the dialog closed via click on [OK] and the Systemdefault Color Schema is also marked with a "(*)" at the End of the Name, to reset to the System default.
Margins & Spaces
Right to the ColorSettingsTab ist the "ugly" Margins and Spaces Tab. Here you can adjust the Margins and Spaces between the Buttons on your worksheet. In the top Box you can adjust the Space between the Buttons and within the bottom Box, you can choose a margin width around the Buttons in the Worksheet. The new values will only be applied on new loaded Worksheet or Base-directories after you closed the dialog with [OK].
Misc. Settings
The rightmost dialog Tab is for miscellaneous settings. The most options here are selfexplaining, but the important ones will be detailed described here, the other becomes a notice too. (Note: the dialog is also a candidate to be reordered. So, in one of the next releases, the Dialog may be separated into several sub dialogs or something like this)

First The top Options Block toggles some Extra Highlight features.
The second Block contains options, which toggles show/hide of several GUI-Elements.
The third Block toggles some alignment settings.
The bottom Block controls the startup process and the program behaviour options.

Preloading the Soundfonts in the RAM-Cache

This sounds more than it is, but indeed this does their job nearly good. But what does it mean? Everybody knows that Linux uses the unused physical RAM as harddisk-cache. (You didn't know? But now ;) And at the time of writing this, that means, that a File which once was readed from the Harddisk for Example a Soundfont "A.sf2" will be automatically read into the RAM by the Linux Kernel by default and cached there. And any subsequent reading of the same file (datablock) from the Harddisk will not really done with reading this file again from the Harddisk but from this cache. But this caching mechanism will still only work, if there is enough RAM in the computer and the file wasn't changed by another process (the file has another timestamp). The Linux Kernel handles this fully transparent.

(Any modern harddisk itself has already a cache mechanism which works nearly on the same way but on a lower level - blockwise. This is mainly to unload the hdd-mechanics, but can also support the Linuxkernel cache mechanism.)

So the idea for QSFM was simply to use this mechanism and read all available soundfonts during open of the wished Worksheet into the cache and any subsequent load of a (so already) loaded soundfont will be much faster. This is to support realtime live play requirements. If all soundfonts in one basedir does not fit into the computers RAM-cache, the last loaded (from top-left to bottom right) will still already be cached , but the first (top-left) loaded one have to be read from the harddisk again. If you want to prevent to reload from harddisk, you have to reorganise your soundfont library/ies to fit into the RAM.

Embedded Addons


At the time of writing there are two embedded Addons. QSFM Kaconnect and Qeyboard.

QSFM Kaconnect

QSFM Kaconnect is a extended Version of the Kaconnect originally written by Matthias Nagorni. The Extension are
  1. The persitence of the Connections once you are made. That means these connections will be restored if you reopens QSFMKaconnect.
  2. A little bit more compact GUI-Elements order. and
  3. The localization possibility, realized only in german yet.

Except these modifications the functionallity is unchanged.

Qeyboard

This feature is highly experimental and a proof of concept yet. If there is a feedback or donation which wishes that I continue the work I will decide at this future time ;-) in the meanwhile this is jsut a torso.

The intention for the development of qsfm was to have one tool to load and play the wished soundfont, where the Qeyboard is the <play> of these. At the time of writing (Release 0.9.9), this works only hard-wired with a soundblaster on Midi port 17:0.

I have to spend a lot of development work to complete this feature - so that it just works how vkeybd from takashi iwai. But unfortunatelly I haven't enough time. Join the project if you are interested in.

Limitations, Restrictions  and their reasons

The most nasty restction I guess is that only one soundfont can be loaded in a Synth-Instance exclusively. This is because the Soundfont Bank handling/Mapping of asfxload is misunderstandable, not well documented and/or does not work correctly.

To fix this and to implement a streamline mapping mechanism, I have also to spend a lot of time to study the asfxload iwai-code and to reimplement the responsible mapping code. But unfortunatelly I haven't enough time. Join the project if you are interested in.




This document is part of QSFM Quick Soundfontmanager licensed under the GPL General public license.
(C) opyleft 2007-2008 Marc Eppelmann, Oldenburg / Germany.

You should have received a copy of the GNU General Public License along with QSFM.  If not, see http://www.gnu.org/licenses

Manual $Revision: 1.10 $  last changed by $Author: eppelman $ at $Date: 2008/10/07 18:15:43 $ - UTC