Debian Codegraph @

opcodes/pvbufread.xml

raw symbols SCIP
1
2 <refentry id="pvbufread">
3 <indexterm id="IndexPvbufread"><primary>pvbufread</primary></indexterm>
4 <refentryinfo><title>Spectral Processing:STFT</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>pvbufread</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>pvbufread</refname>
11 <refpurpose>
12 Reads from a phase vocoder analysis file and makes the retrieved data available.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 <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.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis><command>pvbufread</command> ktimpnt, ifile</synopsis>
26 </refsect1>
27
28 <refsect1>
29 <title>Initialization</title>
30 <para>
31 <emphasis>ifile</emphasis> -- the <emphasis>pvoc</emphasis> number (n in pvoc.n) or the name in quotes of the analysis file made using <emphasis>pvanal</emphasis>. (See <link linkend="pvoc"><citetitle>pvoc</citetitle></link>.)
32 </para>
33 </refsect1>
34
35 <refsect1>
36 <title>Performance</title>
37 <para>
38 <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.
39 </para>
40 </refsect1>
41
42 <refsect1>
43 <title>Examples</title>
44 <para>
45 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 <emphasis>linseg</emphasis> 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 0.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.
46 </para>
47
48 <para>
49 <informalexample>
50 <programlisting>
51 ktime1 <emphasis role="opc">line</emphasis> 0, p3, 3.5 <emphasis role="comment">; used as index in the &quot;oboe.pvoc&quot; file</emphasis>
52 ktime2 <emphasis role="opc">line</emphasis> 0, p3, 4.5 <emphasis role="comment">; used as index in the &quot;clar.pvoc&quot; file</emphasis>
53 kinterp <emphasis role="opc">linseg</emphasis> 1, p3<emphasis role="op">*</emphasis>0.15, 1, p3<emphasis role="op">*</emphasis>0.35, 0, p3<emphasis role="op">*</emphasis>0.25, 0, p3<emphasis role="op">*</emphasis>0.15, 1, p3<emphasis role="op">*</emphasis>0.1, 1
54 <emphasis role="opc">pvbufread</emphasis> ktime1, &quot;oboe.pvoc&quot;
55 apv <emphasis role="opc">pvinterp</emphasis> ktime2,1,&quot;clar.pvoc&quot;, 1, 1.065, 1, 0.75, 1<emphasis role="op">-</emphasis>kinterp, 1<emphasis role="op">-</emphasis>kinterp</programlisting>
56 </informalexample>
57 </para>
58
59 <para>
60 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>.
61 </para>
62
63 <para>
64 <informalexample>
65 <programlisting>
66 ktime1 <emphasis role="opc">line</emphasis> 0, p3, 3.5 <emphasis role="comment">; used as index in the &quot;oboe.pvoc&quot; file</emphasis>
67 ktime2 <emphasis role="opc">line</emphasis> 0, p3, 4.5 <emphasis role="comment">; used as index in the &quot;clar.pvoc&quot; file</emphasis>
68 kcross <emphasis role="opc">expon</emphasis> 0.001, p3, 1
69 <emphasis role="opc">pvbufread</emphasis> ktime1, &quot;oboe.pvoc&quot;
70 apv <emphasis role="opc">pvcross</emphasis> ktime2, 1, &quot;clar.pvoc&quot;, 1<emphasis role="op">-</emphasis>kcross, kcross</programlisting>
71 </informalexample>
72 </para>
73 <para>
74 Here is a complete example of the pvbufread opcode. It uses the file <ulink url="examples/pvbufread.csd"><citetitle>pvbufread.csd</citetitle></ulink>
75 <example>
76 <title>Example of the pvbufread opcode.</title>
77 <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>
78 <xi:include href="examples-xml/pvbufread.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
79 </example>
80 </para>
81 </refsect1>
82
83 <refsect1>
84 <title>See Also</title>
85 <para>
86 <link linkend="SiggenStft"><citetitle>Short-time Fourier Transform (STFT) Resynthesis</citetitle></link>
87 </para>
88 </refsect1>
89
90 <refsect1>
91 <title>Credits</title>
92 <para>
93 <simplelist>
94 <member>Author: Richard Karpen</member>
95 <member>Seattle, WA USA</member>
96 <member>1997</member>
97 </simplelist>
98 </para>
99 </refsect1>
100 </refentry>