| 1 | |
| 2 | <refentry id="pvsmooth"> |
| 3 | <indexterm id="Indexpvsmooth"><primary>pvsmooth</primary></indexterm> |
| 4 | |
| 5 | <refentryinfo><title>Spectral Processing:Streaming</title></refentryinfo> |
| 6 | <refmeta> |
| 7 | <refentrytitle>pvsmooth</refentrytitle> |
| 8 | </refmeta> |
| 9 | |
| 10 | <refnamediv> |
| 11 | <refname>pvsmooth</refname> |
| 12 | <refpurpose> |
| 13 | Smooth the amplitude and frequency time functions of a pv stream using parallel 1st order |
| 14 | lowpass IIR filters with time-varying cutoff frequency. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Smooth the amplitude and frequency time functions of a pv stream using a 1st order |
| 22 | lowpass IIR with time-varying cutoff frequency. This opcode uses the same filter |
| 23 | as the <emphasis>tone</emphasis> opcode, but this time acting separately on the amplitude and frequency |
| 24 | time functions that make up a pv stream. The cutoff frequency parameter runs at the |
| 25 | control-rate, but unlike <emphasis>tone</emphasis> and <emphasis>tonek</emphasis>, it is not specified in Hz, but as fractions |
| 26 | of 1/2 frame-rate (actually the pv stream sampling rate), which is easier to |
| 27 | understand. This means that the highest cutoff frequency is 1 and the lowest 0; the lower |
| 28 | the frequency the smoother the functions and more pronounced the effect will be. |
| 29 | </para> |
| 30 | <para> |
| 31 | These are filters applied to control signals so the effect is basically blurring the spectral evolution. The effects produced are more or less similar to <emphasis>pvsblur</emphasis>, but with two important |
| 32 | differences: 1.smoothing of amplitudes and frequencies use separate sets of filters; and 2. there is |
| 33 | no increase in computational cost when higher amounts of 'blurring' (smoothing) are desired. |
| 34 | </para> |
| 35 | </refsect1> |
| 36 | |
| 37 | <refsect1> |
| 38 | <title>Syntax</title> |
| 39 | <synopsis>fsig <command>pvsmooth</command> fsigin, kacf, kfcf</synopsis> |
| 40 | </refsect1> |
| 41 | |
| 42 | <refsect1> |
| 43 | <title>Performance</title> |
| 44 | <para> |
| 45 | <emphasis>fsig</emphasis> -- output pv stream |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | <emphasis>fsigin</emphasis> -- input pv stream. |
| 50 | </para> |
| 51 | |
| 52 | <para> |
| 53 | <emphasis>kacf</emphasis> -- amount of cutoff frequency for amplitude function filtering, between 0 and 1, |
| 54 | in fractions of 1/2 frame-rate. |
| 55 | </para> |
| 56 | |
| 57 | <para> |
| 58 | <emphasis>kfcf</emphasis> -- amount of cutoff frequency for frequency function filtering, between 0 and 1, |
| 59 | in fractions of 1/2 frame-rate. |
| 60 | </para> |
| 61 | |
| 62 | <warning> |
| 63 | <para> |
| 64 | It is unsafe to use the same f-variable for both input and output of pvs opcodes. Using the same one might lead to undefined behavior on some opcodes. Use a different one on the left and right sides of the opcode. |
| 65 | </para> |
| 66 | </warning> |
| 67 | </refsect1> |
| 68 | |
| 69 | <refsect1> |
| 70 | <title>Examples</title> |
| 71 | <para> |
| 72 | Here is an example of the pvsmooth opcode. It uses the file <ulink url="examples/pvsmooth.csd"><citetitle>pvsmooth.csd</citetitle></ulink>. |
| 73 | <example> |
| 74 | <title>Example of the pvsmooth opcode.</title> |
| 75 | <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> |
| 76 | <xi:include href="examples-xml/pvsmooth.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 77 | </example> |
| 78 | </para> |
| 79 | <para> |
| 80 | The formula for calculating the cutoff frequency of the filter: frame rate / hopsize = new frame starts per second (in Hz), then the percentage of half the framerate. |
| 81 | For example, looking at the first note in the example, the frame rate is 44100 / 256 = 172,265625 Hz (= 172 new frame starts per |
| 82 | second). half of the frame rate is about 86 Hz, and one percent of this is 0.86 Hz. |
| 83 | </para> |
| 84 | </refsect1> |
| 85 | |
| 86 | <refsect1> |
| 87 | <title>See also</title> |
| 88 | <para><link linkend="SpectralRealTime"><citetitle>Tools for Real-time Spectral Processing (pvs opcodes)</citetitle></link></para> |
| 89 | </refsect1> |
| 90 | |
| 91 | <refsect1> |
| 92 | <title>Credits</title> |
| 93 | <para> |
| 94 | <simplelist> |
| 95 | <member>Author: &namevictor;</member> |
| 96 | <member>May 2006 </member> |
| 97 | </simplelist> |
| 98 | </para> |
| 99 | |
| 100 | <para>New plugin in version 5</para> |
| 101 | <para>May 2006.</para> |
| 102 | </refsect1> |
| 103 | </refentry> |