hrtfstat
Generates static 3d binaural audio for headphones using a Woodworth based spherical head model with improved low frequency phase accuracy.
This opcode takes a source signal and spatialises it in the 3 dimensional space around a listener using head related transfer function (HRTF) based filters. It produces a static output (azimuth and elevation parameters are i-rate), because a static source allows much more efficient processing than hrtfmove and hrtfmove2,.
Syntax
Initialization
iAz -- azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.
iElev -- elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).
_ifilel _ -- left HRTF spectral data file
_ifiler _ -- right HRTF spectral data file
Note
Spectral datafiles (based on the MIT HRTF database) are available in 3 different sampling rates: 44.1, 48 and 96 khz and are labelled accordingly. Input and processing sr should match datafile sr. Files should be in the current directory or the SADIR (see Environment Variables).
Note
HRTF Data files for use with hrtfmove, hrtfmove2, hrtfstat, hrtfearly, hrtfreverb were updated for Csound 5.15 and later (the code was updated and is more efficient). Old datafiles are now deprecated.
iradius -- optional, head radius used for phase spectra calculation in centimeters (default 9.0)
isr - optional (default 44.1kHz). Legal values are 44100, 48000 and 96000.
Performance
Artifact-free user-defined static spatialisation is made possible using an interpolation algorithm based on spectral magnitude interpolation and a derived phase based on the Woodworth spherical head model. Accuracy is increased for the data set provided by extracting and applying a frequency dependent scaling factor to the phase spectra, leading to a more precise low frequency interaural time difference. Users can control head radius for the phase derivation, allowing a crude level of individualisation. The static source version of the opcode uses overlap add convolution (it does not need STFT processing, see hrtfmove2), and is thus considerably more efficient than hrtfmove2 or hrtfmove, but cannot generate moving sources.
Examples
Here is an example of the hrtfstat opcode. It uses the file hrtfstat.csd.
Here is another example of the hrtfstat opcode. It uses the file htrfstat-2.csd, and Church.wav, which is a looped sample.
See also
Panning and Spatialization: Binaural spatialization
More information on this opcode: http://www.csoundjournal.com/issue9/newHRTFOpcodes.html, written by Brian Carty
Credits
Author: Brian Carty
Maynooth
2008