Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > b707d9a4ee443103660a75ccb6e51334 > files > 1792

csound-doc-5.19.01-10.mga5.noarch.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>hrtfmove</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="hrtfearly.html" title="hrtfearly" />
    <link rel="next" href="hrtfmove2.html" title="hrtfmove2" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">hrtfmove</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="hrtfearly.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="hrtfmove2.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="hrtfmove">
      <a id="hrtfmove"></a>
      <div class="titlepage"></div>
      <a id="IndexHrtfmove" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">hrtfmove</span>
        </h2>
        <p>hrtfmove — 
      Generates dynamic 3d binaural audio for headphones using magnitude interpolation and phase truncation.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp25998248"></a>
        <h2>Description</h2>
        <p>
      This opcode takes a source signal and spatialises it in the 3 dimensional space around a listener
      by convolving the source with stored head related transfer function (HRTF) based filters.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp25999056"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">aleft, aright <span class="command"><strong>hrtfmove</strong></span> asrc, kAz, kElev, ifilel, ifiler [, imode, ifade, isr]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="idp26033976"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifilel </em></span> -- left HRTF spectral data file
    </p>
        <p>
      <span class="emphasis"><em>ifiler </em></span> -- right HRTF spectral data file
    </p>
        <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>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 <span class="emphasis"><em>sr</em></span> should match datafile <span class="emphasis"><em>sr</em></span>. Files should be in the current directory or the SADIR (see <a class="link" href="CommandEnvironment.html" title="Csound Environment Variables"><em class="citetitle">Environment Variables</em></a>).
      </p>
              </td>
            </tr>
          </table>
        </div>
        <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
       HRTF Data files for use with 
      <a class="link" href="hrtfmove.html" title="hrtfmove"><em class="citetitle">hrtfmove</em></a>,
      <a class="link" href="hrtfmove2.html" title="hrtfmove2"><em class="citetitle">hrtfmove2</em></a>,
      <a class="link" href="hrtfstat.html" title="hrtfstat"><em class="citetitle">hrtfstat</em></a>,
      <a class="link" href="hrtfearly.html" title="hrtfearly"><em class="citetitle">hrtfearly</em></a>,
      <a class="link" href="hrtfreverb.html" title="hrtfreverb"><em class="citetitle">hrtfreverb</em></a>
       were updated for Csound 5.15 and later (the code was updated and is more efficient). Old datafiles are now deprecated.
      </p>
              </td>
            </tr>
          </table>
        </div>
        <p>
      <span class="emphasis"><em>imode</em></span> -- optional, default 0 for phase truncation, 1 for minimum phase
    </p>
        <p>
      <span class="emphasis"><em>ifade</em></span> -- optional, number of processing buffers for phase change crossfade (default 8). Legal range is 1-24. A low value is recommended for complex sources (4 or less: a higher value may make the crossfade audible), a higher value (8 or more: a lower value may make the inconsistency when the filter changes phase values audible) for narrowband sources. Does not effect minimum phase processing.
    </p>
        <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
        Ocassionally fades may overlap (when unnaturally fast/complex trajectories are requested). In this case, a warning will be printed. Use a smaller crossfade or slightly change trajectory to avoid any possible inconsistencies that may arise.
      </p>
              </td>
            </tr>
          </table>
        </div>
        <p>
