Creating, Editing, and Using SoundFonts (Striving for New Lows, pt. 2)

PLEASE NOTE: This article has been archived. It first appeared on in May 2000, contributed by then Staff Editor Ethan Winer. We will not be making any updates to the article. Please visit the home page for our latest content. Thank you!

As I mentioned earlier, I used the Vienna SoundFont editor to organize the patches in my master SoundFont file. The first step was to build a series of “audition” files, so I could compare the dozens of similar instruments side by side. Vienna includes a bank manager that lets you copy patches from one SoundFont file to another, so I built one file with every clarinet, another with every electric bass, and so forth. Unfortunately, many of the instruments were programmed to play in the wrong octave. So before I could compare them, I had to transpose the Coarse Pitch for those instruments up or down an octave, and then adjust the key range each sample occupies in the Instrument definition to compensate.

Once I had chosen the best patches in each category, I loaded the 8 MB SoundFont that came with my Live card, and one by one replaced sounds with the better versions. In some cases I kept the original patches, if they were good, and added the new instruments to other banks. For example, I ended up with three different xylophones from which I can choose in my sequencer.

Besides making all of the instruments play in the standard octave, I had to balance the levels so they would play at the same volume. I also stripped out the entire SFX percussion bank and all of the other sounds not needed for serious music making like the Bird and Helicopter. This saved about 1.5 MB of sample memory in the file.

Some of the instruments I downloaded were badly looped; others had Wave files that extended beyond the loop end points. Except in special cases, any sound past the loop end is never played and thus wastes memory. So I exported those samples and edited and relooped them in Sound Forge. Further, since saving memory is important, I converted many of the Wave files to a lower sample rate. For example, electric basses don’t really need the full 20 KHz. frequency response a 44.1 KHz. sample rate offers. So I resampled them down to 22,050 KHz., which reduced the memory requirement of those instruments by half.

When a Wave file is exported from Vienna to resample or otherwise edit it, the exported file retains the loop points. This feature allowed me to use the superior editing features of Sound Forge to fine-tune the loop points. When I later brought the file back into Vienna, all of the loop information was intact.

Looping Techniques

If you listen carefully to the open A string on a real electric guitar, you’ll hear the initial plunk as the note is hit, followed by a slight twang or “wow” sound that continues as it fades out. To squeeze all the sounds needed for a full GM bank into only 2MB, most notes play for only the first half second or so, and then loop (repeat) the last cycle over and over for as long you hold down the key. So while the instrument is recognizable as an electric guitar, it has no ambience and sounds static and artificial. Only by using much more of the original recording–at least a second or two, hopefully longer–can a sample-based synthesizer sound realistic. But the longer a sample extends before looping the more memory it requires, and samples recorded in stereo require twice as much as mono.

There are two main methods for looping. The simpler approach is to play some initial portion of the sample, and then loop a single cycle of the waveform. Loop editors like the ones in Vienna and Sound Forge can be confusing at first because the left pane shows the ending portion of the Wave file and the right pane shows an earlier region.

The big problem with single-cycle looping is that the instrument loses all of its ambience as soon as it enters the looped region. Further, after resampling to a lower rate, sometimes the ideal loop points no longer fall on exact sample boundaries. This is a problem especially with high notes because the new, sparser, loop points don’t encompass exactly one cycle. In this case the note may buzz or become sharp or flat when it enters the looped region.

You can often solve these problems by auditioning the looped region continuously while you move both points one “sample tick” at a time until the buzzing is at a minimum. This preserves the basic frequency of the looped region, while finding the spot where the mismatch in level or change in pitch is at a minimum. If the problem can’t be solved, you must go back to the original Wave file and resample at a slightly higher rate and try again. SoundFonts can use any arbitrary sample rate, so you are not limited to the standard rates of 44100, 22050, and 11025.

A much better method for looping is to encompass one or two seconds of the “wow” sound within the loop. This is much harder to do, especially with stereo files where the ideal loop points for one channel are not necessarily ideal for the other channel. Further, if the timbre is not identical where the loop points are spliced you’ll, hear a “bang bang” sound rather than a smooth continuation of the note. Note that when looping stereo samples, you must combine the exported Wave files and loop them as a single stereo file. Otherwise the image will shift to the left or right when the samples enter the looped portion.

Audible Improvements

Some of the instruments I downloaded or bought used samples that were recorded in stereo, but most were recorded in mono. Obviously real stereo samples are better, but there are a few tricks you can use to simulate stereo. In fact, these techniques have the advantage of not needing twice as much memory like real stereo samples do. I’ll describe two very different methods, but first you need to understand how samples are organized within a SoundFont.

