Introduction
By the power of HRTF, I present an HRTF panner… in VST form! Most of the code was originally created for a PortAudio implementation, and then adapted for the VST specification. The code to read the HRTF directory was taken and adapted from code in the MAT 240C codebase, by an anonymous author.
{photo href=”http://www.flickr.com/photos/chancesend/35344177/” title=”Screen shot” src=”http://farm1.static.flickr.com/155/353444177_c8add19677_m.jpg” width=”240″ caption=”UI of the prototype HRTF panning plugin”}
The interface is nothing to write home about, but looks can be deceiving. This plugin will eat your mono audio's soul and spit it out as a glob of spatial HRTF audio.
Download
Download the project file (Microsoft Visual Studio .Net). It should be cross-compatible, but may require some tweaking on your system to compile properly.
You will also need {extlink href=”http://www.fftw.org” linktext=”FFTW3″} (compiled as a DLL), {extlink href=”http://www.mega-nerd.com/libsndfile/” linktext=”LibSndFile”} (compiled as a LIB), and the {extlink href=”http://recherche.ircam.fr/equipes/salles/listen/download.html” linktext=”IRC_1026_R IRCAM HRTF files”}. Upon downloading the IRCAM files, put the "files" file included in the zip archive into the directory. This allows the code to load up all of the HRIR impulse responses. (Note: the use of another IRCAM data set is possible, but modification of both the C code and the "files" index file will be required.)
Requirements
To run the plugin on your machine, you will require:
- hrtf.dll installed in your common VST Plugins directory
- Support files: fftw3.dll and the IRC_1026_R directory installed in the same location as hrtf.dll
- A reasonably fast computer (10% computer usage on a 2.2 GHz P4, you do the math)
- Patience for pre-alpha software
Though this plugin should be cross-platform and compatible with all VST hosts, this is not guaranteed. As of this writing, the only host this has been tested in is H. Seib's VSTHost.
Future Improvements
There are many things that need to be improved. Let's list them, shall we?
- User Interface: A kick-booty GUI is essential for a good plugin. We're talking 3D OpenGL Matrix-style graphics, with flying speaker sources and stuff…
- Fix the Phi bug: Right now setting Phi to anything other than between 0 and 90 and 315 through 345 produces wrong results. Modifying the SelectHRTF() function will accomplish this
- HRTF interpolation: As of now, the plugin simply selects the closest HRTF. Fine for static transforms, not so good for moving sources. We need to calculate the intermediate HRTFs for moving sources to better accomodate moving sounds.
- Lots'o testing: VST plugins and hosts are notorious for their idiosynchrocies. Thus, a regimented system of testing needs to be implemented to weed out bugs.
Final words
And that's that. Happy? What, you mean you're not? Then contact me and let me know about it.