Introduction to MIDI Rendering
There are at least two ways to examine the results of playing a MIDI file with SoundFont files:
- Capturing the output of a SoundFont sound card or software synthesizer in real time; or
- Rendering an output file off-line with a program that computes the output.
Capturing the output of a sound card or software synthesizer is tricky: you have to make sure all other sound sources are temporarily disabled. Currently, SoundFont software synthesizers are only available as plug-ins to high-end sequencers such as Cakewalk's SONAR. Although Creative's line of SoundFont sound cards are inexpensive, they all run at 48 kHz, so that at least one level of resampling has to be done to compare the output with the original 44.1 kHz samples. There is some controversy about the quality of the internal resampling firmware that Creative uses.
The Audio Compositor Program
Audio Compositor is an inexpensive shareware program for Windows that simplifies testing for this project. Among the many capabilities of this program (see the Help File for more information), the single feature that made it worth $40 is the ability to render a set of MIDI files to WAVE files in non-realtime batch mode, with the parameters of the batch process saved in an editable ASCII file.
Audio Compositor can also render samples in the DownLoadable Sounds (DLS ) format in addition to SoundFont format, as well as in its own much more flexible format. It can also convert files among the three formats; however I ran into a few conversion bugs and restrictions,so in the end I decided to proceed with SoundFont format only for the time being.
Help File
I have included a link to Ac.hlp, the Audio Compositor Help File (143 KB). It is readable on any Windows operating system.
Input SF2 File
This file, D:\Program Files\sf2comp\c\Bendir-02.sf2 on my system, is the result of the SoundFont creation process (see Creating SoundFonts) .
Input MIDI Files
Various MIDI files, such as D:\Program Files\Audio Compositor\Bendir-Slap.mid on my system, test different aspects of the SoundFont file.
WAVE Output Files
For each MIDI file, the batch process produces a corresponding stereo WAVE file, for example D:\Program Files\Audio Compositor\Bendir-Slap-sf2.wav for the files listed above.
Batch Processing
In addition to specifying input and output files, the batch file (Bendir-sf2.txt, is included as an example) controls the rendering quality and overall attenuation. I normally choose Extreme quality 44100, which is the highest quality and takes the longest time to compute.
Here are some screen shots showing batch processing:


It's interesting to compare the off-line computation times of Audio Compositor with the real-time MIDI execution times:
| Audio Compositor | real-time | |
| Bendir-Bass.mid | 0 min. 47 sec. | 7 min. 39 sec. |
| Bendir-Slap.mid | 0 min. 18 sec. | 2 min. 32 sec. |
Of course, these are very sparse test files.
Using Sound Forge XP Studio for Analysis
After rendering, the output wave file is available for visual inspection using Sound Forge XP Studio. This particular view compares Bendir-Slap panned hard left (top) and Bendir-Bass panned hard right (bottom), with the right-most long sequence all the MIDI note velocities from 127 down to 1. The irregular shape of the envelope is due to cross-fading adjacent samples, such as Slap_fff to Slap_ff, and only reflects transient peaks; RMS power rolls off much more smoothly.

RMS Power Analysis
I stumbled across a very useful tool in Sound Forge XP Studio under Tools | Statistics...:

By simultaneously playing any two different notes (or the same velocity note played by different types, such as Slap and Bass), panned hard right and left, and selecting the full play time of the notes, the overall RMS power can be compared. RMS power is a useful approximation to subjective loudness. I used this method to determine proper values for sample attenuation in the SoundFont files.
Eventually, when I have fully automated the processing of the WAVE samples, the Java program will compute RMS power in the audio midrange to derive the correct attenuation.
Note: Because of an anomaly in the way left-panned and right-panned waveforms are calculated by Audio Compositor, the Right channel value for RMS power is 0.07 dB too small (negative). Thus the correct comparison value above should be adjusted to -38.05 dB.