<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="vdelayxws">
  <refmeta>
    <refentrytitle>vdelayxws</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>vdelayxws</refname>
    <refpurpose>
      Variable delay opcodes with high quality interpolation.
      <indexterm id="IndexVdelayxws"><primary>vdelayxws</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
       Variable delay opcodes with high quality interpolation.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>aout1, aout2 <command>vdelayxws</command> ain1, ain2, adl, imd, iws [, ist]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ain1, ain2</emphasis> -- input audio signals
    </para>

    <para>
      <emphasis>aout1, aout2</emphasis> -- output audio signals
    </para>

    <para>
      <emphasis>adl</emphasis> -- delay time in seconds
    </para>

    <para>
      <emphasis>imd</emphasis> -- max. delay time (seconds)
    </para>

    <para>
      <emphasis>iws</emphasis> -- interpolation window size (see below)
    </para>

    <para>
      <emphasis>ist</emphasis> -- skip initialization if not zero
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      These opcodes use high quality (and slow) interpolation, that is much more accurate than the currently available linear and cubic interpolation. The <emphasis>iws</emphasis> parameter sets the number of input samples used for calculating one output sample (allowed values are any integer multiply of 4 in the range 4 - 1024); higher values mean better quality and slower speed.
    </para>
 
    <para>
      The vdelayxw opcodes change the position of the write tap in the delay line (unlike all other delay ugens that move the read tap), and are most useful for implementing Doppler effects where the position of the listener is fixed, and the sound source is moving.
    </para>
 
    <para>
      The multichannel opcodes (eg. <emphasis>vdelayx</emphasis>) allow delaying 2 or 4 variables at once (stereo or quad signals); this is much more efficient than using separate opcodes for each channel.
    </para>

    <note>
      <title>Notes</title>
      <para>
        <itemizedlist>
          <listitem><para>Delay time is measured in seconds (unlike in vdelay and vdelay3), and must be a-rate.</para></listitem>
          <listitem><para>The minimum allowed delay is iws/2 samples.</para></listitem>
          <listitem><para>Using the same variables as input and output is allowed in these opcodes.</para></listitem>
          <listitem><para>In vdelayxw*, changing the delay time has some effects on output volume: <literallayout>a = 1 / (1 + dt)</literallayout> where a is the output gain, and dt is the change of delay time per seconds.</para></listitem>
          <listitem><para>These opcodes are best used in the double-precision version of Csound.</para></listitem>
        </itemizedlist>
      </para>
    </note>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="vdelayx"><citetitle>vdelayx</citetitle></link>, 
      <link linkend="vdelayxq"><citetitle>vdelayxq</citetitle></link>, 
      <link linkend="vdelayxs"><citetitle>vdelayxs</citetitle></link>, 
      <link linkend="vdelayxw"><citetitle>vdelayxw</citetitle></link>, 
      <link linkend="vdelayxwq"><citetitle>vdelayxwq</citetitle></link>
    </para>
  </refsect1>
</refentry>