SoundFonts are based on a three-level hierarchy: The original samples are used to define an Instrument, which is where you specify in Vienna the range of notes each sample should play. This is also where you establish the ADSR and filter settings, how much vibrato to apply, and so forth. One or more Instruments are then assigned to a Preset, which is the patch you ultimately select from your sequencer.

One method for creating a fake stereo effect is to assign the same Instrument twice to a single Preset, but with one panned hard left and pitch-shifted 1-5 cents high and the other panned hard right and shifted low by the same amount. The more the pitch is shifted the wider the stereo effect. Although this creates a very effective stereo image–especially with electric pianos and organs–it can also create a problem if the song is played in mono. In that case the instrument may sound as if it were processed through a flanger or Harmonizer.

Another–and I think superior–technique is to assign two different samples to play the same range of notes. If an instrument uses several samples to cover the entire range, simply assign the next adjacent sample to each range in addition to the sample already in use. When you then pan one sample hard left and the other hard right, you are using two different recordings for each note, which gives the illusion of width. (You can also use layering to thicken a patch even when leaving it as mono. For example, a thin string section will become much fatter if you layer the adjacent higher sample because the lowered pitch yields a thicker sound.)

I used this technique to create faux stereo on the Pizzicato 1 patch from the Proteus/2 SoundFont with great success. To my ears it yields a more convincing stereo effect than simply pitch-shifting and panning the same samples, which I also tried. And since the left and right channels are derived from different samples, there will be less of a flanging effect if the entire mix is reduced to mono. This layering method is less effective when the samples are very similar, like an electric piano or bass recorded direct rather than through a microphone. And, of course, it doesn’t work at all for instruments that use only one sample for the entire range of notes.

As much as I admire the SoundBlaster Live, the only thing I find less than first rate is the quality of its on-board reverb. Don’t get me wrong, it sounds fine when applied to an entire mix, and on sustained instruments like strings and horns. But when you add a lot of reverb to, say, claves or wood blocks, you can hear the familiar boingy sound common to most software plug-in reverbs. In fact, I recorded a Wave file of a very bright clave hit which I use whenever I try out a new reverb plug-in. Nothing reveals a poor reverb algorithm as well as a sharp impulse with a quick decay that gets out of the way so you can hear the reverb tail.

I disabled (set to Zero) the reverb and other effects on the Live card’s Environmental Audio control panel. Although this results in a dead sound during mixing, you can always turn it on until you’re ready to create the final mix, or add reverb with an external unit. But I simply wait until mixing and add reverb to the final Wave file with Sonic Foundry’s excellent Acoustic Mirror reverb plug-in. I often add reverb in two passes: The first applies a small-room ambience to give a sense of “being there,” and a second pass adds a more traditional Hall or Plate reverb. For instruments that need a huge wash of reverb, or require a reverb very different from the rest of the mix, they can be recorded dry as audio files and processed separately before or during mixdown.

Using SoundFonts

Once you have created a new GM master bank, you can replace the existing bank using the SoundFont control panel. Simply select the current bank, click the Clear button, then click Load to locate and load the new file. You will also have to click the Options tab to allocate enough memory to hold the new bank. In fact, you should allow more memory than the bank requires if you plan to do further work in Vienna while the bank is loaded.

You can also load multiple banks at one time. From the SoundFont control panel’s “Select Bank” list you pick a bank that is marked as Empty, and then load a new SoundFont into that bank. In your sequencer you’ll specify the bank number into which you loaded the additional file, and the patch number then selects the instrument(s) within that bank.

Once you have the new SoundFont file loaded, you can easily get at all of the sounds from your sequencer. If you have variations in alternate banks, simply pick the primary instrument, and then specify the bank. Note that the concept of MIDI banks can be confusing. Usually, a bank of instruments implies that a bank is the master group that holds the various instruments within it. But with SoundFonts (and many synthesizers), the General MIDI instrument number is the group, and the other related patches are kept in alternate banks.

Finally, there is the issue of combining MIDI samples played by a sequencer and audio files played in a multitrack recorder. Many programs do both, such as Cakewalk and Cubase, but I still prefer to use a separate sequencer. I have an Opcode Studio 64X MIDI interface with built-in SMPTE capability. So first I create the sequence, and then record it as an audio file into SAWPlus32, with SAW serving as the SMPTE master and my sequencer as the slave. If I decide later to change the MIDI mix, I simply record it again as audio; the SMPTE sync guarantees that the new audio file is aligned properly, even if I have already recorded additional audio tracks.

If you don’t have a SMPTE-capable MIDI interface, you can still change the mix later. Just make the changes, record the result as audio again onto a new track, and slide the new track forward or back in time until it lines up visually with the original version. Then you can delete the original Wave file to free up the space on your hard disk.