www.ethanwiner.com - since 1997

Using SoundFonts With a Sound Card in Sonar

by Ethan Winer

(This article first appeared in January, 2002 in ProRec, the online audio magazine.)


Although Sonar supports DXi software samplers, many musicians still prefer using a SoundBlaster Live or Audigy sound card for SoundFonts. Playing SoundFonts through a sound card's hardware has several advantages over using a software synthesizer: There's no burden on the computer's CPU, the response time (latency) is immediate, and it's one less plug-in to fiddle with. When I bought my current computer I loaded it with 512 MB of memory just so I could use multiple large SoundFonts all at once. (See my ProRec article Striving for New Lows for the details.)

I have many SoundFont files, but three of them serve as my main sound set and contain all of the instruments I use on a regular basis. Where a standard General MIDI bank has one grand piano, one finger bass, and one trombone, my SoundFonts have many variations in separate banks. For example, I have four different clavinets, five acoustic basses, three timpanis, and so forth. This way I can try different instruments while a song is playing, and choose the one that sounds best for that particular piece.

The alternate versions use the same standard GM patch numbers, but are placed in different banks within the SoundFonts. For example, Preset (patch) number 57 in Bank 0 has one type of trumpet, the same preset in Bank 1 has another, and for some instruments I have as many as nine such variations. So to audition the various oboes or pianos while a tune is playing I call up the appropriate patch, and then change the bank numbers. To keep the SoundFont sizes manageable I use three separate files that total more than 200 MB. These are loaded when my computer starts so all of the instruments are available whenever I want them. This approach has served me well until recently, when I bought Sonar.

MANY PROBLEMS

Unfortunately, Sonar has its own ideas about how SoundFonts should be used. Sonar assumes you will use different SoundFonts for each project, and store each in the same folder where the song resides. Then to use the instruments you must "attach" the SoundFonts to your song. That's a nuisance because it prevents you from trying different instruments as a song plays. And you have to stop what you're doing to attach a new SoundFont just to try it. This also forces you to keep multiple copies of the same SoundFonts in separate folders which wastes space and adds unnecessary complication. Plus, when the SoundFont files are large there is an added delay as Sonar loads them into memory every time you open a project. But Sonar has other, more serious, problems managing SoundFonts:

1. You can see the names of instruments that are in Bank 0 only. If a SoundFont has instruments in other banks their names are not shown, and you can't even tell which banks have additional instruments.

2. When Sonar starts, and every time you load a song, all SoundFonts that are currently loaded in the higher (non-zero) banks are intentionally purged from memory. Yikes. Ouch!

3. If you have the new Audigy sound card, SoundFonts you attach to a project can be used by the "A" Synth only. The Audigy lets you load SoundFonts separately for the A and B synths, and in fact you must load both synths if you want to access every sound from all 32 available channels.

4. Even though Sonar recognizes a SoundBlaster card as a SoundFont device, it stupidly uses the wrong bank select method. So you must change that before you can access sounds in other banks.

MANY SOLUTIONS

Fortunately, all of these problems can be solved with a little ingenuity, and a quick visit to the Vienna SoundFont editing program. Vienna is available as a free download from the Creative Labs web site, and is a must-have for anyone who is serious about using SoundFonts.

The following steps show how to load any number of SoundFonts into multiple banks, keep Sonar from clearing them from memory, and have Sonar show you all of the instrument names in all of the banks so you can easily choose the ones you want. (By the way, this information also applies to later versions of Cakewalk.) You may prefer to place many sounds into different banks of the same SoundFont files as I did, or create separate files for each bank. The technique I'll show can be used for either method.

Here's a brief overview of the process, and in a moment I'll explain each step in detail. First you'll edit your SoundFonts to move the additional instruments into separate non-zero banks. You will then load all of the SoundFont files "on top of each other" into Bank 0 to keep Sonar from clearing them from memory. Next, in Sonar, you'll attach a series of "dummy" SoundFonts to each bank you plan to use, to make Sonar display all of the instrument names. Finally, you must tell Sonar to use Controller 0 as the Bank Select Method in each track's Properties dialog.

I suggest that you create a template file - a song that has all of the tracks defined but with no MIDI note data - and use that template each time you begin a new project. Be sure to use Save..As to save it under a different name when you start a new song, so you don't accidentally overwrite the template. Or you could set the template file to be read-only if you prefer. Right-click the file name in Windows Explorer and choose Properties. Then check the Read-only box and click Apply. Now if you click Save by mistake, Sonar will force you to use a different file name.

1. ORGANIZE YOUR SOUNDFONT BANKS

The first step is to organize your SoundFonts so they use absolute rather than relative bank numbers. Suppose you have two different SoundFont files. Each has instruments in different patch locations, but all are in a single bank. This is how most GM SoundFonts are organized, where the only piano is at Preset 1 in Bank 0, the only harpsichord is at Preset 7 in Bank 0, and so forth.

The usual way to make both banks available to a sequencer is to load them with your sound card's SoundFont control panel. You load one SoundFont file into the main Synth bank (Bank 0), and then load the next file into Bank 1. This is shown in the table below. Internally, the second SoundFont has its sounds in Bank 0, but since you loaded it to Bank 1 the bank numbers you specify when selecting instruments are effectively shifted up by one. So to play the sounds in the second file you tell Sonar to use Bank 1. If you instead edit the second SoundFont in Vienna so all of its presets are in Bank 1 instead of Bank 0, you can load both SoundFonts into Bank 0 and access all of the sounds in both files. Again, loading all of your SoundFonts into Bank 0 is what prevents Sonar from clearing them from memory.

