summaryrefslogtreecommitdiff
path: root/opcodes/pvread.xml
blob: c8f78477960409e5d57cb902c5d47ea873facd70 (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
<refentry id="pvread">
<indexterm id="IndexPvread"><primary>pvread</primary></indexterm>
  <refentryinfo><title>Spectral Processing:STFT</title></refentryinfo>
  <refmeta>
    <refentrytitle>pvread</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>pvread</refname>
    <refpurpose>
      Reads from a phase vocoder analysis file and returns the frequency and amplitude from a single analysis channel or bin.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>pvread</emphasis> reads from a <link linkend="pvoc"><citetitle>pvoc</citetitle></link> file and returns the frequency and amplitude from a single analysis channel or bin. The returned values can be used anywhere else in the Csound instrument. For example, one can use them as arguments to an oscillator to synthesize a single component from an analyzed signal or a bank of pvreads can be used to resynthesize the analyzed sound using additive synthesis by passing the frequency and magnitude values to a bank of oscillators.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>kfreq, kamp <command>pvread</command> ktimpnt, ifile, ibin</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>ibin</emphasis> -- the number of the analysis channel from which to return frequency in Hz and magnitude.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kfreq, kamp</emphasis> -- outputs of the <emphasis>pvread</emphasis> unit. These values, retrieved from a phase vocoder analysis file, represent the values of frequency and amplitude from a single analysis channel specified in the ibin argument. Interpolation between analysis frames is performed at k-rate resolution and dependent of course upon the rate and direction of ktimpnt. 
    </para>

    <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 the use <emphasis>pvread</emphasis> to synthesize a single component from a phase vocoder analysis file. It should be noted that the <emphasis>kfreq</emphasis> and <emphasis>kamp</emphasis> outputs can be used for any kind of synthesis, filtering, processing, and so on.
    </para>

    <para>
      <informalexample>
        <programlisting>
ktime         <emphasis>line</emphasis>    0, p3, 3 
kfreq, kamp   <emphasis>pvread</emphasis>  ktime, &quot;pvoc.file&quot;, 7 ; read
                                      ;data from 7th analysis bin.  
asig          <emphasis>oscili</emphasis>  kamp, kfreq, 1  ; function 1
                                      ;is a stored sine
        </programlisting>
      </informalexample>
    </para>
  </refsect1>
 
  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="pvbufread"><citetitle>pvbufread</citetitle></link>, 
      <link linkend="pvcross"><citetitle>pvcross</citetitle></link>, 
      <link linkend="pvinterp"><citetitle>pvinterp</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>