summaryrefslogtreecommitdiff
path: root/opcodes/pvcross.xml
blob: fbfb2d336e6fec21e3770e7f97c043bc3e52d0cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<refentry id="pvcross">
<indexterm id="IndexPvcross"><primary>pvcross</primary></indexterm>
  <refentryinfo><title>Spectral Processing:STFT</title></refentryinfo>
  <refmeta>
    <refentrytitle>pvcross</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>pvcross</refname>
    <refpurpose>
      Applies the amplitudes from one phase vocoder analysis file to the data from a second file.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>pvcross</emphasis> applies the amplitudes from one phase vocoder analysis file to the data from a second file and then performs the resynthesis. The data is passed, as described above, from a previously called <link linkend="pvbufread"><citetitle>pvbufread</citetitle></link> unit. The two k-rate amplitude arguments are used to scale the amplitudes of each files separately before they are added together and used in the resynthesis (see below for further explanation). The frequencies of the first file are not used at all in this process. This unit simply allows for cross-synthesis through the application of the amplitudes of the spectra of one signal to the frequencies of a second signal. Unlike <link linkend="pvinterp"><citetitle>pvinterp</citetitle></link>, <emphasis>pvcross</emphasis> does allow for the use of the <emphasis>ispecwp</emphasis> as in <link linkend="pvoc"><citetitle>pvoc</citetitle></link> and <link linkend="vpvoc"><citetitle>vpvoc</citetitle></link>.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>pvcross</command> ktimpnt, kfmod, ifile, kampscale1, kampscale2 [, ispecwp]</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>

    <para>
      <emphasis>ispecwp</emphasis> (optional, default=0) -- if non-zero, attempts to preserve the spectral envelope while
its frequency content is varied by <emphasis>kfmod</emphasis>. The default value is zero.
    </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>

    <para>
      <emphasis>kfmod</emphasis> -- a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and .5 down an octave.
    </para>

    <para>
      <emphasis>kampscale1, kampscale2</emphasis> -- used to scale the amplitudes stored in each frame of the phase vocoder analysis file. <emphasis>kampscale1</emphasis> scale the amplitudes of the data from the file read by the previously called <emphasis>pvbufread</emphasis>. <emphasis>kampscale2</emphasis> scale the amplitudes of the file named by <emphasis>ifile</emphasis>. 
    </para>

    <para>
      By using these arguments, it is possible to adjust these values before applying the interpolation. For example, if file1 is much louder than file2, it might be desirable to scale down the amplitudes of file1 or scale up those of file2 before interpolating. Likewise one can adjust the frequencies of each to bring them more in accord with one another (or just the opposite, of course!) before the interpolation is performed.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Below is an example using <link linkend="pvbufread"><citetitle>pvbufread</citetitle></link> 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="pvbufread"><citetitle>pvbufread</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, Wash</member>
        <member>1997</member>
      </simplelist>
    </para>
    <para>New in version 3.44</para>
  </refsect1>
</refentry>