SoundFont #1

Patch number SoundFont's Bank 0
1 Grand Piano
... ...
34 Finger Bass
... ...
57 Trumpet
58 Trombone
... ...

 

SoundFont #2

Patch number SoundFont's Bank 0
1 Nice Grand
... ...
34 Roto Bass
... ...
57 Silky Trumpet
58 Bass Trombone
... ...

 

Both SoundFonts as Loaded into SoundFont Memory

Patch number Synth Bank 0 Bank 1
1 Grand Piano Nice Grand
... ... ...
34 Finger Bass Roto Bass
... ... ...
57 Trumpet Silky Trumpet
58 Trombone Bass Trombone
... ... ...

In order to load all of the SoundFonts into Bank 0 you must edit the bank numbers in Vienna. Your primary SoundFont can be left as is, with all of the instruments in Bank 0. If that SoundFont has instruments in other banks, make a note of the highest bank number used. The second SoundFont will then use banks starting at the next available bank number. Therefore you will load the second SoundFont into Vienna, and set all of the bank numbers to one higher than what the first SoundFont uses. If your main file uses only Bank 0 - as shown in these tables - set all of the instruments in the second SoundFont to be at Bank 1. You change the bank number for a preset in Vienna by right-clicking its name in the Melodic Pool and selecting Rename. There you will see the current patch name with its preset and bank numbers, and be able to edit them.

SoundFont #2 after reassigning all Bank 0 presets to Bank 1

Patch number SoundFont's Bank 0 SoundFont's Bank 1
1 empty Nice Grand
... ... ...
34 empty Roto Bass
... ... ...
57 empty Silky Trumpet
58 empty Bass Trombone
... ... ...

Repeat this for every SoundFont you plan to use, then load them all into Bank 0 of SoundFont memory using your sound card's SoundFont control panel. If you have an Audigy sound card you must load all of the SoundFonts twice - once for the "A" synth and once more for the "B" synth. Go to the Options tab and select SB Audigy Synth A. Then click the Configure Bank tab and load each of the SoundFont files in the correct order. Now go back to the Options tab and select SB Audigy Synth B, click the Configure Bank tab again, and load all of the same SoundFonts in the same order again. Note that additional memory is not used when you load a SoundFont more than once.

2. ATTACH THE DUMMY FILES

In order to make Sonar show the names of instruments in the other banks you must attach a SoundFont to each bank you plan to use. I created a tiny (about 1k) SoundFont named Dummy.sf2 (in a Zip file) for this purpose, which you can download from my web site.

This SoundFont has only one instrument using one short sample at Preset 127. (I chose Preset 127 assuming you don't mind losing access to the GunShot sound. When the dummy file is loaded it will supercede whatever was already present at that patch number.) Once you attach the dummy file to Bank 1 in your Sonar song template, all of the instruments already loaded in Bank 1 will become visible from the Pch list when Bank 1 is selected. If you also have sounds in Bank 2 you'll need to make a copy of the dummy file with a different name and load that into Bank 2 as well. Unfortunately, you can't just load the same dummy file repeatedly, so you must create a separate copy for each bank. I suggest you name the files Bank1.sf2, Bank2.sf2, and so forth, as these are the names you'll see in your Sonar MIDI tracks when you click the drop-down Bnk list.

3. CONFIGURE SONAR FOR SOUNDFONTS

By default, Sonar knows that a Creative Labs sound card is a SoundFont device that uses standard GM patch names. But alas, Sonar is not smart enough to know there are two available samplers since only Synth A is identified that way. To fix this go to the Options menu, select Instruments, then one by one select each channel of the "B" synth on the left and click SoundFont Device on the right. Now you'll be able to see all of the instrument names and their bank numbers on every MIDI track, regardless of which Synth port (A or B) the tracks are assigned to.

The last step is to tell Sonar to use the proper Bank Select Method. Sonar seems to know the proper method since it puts an asterisk next to the correct choice, but for some reason it still uses Normal as the default. So for each track in your template right-click on the track number, select Track Properties, and change the Bank Select Method to Controller 0. Now save the template file and you're done. When you load the template again to work on your next masterpiece you'll be able to see all of the instruments in all of the loaded banks, and select the one you want even while the song is playing. More important, all of your SoundFonts will be loaded when you boot up, and Sonar will leave them alone.

4. AUDITION YOUR PATCHES (Added March 3, 2002)

Once you have all of your SoundFonts loaded it is simple to audition the various related instruments in separate banks. For example, if you have several French horns in different banks at standard GM Preset 61, select French horn from Sonar's GM patch list and then click once in middle of the Bnk field. Now you can go from one variation to another - even while a song is playing - by pressing the Plus and Minus keys on the numeric keypad. If you get to a bank that has no French horn patch, the Pch field will show a number instead of the patch's name to let you know that. (You'll still hear a French horn, but it will be the version in Bank 0. SoundBlaster cards are smart enough to play the default patch in Bank 0, instead of playing nothing, if you select a bank that has no instrument in the current patch location.)

One final problem is there's no way to select Bank 0 except with the Plus and Minus keys or by typing a number in the Bnk field manually. When you click on the drop-down list at the right edge of the Bnk field, you'll see there is no option for Bank 0! So if you are now hearing an instrument in Bank 2 and want to jump directly to the variation in Bank 0, all you can select is the no change choice shown as "---" which leaves Bank 2 active. So you must use the Plus and Minus keys to get back to Bank 0, or type the number directly into the Bnk field.


Entire contents of this web site Copyright 1997- by Ethan Winer. All rights reserved.