| 1 | <refentry id="pvstanal"> |
| 2 | <indexterm id="IndexPvstanal"><primary>pvstanal</primary></indexterm> |
| 3 | <refentryinfo><title>Spectral Processing:Streaming</title></refentryinfo> |
| 4 | <refmeta> |
| 5 | <refentrytitle>pvstanal</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | |
| 9 | |
| 10 | <refnamediv> |
| 11 | <refname>pvstanal</refname> |
| 12 | <refpurpose> |
| 13 | Phase vocoder analysis processing with onset detection/processing. |
| 14 | </refpurpose> |
| 15 | </refnamediv> |
| 16 | |
| 17 | <refsect1> |
| 18 | <title>Description</title> |
| 19 | <para> |
| 20 | <emphasis>pvstanal</emphasis> implements phase vocoder analysis by reading function tables |
| 21 | containing sampled-sound sources, with <link linkend="GEN01"><citetitle>GEN01</citetitle></link>, and |
| 22 | <emphasis>pvstanal</emphasis> will accept deferred allocation tables. |
| 23 | </para> |
| 24 | <para> |
| 25 | This opcode allows for time and frequency-independent scaling. Time is advanced internally, but controlled by a tempo scaling parameter; when an onset is detected, timescaling is momentarily stopped to avoid smearing of attacks. The quality of the effect is generally improved with phase locking switched on. |
| 26 | </para> |
| 27 | <para> |
| 28 | <emphasis>pvstanal</emphasis> will also scale pitch, independently of frequency, using a transposition factor (k-rate). |
| 29 | </para> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Syntax</title> |
| 34 | <synopsis>fsig <command>pvstanal</command> ktimescal, kamp, kpitch, ktab, [kdetect, kwrap, ioffset,ifftsize, ihop, idbthresh] |
| 35 | </synopsis> |
| 36 | </refsect1> |
| 37 | |
| 38 | <refsect1> |
| 39 | <title>Initialization</title> |
| 40 | <para> |
| 41 | <emphasis>ifftsize</emphasis> -- FFT size (power-of-two), defaults to 2048. |
| 42 | </para> |
| 43 | <para> |
| 44 | <emphasis>ihop</emphasis> -- hopsize, defaults to 512 |
| 45 | </para> |
| 46 | <para> |
| 47 | <emphasis>ioffset</emphasis> -- startup read offset into table, in secs. |
| 48 | </para> |
| 49 | |
| 50 | <para> |
| 51 | <emphasis>idbthresh</emphasis> -- threshold for onset detection, based on dB power spectrum ratio between two successive windows. A detected ratio above it will cancel timescaling momentarily, to avoid smearing (defaults to 1). |
| 52 | By default anything more than a 1 dB inter-frame power difference will be detected as an onset. |
| 53 | </para> |
| 54 | |
| 55 | </refsect1> |
| 56 | |
| 57 | <refsect1> |
| 58 | <title>Performance</title> |
| 59 | <para> |
| 60 | <emphasis>ktimescal</emphasis> -- timescaling ratio, < 1 stretch, > 1 contract. |
| 61 | </para> |
| 62 | <para> |
| 63 | <emphasis>kamp</emphasis> -- amplitude scaling |
| 64 | </para> |
| 65 | <para> |
| 66 | <emphasis>kpitch</emphasis> -- grain pitch scaling (1=normal pitch, < 1 lower, > 1 higher; negative, backwards) |
| 67 | </para> |
| 68 | |
| 69 | <para> |
| 70 | <emphasis>kdetect</emphasis> -- 0 or 1, to switch onset detection/processing. The onset detector checks for power difference between analysis windows. If more than what has been specified in the dbthresh parameter, an onset is declared. |
| 71 | It suspends timescaling momentarily so the onsets are not modified. The default is 1, so onset detection/processing is on. |
| 72 | </para> |
| 73 | <para> |
| 74 | <emphasis>ktab</emphasis> -- source signal function table. Deferred-allocation tables (see |
| 75 | <link linkend="GEN01"><citetitle>GEN01</citetitle></link>) are accepted, but the opcode |
| 76 | expects a mono source. Tables can be switched at k-rate. |
| 77 | </para> |
| 78 | <para> |
| 79 | <emphasis>kwrap</emphasis> -- 0 or 1, to switch on/off table wrap-around read (default to 1) |
| 80 | </para> |
| 81 | </refsect1> |
| 82 | |
| 83 | <refsect1> |
| 84 | <title>Examples</title> |
| 85 | <para> |
| 86 | Here is an example of the pvstanal opcode. It uses the file <ulink url="examples/pvstanal.csd"><citetitle>pvstanal.csd</citetitle></ulink>. |
| 87 | <example> |
| 88 | <title>Example of the pvstanal opcode.</title> |
| 89 | <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> |
| 90 | <xi:include href="examples-xml/pvstanal.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 91 | </example> |
| 92 | </para> |
| 93 | </refsect1> |
| 94 | |
| 95 | <refsect1> |
| 96 | <title>See also</title> |
| 97 | <para><link linkend="SpectralRealTime"><citetitle>Tools for Real-time Spectral Processing (pvs opcodes)</citetitle></link></para> |
| 98 | </refsect1> |
| 99 | |
| 100 | <refsect1> |
| 101 | <title>Credits</title> |
| 102 | <para> |
| 103 | <simplelist> |
| 104 | <member>Author: &namevictor;</member> |
| 105 | <member>February 2010</member> |
| 106 | </simplelist> |
| 107 | </para> |
| 108 | |
| 109 | <para>New plugin in version 5.13</para> |
| 110 | <para>February 2005.</para> |
| 111 | </refsect1> |
| 112 | </refentry> |