| 1 | |
| 2 | <refentry id="pvsdemix"> |
| 3 | <indexterm id="IndexPvsdemix"><primary>pvsdemix</primary></indexterm> |
| 4 | <refentryinfo><title>Spectral Processing:Streaming</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>pvsdemix</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>pvsdemix</refname> |
| 11 | <refpurpose> |
| 12 | Spectral azimuth-based de-mixing of stereo sources. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Spectral azimuth-based de-mixing of stereo sources, with a reverse-panning result. This |
| 20 | opcode implements the Azimuth Discrimination and Resynthesis (ADRess) algorithm, developed by |
| 21 | Dan Barry (Barry et Al. "Sound Source Separation Azimuth Discrimination and Resynthesis". DAFx'04, |
| 22 | Univ. of Napoli). The source separation, or de-mixing, is controlled by two parameters: an azimuth |
| 23 | position (<emphasis>kpos</emphasis>) and a subspace width (<emphasis>kwidth</emphasis>). The first one is used to locate the spectral peaks of |
| 24 | individual sources on a stereo mix, whereas the second widens the 'search space', including/exclufing |
| 25 | the peaks around <emphasis>kpos</emphasis>. These two parameters can be used interactively to extract source sounds from |
| 26 | a stereo mix. The algorithm is particularly successful with studio recordings where individual instruments |
| 27 | occupy individual panning positions; it is, in fact, a reverse-panning algorithm. |
| 28 | </para> |
| 29 | <warning> |
| 30 | <para> |
| 31 | 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. |
| 32 | </para> |
| 33 | </warning> |
| 34 | |
| 35 | </refsect1> |
| 36 | |
| 37 | <refsect1> |
| 38 | <title>Syntax</title> |
| 39 | <synopsis>fsig <command>pvsdemix</command> fleft, fright, kpos, kwidth, ipoints</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>fleft</emphasis> -- left channel input pv stream. |
| 50 | </para> |
| 51 | |
| 52 | <para> |
| 53 | <emphasis>fright</emphasis> -- right channel pv stream. |
| 54 | </para> |
| 55 | |
| 56 | <para> |
| 57 | <emphasis>kpos</emphasis> -- the azimuth target centre position, which will be de-mixed, from |
| 58 | left to right (-1 <= <emphasis>kpos</emphasis> <= 1). This is the reverse pan-pot control. |
| 59 | </para> |
| 60 | <para> |
| 61 | <emphasis>kwidth</emphasis> -- the azimuth subspace width, which will determine the number |
| 62 | of points around <emphasis>kpos</emphasis> which will be used in the de-mixing process. |
| 63 | (1 <= <emphasis>kwidth</emphasis> <= <emphasis>ipoints</emphasis>) |
| 64 | </para> |
| 65 | |
| 66 | <para> |
| 67 | <emphasis>ipoints</emphasis> -- total number of discrete points, which will divide |
| 68 | each pan side of the stereo image. This ultimately affects |
| 69 | the resolution of the process. |
| 70 | </para> |
| 71 | </refsect1> |
| 72 | |
| 73 | <refsect1> |
| 74 | <title>Examples</title> |
| 75 | <para> |
| 76 | The example below takes a stereo input and passes through a de-mixing |
| 77 | process revealing a source located at ipos +/- iwidth points. These parameters |
| 78 | can be controlled in realtime (e.g. using FLTK widgets or MIDI) for an interactive |
| 79 | search of sound sources. |
| 80 | <note> Regarding the azimuth <emphasis>kpos</emphasis>, there is a stray image at around azimuth 0, which in case of a source with good intensity may possibly be masked.</note> |
| 81 | <example> |
| 82 | <title>Example</title> |
| 83 | <programlisting> |
| 84 | ifftsize <emphasis role="op">=</emphasis> 1024 |
| 85 | iwtype <emphasis role="op">=</emphasis> 1 <emphasis role="comment">/* cleaner with hanning window */</emphasis> |
| 86 | ipos <emphasis role="op">=</emphasis> -0.8 <emphasis role="comment">/* to the left of the stereo image */</emphasis> |
| 87 | iwidth <emphasis role="op">=</emphasis> 20 <emphasis role="comment">/* use peaks of 20 points around it */</emphasis> |
| 88 | |
| 89 | al,ar <emphasis role="opc">soundin</emphasis> "sinput.wav" |
| 90 | |
| 91 | flc <emphasis role="opc">pvsanal</emphasis> al, ifftsize, ifftsize/4, ifftsize, iwtype |
| 92 | frc <emphasis role="opc">pvsanal</emphasis> ar, ifftsize, ifftsize/4, ifftsize, iwtype |
| 93 | fdm <emphasis role="opc">pvsdemix</emphasis> flc, frc, kpos, kwidth, 100 |
| 94 | adm <emphasis role="opc">pvsynth</emphasis> fdm |
| 95 | |
| 96 | <emphasis role="opc">outs</emphasis> adm, adm</programlisting> |
| 97 | </example> |
| 98 | </para> |
| 99 | <para> |
| 100 | Here is a complete example of the pvsdemix opcode. It uses the file <ulink url="examples/pvsdemix.csd"><citetitle>pvsdemix.csd</citetitle></ulink>. |
| 101 | <example> |
| 102 | <title>Example of the pvsdemix opcode.</title> |
| 103 | <xi:include href="examples-xml/pvsdemix.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 104 | </example> |
| 105 | </para> |
| 106 | </refsect1> |
| 107 | |
| 108 | <refsect1> |
| 109 | <title>See also</title> |
| 110 | <para><link linkend="SpectralRealTime"><citetitle>Tools for Real-time Spectral Processing (pvs opcodes)</citetitle></link></para> |
| 111 | </refsect1> |
| 112 | |
| 113 | <refsect1> |
| 114 | <title>Credits</title> |
| 115 | <para> |
| 116 | <simplelist> |
| 117 | <member>Author: &namevictor;</member> |
| 118 | <member>January 2005</member> |
| 119 | </simplelist> |
| 120 | </para> |
| 121 | |
| 122 | <para>New plugin in version 5</para> |
| 123 | <para>January 2005.</para> |
| 124 | </refsect1> |
| 125 | </refentry> |