| 1 | |
| 2 | <refentry id="pvread"> |
| 3 | <indexterm id="IndexPvread"><primary>pvread</primary></indexterm> |
| 4 | <refentryinfo><title>Spectral Processing:STFT</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>pvread</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>pvread</refname> |
| 11 | <refpurpose> |
| 12 | Reads from a phase vocoder analysis file and returns the frequency and amplitude from a single analysis channel or bin. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | <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 <emphasis>pvreads</emphasis> can be used to resynthesize the analyzed sound using additive synthesis by passing the frequency and magnitude values to a bank of oscillators. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>kfreq, kamp <command>pvread</command> ktimpnt, ifile, ibin</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 | |
| 34 | <para> |
| 35 | <emphasis>ibin</emphasis> -- the number of the analysis channel from which to return frequency in Hz and magnitude. |
| 36 | </para> |
| 37 | </refsect1> |
| 38 | |
| 39 | <refsect1> |
| 40 | <title>Performance</title> |
| 41 | <para> |
| 42 | <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 <emphasis>ibin</emphasis> argument. Interpolation between analysis frames is performed at k-rate resolution and dependent of course upon the rate and direction of <emphasis>ktimpnt</emphasis>. |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | <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. |
| 47 | </para> |
| 48 | </refsect1> |
| 49 | |
| 50 | <refsect1> |
| 51 | <title>Examples</title> |
| 52 | <para> |
| 53 | The example below shows the use <emphasis>pvread</emphasis> to synthesize a single component at a time 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. |
| 54 | <example> |
| 55 | <title>Example of the pvread opcode.</title> |
| 56 | <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> |
| 57 | <xi:include href="examples-xml/pvread.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 58 | </example> |
| 59 | </para> |
| 60 | </refsect1> |
| 61 | |
| 62 | <refsect1> |
| 63 | <title>See Also</title> |
| 64 | <para> |
| 65 | <link linkend="SiggenStft"><citetitle>Short-time Fourier Transform (STFT) Resynthesis</citetitle></link> |
| 66 | </para> |
| 67 | </refsect1> |
| 68 | |
| 69 | <refsect1> |
| 70 | <title>Credits</title> |
| 71 | <para> |
| 72 | <simplelist> |
| 73 | <member>Author: Richard Karpen</member> |
| 74 | <member>Seattle, Wash</member> |
| 75 | <member>1997</member> |
| 76 | </simplelist> |
| 77 | </para> |
| 78 | <para>New in version 3.44</para> |
| 79 | </refsect1> |
| 80 | </refentry> |