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

  <refnamediv>
    <refname>pvsfread</refname>
    <refpurpose>
      Read a selected channel from a PVOC-EX analysis file.
      <indexterm id="IndexPvsfread"><primary>pvsfread</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Create an fsig stream by reading a selected channel from a PVOC-EX analysis file loaded into memory, with frame interpolation. Only format 0 files (amplitude+frequency) are currently supported. The operation of this opcode mirrors that of pvoc, but outputs an fsig instead of a resynthesized signal.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>fsig <command>pvsfread</command> ktimpt, ifn [, ichan]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifn</emphasis> -- Name of the analysis file. This must have the .pvx file extension.
    </para>

    <para>
      A multi-channel PVOC-EX file can be generated using the extended <link linkend="pvanal"><citetitle>pvanal utility</citetitle></link>.
    </para>

    <para>
      <emphasis>ichan</emphasis> -- (optional) The channel to read (counting from 0). Default is 0.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ktimpt</emphasis> -- Time pointer into analysis file, in seconds. See the description of the same parameter of <link linkend="pvoc"><citetitle>pvoc</citetitle></link> for usage.
    </para>

    <para>
      Note that analysis files can be very large, especially if multi-channel. Reading such files into memory will very likely incur breaks in the audio during real-time performance. As the file is read only once, and is then available to all other interested opcodes, it can be expedient to arrange for a dedicated instrument to preload all such analysis files at startup.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      <informalexample>
        <programlisting>
idur  filelen   &quot;test.pvx&quot;         ; find dur of (stereo) analysis file
kpos  line      0,p3,idur          ; to ensure we process whole file
fsigr pvsfread  kpos,&quot;test.pvx&quot;,1  ; create fsig from R channel
        </programlisting>
      </informalexample>

      (NB: as this example shows, the filelen opcode has been extended to accept both old and new analysis file formats).
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namerichard;</member>
        <member>August 2001 </member>
      </simplelist>
    </para>

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