<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="pvbufread">
  <refmeta>
    <refentrytitle>pvbufread</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>pvbufread</refname>
    <refpurpose>
      Reads from a phase vocoder analysis file and makes the retrieved data available.
      <indexterm id="IndexPvbufread"><primary>pvbufread</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>pvbufread</emphasis> reads from a <link linkend="pvoc"><citetitle>pvoc</citetitle></link> file and makes the retrieved data available to any following <link linkend="pvinterp"><citetitle>pvinterp</citetitle></link> and <link linkend="pvcross"><citetitle>pvcross</citetitle></link> units that appear in an instrument before a subsequent <emphasis>pvbufread</emphasis> (just as <link linkend="lpread"><citetitle>lpread</citetitle></link> and <link linkend="lpreson"><citetitle>lpreson</citetitle></link> work together). The data is passed internally and the unit has no output of its own. 
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>pvbufread</command> ktimpnt, ifile</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifile</emphasis> -- the <emphasis>pvoc</emphasis> number (n in pvoc.n) or the name in quotes of the analysis file made using pvanal. (See <link linkend="pvoc"><citetitle>pvoc</citetitle></link>.)
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ktimpnt</emphasis> -- the passage of time, in seconds, through this file. <emphasis>ktimpnt</emphasis> must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      The example below shows an example using <emphasis>pvbufread</emphasis> with <emphasis>pvinterp</emphasis> to interpolate between the sound of an oboe and the sound of a clarinet. The value of <emphasis>kinterp</emphasis> returned by a linseg is used to determine the timing of the transitions between the two sounds. The interpolation of frequencies and amplitudes are controlled by the same factor in this example, but for other effects it might be interesting to not have them synchronized in this way. In this example the sound will begin as a clarinet, transform into the oboe and then return again to the clarinet sound. The value of <emphasis>kfreqscale2</emphasis> is 1.065 because the oboe in this case is a semitone higher in pitch than the clarinet and this brings them approximately to the same pitch. The value of <emphasis>kampscale2</emphasis> is .75 because the analyzed clarinet was somewhat louder than the analyzed oboe. The setting of these two parameters make the transition quite smooth in this case, but such adjustments are by no means necessary or even advocated.
    </para>

    <para>
      <informalexample>
        <programlisting>
ktime1  <emphasis>line</emphasis>      0, p3, 3.5 ; used as index in the &quot;oboe.pvoc&quot; file
ktime2  <emphasis>line</emphasis>      0, p3, 4.5 ; used as index in the  &quot;clar.pvoc&quot; file
kinterp <emphasis>linseg</emphasis>    1, p3*.15, 1, p3*.35, 0, p3*.25, 0, p3*.15, 1, p3*.1, 1
        <emphasis>pvbufread</emphasis> ktime1, &quot;oboe.pvoc&quot;
apv     <emphasis>pvinterp</emphasis>  ktime2,1,&quot;clar.pvoc&quot;,1,1.065,1,.75,1-kinterp,1-kinterp
        </programlisting>
      </informalexample>
    </para>

    <para>
      Below is an example using <emphasis>pvbufread</emphasis> with <emphasis>pvcross</emphasis>. In this example the amplitudes used in the resynthesis gradually change from those of the oboe to those of the clarinet. The frequencies, of course, remain those of the clarinet throughout the process since <emphasis>pvcross</emphasis> does not use the frequency data from the file read by <emphasis>pvbufread</emphasis>.
    </para>

    <para>
      <informalexample>
        <programlisting>
ktime1  <emphasis>line</emphasis>    0, p3, 3.5 ; used as index in the &quot;oboe.pvoc&quot; file
ktime2  <emphasis>line</emphasis>    0, p3, 4.5 ; used as index in the &quot;clar.pvoc&quot; file
kcross  <emphasis>expon</emphasis>     .001, p3, 1
        <emphasis>pvbufread</emphasis> ktime1, &quot;oboe.pvoc&quot;
apv     <emphasis>pvcross</emphasis>   ktime2, 1, &quot;clar.pvoc&quot;, 1-kcross, kcross
        </programlisting>
      </informalexample>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="pvcross"><citetitle>pvcross</citetitle></link>,
      <link linkend="pvinterp"><citetitle>pvinterp</citetitle></link>,
      <link linkend="pvread"><citetitle>pvread</citetitle></link>,
      <link linkend="tableseg"><citetitle>tableseg</citetitle></link>,
      <link linkend="tablexseg"><citetitle>tablexseg</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Richard Karpen</member>
        <member>Seattle, WA USA</member>
        <member>1997</member>
      </simplelist>
    </para>
  </refsect1>
</refentry>
