Java Language Programming
The Java programming language is appropriate for this project. It is relatively platform and operating system independent, and has built-in facilities for reading, writing, and processing audio files. However, the project was developed on a Windows 98 system and used WAVE (.WAV) format files for audio input and analysis (test output).
Goals
The long-term goal (not yet realized) of this project is a Java program to take an input audio file or set of files and to automatically generate a complementary pair of output files:
- the SoundFont (.SF2) file, and
- a matching MIDI (.MID) file with exactly the Volume, Control, Velocity, Tempo, and other parameters to re-create the original audio, perhaps not exactly, but subjectively indistinguishably.
Current Accomplishments
The short-term accomplishment of the project is to be able to generate a SoundFont (.SF2) file using a combination of Java programs and utility programs, and to test the SoundFont with manually-created test MIDI (.MID) files.
Initially, I experimented with existing SoundFont files and a SoundFont compiler-decompiler called SF2Comp which I downloaded from the Internet. The output of SF2Comp in decompiler mode is a set of WAVE sample files (extracts of the samples originally embedded in the SoundFont) and a text (.TXT) file with a structured, human-readable listing of the WAVE files and all the non-default parameters in the SoundFont, such as filter parameters, MIDI Patch Number mappings, layering, etc. This same file (or an edited version of it) can be read in along with the WAVE files it specifies (in compiler mode) to create a new SoundFont, so there is a complete round-trip.
After much manual experimentation with these text files, I constructed a simple Java program to generate them from scratch using a smaller number of parameters. At present, the parameters are hard-coded into the program, but eventually some will be derived in part by the program directly analyzing the WAVE sample files, and the rest (not derivable) from extremely small text files (or a database) providing user-supplied mappings such as the desired MIDI Patch Numbers. This Java program will also eventually directly create the SoundFont files, eliminating the need for the intermediate text files and thus also the need for the SF2Comp program.
Testing
For testing, a MIDI rendering program, Audio Compositor, was used to produce an output WAVE (.WAV) file for analysis in Sound Forge XP Studio. This bypassed potential resampling problems from mixes of 44.1 kHz and 48 kHz sampling in the original samples and the output of my SoundBlaster Live! sound card. Thus all WAVE files, input and output, were in 44.1 kHz.
Mapping Sample Files to MIDI Patch Numbers, Note Numbers, and Velocities
I am more or less following the Early Patches system of assigning MIDI Patch Numbers and MIDI Note Numbers, but I depart radically from their system with my method of assigning MIDI Velocity.
The Early Patches audio sample file names are of the form <Folder>\<Quality>_<Dynamic>.wav, for example Bendir\Slap_fff.wav, where <Quality> indicates the quality of the drum hit, e.g. Slap, Bass, Rim.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|