<span class="emphasis"><em>isr</em></span> - optional, default 44.1kHz, legal values: 44100, 48000 and 96000.
 </p>
        <p>
      <span class="emphasis"><em>kAz</em></span> -- azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.
    </p>
        <p>
      <span class="emphasis"><em>kElev</em></span> -- elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).
    </p>
        <p>
      Artifact-free user-defined trajectories are made possible using an interpolation algorithm based on spectral
      magnitude interpolation and phase truncation. Crossfades are implemented to minimise/eliminate any inconsistencies
      caused by updating phase values. These crossfades are performed over a user definable number of convolution
      processing buffers. Complex sources may only need to crossfade over 1 buffer; narrow band sources may need several.
      The opcode also offers minimum phase based processing, a more traditional and complex method. In this mode, the hrtf
      filters used are reduced to minimum phase representations and the interpolation process then uses the relationship
      between minimum phase magnitude and phase spectra. Interaural time difference, which is inherent to the phase
      truncation process, is reintroduced in the minimum phase process using variable delay lines.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="idp26045552"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the hrtfmove opcode. It uses the file <a class="ulink" href="examples/hrtfmove.csd" target="_top"><em class="citetitle">hrtfmove.csd</em></a>. 
    </p>
        <div class="example">
          <a id="idp26046600"></a>
          <p class="title">
            <strong>Example 341. Example of the htrfmove opcode.</strong>
          </p>
          <div class="example-contents">
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select flags here</span>
<span class="comment">; realtime audio out </span>
 -o dac 
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
 <span class="comment">;-o hrtf.wav</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">kr</span> <span class="op">=</span> 4410
<span class="ohdr">ksmps</span> <span class="op">=</span> 10
<span class="ohdr">nchnls</span> <span class="op">=</span> 2

gasrc <span class="opc">init</span> 0

<span class="oblock">instr</span> 1		<span class="comment">;a plucked string</span>

  kamp <span class="op">=</span> p4
  kcps <span class="op">=</span> <span class="opc">cpspch</span>(p5)
  icps <span class="op">=</span> <span class="opc">cpspch</span>(p5)

  a1 <span class="opc">pluck</span> kamp, kcps, icps, 0, 1

  gasrc <span class="op">=</span> a1

<span class="oblock">endin</span>

<span class="oblock">instr</span> 10	<span class="comment">;uses output from instr1 as source</span>

 kaz	<span class="opc">linseg</span> 0, p3, 720		<span class="comment">;2 full rotations</span>

 aleft,aright <span class="opc">hrtfmove</span> gasrc, kaz,0, "hrtf<span class="op">-</span>44100<span class="op">-</span>left.dat","hrtf<span class="op">-</span>44100<span class="op">-</span>right.dat"

 <span class="opc">outs</span>	aleft, aright
  
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="comment">; Play Instrument 1: a simple arpeggio</span>
<span class="stamnt">i</span>1 0 .2 15000 8.00 
<span class="stamnt">i</span>1 + .2 15000 8.04
<span class="stamnt">i</span>1 + .2 15000 8.07
<span class="stamnt">i</span>1 + .2 15000 8.11
<span class="stamnt">i</span>1 + .2 15000 9.02
<span class="stamnt">i</span>1 + 1.5 15000 8.11
<span class="stamnt">i</span>1 + 1.5 15000 8.07
<span class="stamnt">i</span>1 + 1.5 15000 8.04
<span class="stamnt">i</span>1 + 1.5 15000 8.00
<span class="stamnt">i</span>1 + 1.5 15000 7.09
<span class="stamnt">i</span>1 + 1.5 15000 8.00

<span class="comment">; Play Instrument 10 for 10 seconds.</span>
<span class="stamnt">i</span>10 0 10

<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <br class="example-break" />
      </div>
      <div class="refsect1" title="See Also">
        <a id="idp26047552"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="hrtfmove2.html" title="hrtfmove2"><em class="citetitle">hrtfmove2</em></a>,
      <a class="link" href="hrtfstat.html" title="hrtfstat"><em class="citetitle">hrtfstat</em></a>,
      <a class="link" href="hrtfer.html" title="hrtfer"><em class="citetitle">hrtfer</em></a>.
    </p>
        <p> More information on this opcode: <a class="ulink" href="http://www.csounds.com/journal/issue9/newHRTFOpcodes.html" target="_top"><em class="citetitle">http://www.csounds.com/journal/issue9/newHRTFOpcodes.html</em></a>  , written by Brian Carty </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="idp26050312"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Brian Carty</td>
          </tr>
          <tr>
            <td>Maynooth</td>
          </tr>
          <tr>
            <td>2008</td>
          </tr>
        </table>
        <p>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="hrtfearly.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="hrtfmove2.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">hrtfearly </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> hrtfmove2</td>
        </tr>
      </table>
    </div>
  </body>
</html>