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

  <refnamediv>
    <refname>dconv</refname>
    <refpurpose>
      A direct convolution opcode.
      <indexterm id="IndexDconv"><primary>dconv</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      A direct convolution opcode.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>dconv</command> asig, isize, ifn</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>isize</emphasis> -- the size of the convolution buffer to use.  if the buffer size is smaller than the size of ifn, then only the first isize values will be used from the table.
    </para>

    <para>
      <emphasis>ifn</emphasis> -- table number of a stored function containing the impulse response for convolution.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      Rather than the analysis/resynthesis method of the convolve opcode, <emphasis>dconv</emphasis> uses direct convolution to create the result.  For small tables it can do this quite efficiently, however larger table require much more time to run.  <emphasis>dconv</emphasis> does (isize * ksmps) multiplies on every k-cycle.  Therefore, reverb and delay effects are best done with other opcodes (unless the times are short).
    </para>

    <para>
      <emphasis>dconv</emphasis> was designed to be used with time varying tables to facilitate new realtime filtering capabilities.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the dconv opcode. It uses the files <ulink url="examples/dconv.orc"><citetitle>dconv.orc</citetitle></ulink> and <ulink url="examples/dconv.sco"><citetitle>dconv.sco</citetitle></ulink>.

      <example>
        <title>Example of the dconv opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/dconv.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/dconv.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: William <quote>Pete</quote> Moss</member>
        <member>2001</member>
      </simplelist>
    </para>

    <para>New in version 4.12</para>
  </refsect1>
</refentry>
