| 1 | |
| 2 | <refentry id="hrtfmove2"> |
| 3 | <indexterm id="IndexHrtfmove2"><primary>hrtfmove2</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Modifiers:Panning and Spatialization</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>hrtfmove2</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>hrtfmove2</refname> |
| 11 | <refpurpose> |
| 12 | Generates dynamic 3d binaural audio for headphones using a Woodworth based spherical head model |
| 13 | with improved low frequency phase accuracy. |
| 14 | </refpurpose> |
| 15 | </refnamediv> |
| 16 | |
| 17 | <refsect1> |
| 18 | <title>Description</title> |
| 19 | <para> |
| 20 | This opcode takes a source signal and spatialises it in the 3 dimensional space around a listener |
| 21 | using head related transfer function (HRTF) based filters. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>aleft, aright <command>hrtfmove2</command> asrc, kAz, kElev, ifilel, ifiler [,ioverlap, iradius, isr]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>ifilel</emphasis> -- left HRTF spectral data file |
| 34 | </para> |
| 35 | <para> |
| 36 | <emphasis>ifiler</emphasis> -- right HRTF spectral data file |
| 37 | </para> |
| 38 | <note> |
| 39 | <para> |
| 40 | 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 <emphasis>sr</emphasis> should match datafile <emphasis>sr</emphasis>. Files should be in the current directory or the SADIR (see <link linkend="CommandEnvironment"><citetitle>Environment Variables</citetitle></link>). |
| 41 | </para> |
| 42 | </note> |
| 43 | <note> |
| 44 | <para> |
| 45 | HRTF Data files for use with |
| 46 | <link linkend="hrtfmove"><citetitle>hrtfmove</citetitle></link>, |
| 47 | <link linkend="hrtfmove2"><citetitle>hrtfmove2</citetitle></link>, |
| 48 | <link linkend="hrtfstat"><citetitle>hrtfstat</citetitle></link>, |
| 49 | <link linkend="hrtfearly"><citetitle>hrtfearly</citetitle></link>, |
| 50 | <link linkend="hrtfreverb"><citetitle>hrtfreverb</citetitle></link> |
| 51 | were updated for Csound 5.15 and later (the code was updated and is more efficient). Old datafiles are now deprecated. |
| 52 | </para> |
| 53 | </note> |
| 54 | <para> |
| 55 | <emphasis>ioverlap</emphasis> -- optional, number of overlaps for STFT processing (default 4). See STFT section of manual. |
| 56 | </para> |
| 57 | <para> |
| 58 | <emphasis>iradius</emphasis> -- optional, head radius used for phase spectra calculation in centimeters (default 9.0) |
| 59 | </para> |
| 60 | |
| 61 | <para> |
| 62 | <emphasis>isr</emphasis> - optional, default 44.1kHz, legal values: 44100, 48000 and 96000. |
| 63 | </para> |
| 64 | </refsect1> |
| 65 | <refsect1> |
| 66 | <title>Performance</title> |
| 67 | <para> |
| 68 | <emphasis>asrc</emphasis> -- Input/source signal. |
| 69 | </para> |
| 70 | <para> |
| 71 | <emphasis>kAz</emphasis> -- azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left. |
| 72 | </para> |
| 73 | <para> |
| 74 | <emphasis>kElev</emphasis> -- elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40). |
| 75 | </para> |
| 76 | <para> |
| 77 | Artifact-free user-defined trajectories are made possible using an interpolation algorithm based on spectral |
| 78 | magnitude interpolation and a derived phase spectrum based on the Woodworth spherical head model. |
| 79 | Accuracy is increased for the data set provided by extracting and applying a frequency dependent scaling factor |
| 80 | to the phase spectra, leading to a more precise low frequency interaural time difference. |
| 81 | Users can control head radius for the phase derivation, allowing a crude level of individualisation. |
| 82 | The dynamic source version of the opcode uses a Short Time Fourier Transform algorithm to avoid artefacts |
| 83 | caused by derived phase spectra changes. STFT processing means this opcode is more computationally intensive |
| 84 | than <link linkend="hrtfmove"><citetitle>hrtfmove</citetitle></link> using phase truncation, but phase is constantly updated by <emphasis>hrtfmove2</emphasis>. |
| 85 | </para> |
| 86 | </refsect1> |
| 87 | |
| 88 | <refsect1> |
| 89 | <title>Examples</title> |
| 90 | <para> |
| 91 | Here is an example of the hrtfmove2 opcode. It uses the file <ulink url="examples/hrtfmove2.csd"><citetitle>hrtfmove2.csd</citetitle></ulink>. |
| 92 | </para> |
| 93 | <example> |
| 94 | <title>Example of the htrfmove2 opcode.</title> |
| 95 | <xi:include href="examples-xml/hrtfmove2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 96 | </example> |
| 97 | </refsect1> |
| 98 | |
| 99 | <refsect1> |
| 100 | <title>See also</title> |
| 101 | <para><link linkend="SigmodPanspatl"><citetitle>Panning and Spatialization: Binaural spatialization</citetitle></link></para> |
| 102 | <para> More information on this opcode: <ulink url="http://www.csoundjournal.com/issue9/newHRTFOpcodes.html"><citetitle>http://www.csoundjournal.com/issue9/newHRTFOpcodes.html</citetitle></ulink>, written by Brian Carty </para> |
| 103 | </refsect1> |
| 104 | |
| 105 | <refsect1> |
| 106 | <title>Credits</title> |
| 107 | <para> |
| 108 | <simplelist> |
| 109 | <member>Author: Brian Carty</member> |
| 110 | <member>Maynooth</member> |
| 111 | <member>2008</member> |
| 112 | </simplelist> |
| 113 | </para> |
| 114 | </refsect1> |
| 115 | </refentry> |