| 1 | |
| 2 | <refentry id="GEN43"> |
| 3 | <indexterm id="IndexGEN43"><primary>GEN43</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN43</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN43</refname> |
| 10 | <refpurpose> |
| 11 | Loads a PVOCEX file containing a PV analysis. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | This subroutine loads a PVOCEX file containing the PV analysis (amp-freq) |
| 19 | of a soundfile and calculates the average magnitudes of all analysis frames |
| 20 | of one or all audio channels. It then creates a table with these magnitudes |
| 21 | for each PV bin. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis><command>f</command> # time size 43 filecod channel</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialisation</title> |
| 32 | <para> |
| 33 | <emphasis>size</emphasis> -- number of points in the table, |
| 34 | power-of-two or power-of-two plus 1. |
| 35 | GEN 43 does not make any distinction between these two sizes, but it |
| 36 | requires the table to be at least the fftsize/2. PV bins cover the |
| 37 | positive spectrum from 0Hz (table index 0) to the Nyquist (table index |
| 38 | fftsize/2+1) in equal-size frequency increments (of size sr/fftsize). |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>filcod</emphasis> -- a pvocex file (which can be generated |
| 43 | by pvanal). |
| 44 | </para> |
| 45 | |
| 46 | <para> |
| 47 | <emphasis>channel</emphasis> -- audio channel number from which |
| 48 | the magnitudes will be extracted; a 0 will average the |
| 49 | magnitudes from all channels. |
| 50 | </para> |
| 51 | |
| 52 | <para> |
| 53 | Reading stops at the end of the file. |
| 54 | </para> |
| 55 | |
| 56 | <note> |
| 57 | <title>Note</title> |
| 58 | <para>if p4 is positive, the table will be post-normalised. A |
| 59 | negative p4 will cause post-normalisation to be skipped. |
| 60 | </para> |
| 61 | </note> |
| 62 | </refsect1> |
| 63 | |
| 64 | <refsect1> |
| 65 | <title>Examples</title> |
| 66 | <para> |
| 67 | Here is an example of the GEN43 routine. It uses the files <ulink url="examples/gen43.csd"><citetitle>gen43.csd</citetitle></ulink>. |
| 68 | </para> |
| 69 | <para> |
| 70 | Note: In this example, the .csd uses the ‘system_i’ opcode to launch and run the pvanal utility and analyze a section from the sound file, finneganswake1.flac, where we find a bit of reverb and noise. |
| 71 | The ‘reverbnoise’ selection has a duration of 0.8 seconds (-d0.8) which we find after 1.04 seconds of the source (-b1.04) and thus pvanal creates the pvocex file that we use in instrument 3 to remove this noise and reverb from the original with the pvstencil opcode. |
| 72 | |
| 73 | <example> |
| 74 | <title>An example of the GEN43 routine.</title> |
| 75 | <xi:include href="examples-xml/gen43.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 76 | </example> |
| 77 | </para> |
| 78 | |
| 79 | <para> |
| 80 | These tables can be used as a masking table for pvstencil and pvsmaska. |
| 81 | <programlisting><emphasis role="stamnt">f</emphasis>1 0 512 43 "viola.pvx" 1 |
| 82 | <emphasis role="stamnt">f</emphasis>1 0 -1024 -43 "noiseprint.pvx" 0</programlisting> |
| 83 | </para> |
| 84 | <para> |
| 85 | The first example uses a 1024-point FFT phase vocoder analysis file from which |
| 86 | the first channel is used. The second uses all channels of a 2048-point |
| 87 | file, without post-normalisation. For noise reduction applications with |
| 88 | pvstencil, it is easiest to skip table normalisation (negative GEN code). |
| 89 | </para> |
| 90 | </refsect1> |
| 91 | |
| 92 | <refsect1> |
| 93 | <title>Credits</title> |
| 94 | <para>Author: &namevictor;</para> |
| 95 | </refsect1> |
| 96 | </refentry> |