Debian Codegraph @

opcodes/vpvoc.xml

raw symbols SCIP
1
2 <refentry id="vpvoc">
3 <indexterm id="IndexVpvoc"><primary>vpvoc</primary></indexterm>
4 <refentryinfo><title>Spectral Processing:STFT</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>vpvoc</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>vpvoc</refname>
11 <refpurpose>
12 Implements signal reconstruction using an fft-based phase vocoder and an extra envelope.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Implements signal reconstruction using an fft-based phase vocoder and an extra envelope.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>ares <command>vpvoc</command> ktimpnt, kfmod, ifile [, ispecwp] [, ifn]</synopsis>
26 </refsect1>
27
28 <refsect1>
29 <title>Initialization</title>
30 <para>
31 <emphasis>ifile</emphasis> -- the pvoc number (n in pvoc.n) or the name in quotes of the analysis file made using <link linkend="pvanal"><citetitle>pvanal</citetitle></link>. (See <link linkend="pvoc"><citetitle>pvoc</citetitle></link>.)
32 </para>
33
34 <para>
35 <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.
36 </para>
37
38 <para>
39 <emphasis>ifn</emphasis> (optional, default=0) -- optional function table containing control information for <emphasis>vpvoc</emphasis>. If <emphasis>ifn</emphasis> = 0, control is derived internally from a previous <emphasis>tableseg</emphasis> or <emphasis>tablexseg</emphasis> unit. Default is 0. (New in Csound version 3.59)
40 </para>
41 </refsect1>
42
43 <refsect1>
44 <title>Performance</title>
45 <para>
46 <emphasis>ktimpnt</emphasis> -- The passage of time, in seconds, through the analysis 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.
47 </para>
48
49 <para>
50 <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.
51 </para>
52
53 <para>
54 This implementation of <emphasis>pvoc</emphasis> was orignally written by Dan Ellis. It is based in part on the system of Mark Dolson, but the pre-analysis concept is new. The spectral extraction and amplitude gating (new in Csound version 3.56) were added by Richard Karpen based on functions in SoundHack by Tom Erbe.
55 </para>
56
57 <para>
58 <emphasis>vpvoc</emphasis> is identical to <link linkend="pvoc"><citetitle>pvoc</citetitle></link> except that it takes the result of a previous <link linkend="tableseg"><citetitle>tableseg</citetitle></link> or <link linkend="tablexseg"><citetitle>tablexseg</citetitle></link> and uses the resulting function table (passed internally to the <emphasis>vpvoc</emphasis>), as an envelope over the magnitudes of the analysis data channels. Optionally, a table specified by <emphasis>ifn</emphasis> may be used.
59 </para>
60
61 <para>
62 The result is spectral enveloping. The function size used in the <emphasis>tableseg</emphasis> should be <emphasis>framesize/2,</emphasis> where framesize is the number of bins in the phase vocoder analysis file that is being used by the <emphasis>vpvoc</emphasis>. Each location in the table will be used to scale a single analysis bin. By using different functions for <emphasis>ifn1</emphasis>, <emphasis>ifn2</emphasis>, etc.. in the <emphasis>tableseg</emphasis>, the spectral envelope becomes a dynamically changing one. See also <link linkend="tableseg"><citetitle>tableseg</citetitle></link> and <link linkend="tablexseg"><citetitle>tablexseg</citetitle></link>.
63 </para>
64 </refsect1>
65
66 <refsect1>
67 <title>Examples</title>
68 <para>
69 The following example, using <emphasis>vpvoc</emphasis>, shows the use of functions such as
70
71 <informalexample>
72 <programlisting>
73 <emphasis role="stamnt">f</emphasis> 1 0 256 5 .001 128 1 128 .001
74 <emphasis role="stamnt">f</emphasis> 2 0 256 5 1 128 .001 128 1
75 <emphasis role="stamnt">f</emphasis> 3 0 256 7 1 256 1</programlisting>
76 </informalexample>
77
78 to scale the amplitudes of the separate analysis bins.
79 </para>
80
81 <para>
82 <informalexample>
83 <programlisting>
84 ktime <emphasis role="opc">line</emphasis> 0, p3, 3 <emphasis role="comment">; time pointer, in seconds, into file</emphasis>
85 <emphasis role="opc">tablexseg</emphasis> 1, p3<emphasis role="op">*</emphasis>0.5, 2, p3<emphasis role="op">*</emphasis>0.5, 3
86 apv <emphasis role="opc">vpvoc</emphasis> ktime, 1, &quot;pvoc.file&quot;</programlisting>
87 </informalexample>
88 </para>
89 <para>
90 The result would be a time-varying <quote>spectral envelope</quote> applied to the phase vocoder analysis data. Since this amplifies or attenuates the amount of signal at the frequencies that are paired with the amplitudes which are scaled by these functions, it has the effect of applying very accurate filters to the signal. In this example the first table would have the effect of a band-pass filter, gradually be band-rejected over half the note's duration, and then go towards no modification of the magnitudes over the second half.
91 </para>
92 <para>
93 Here is a complete example of the vpvoc opcode. It uses the file <ulink url="examples/vpvoc.csd"><citetitle>vpvoc.csd</citetitle></ulink>.
94 <example>
95 <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
96 <xi:include href="examples-xml/vpvoc.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
97 </example>
98 </para>
99 </refsect1>
100
101 <refsect1>
102 <title>See Also</title>
103 <para>
104 <link linkend="SiggenStft"><citetitle>Short-time Fourier Transform (STFT) Resynthesis</citetitle></link>
105 </para>
106 </refsect1>
107
108 <refsect1>
109 <title>Credits</title>
110 <para>
111 <simplelist>
112 <member>Authors: Dan Ellis and Richard Karpen</member>
113 <member>Seattle, WA USA</member>
114 <member>1997</member>
115 </simplelist>
116 </para>
117 <para>New in version 3.44</para>
118 </refsect1>
119 </refentry>