summaryrefslogtreecommitdiff
path: root/opcodes/pvscale.xml
blob: 8e0caf129cbf31c5835286df6498749e4d1d3b09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<refentry id="pvscale">
<indexterm id="IndexPvscale"><primary>pvscale</primary></indexterm>
  <refentryinfo><title>Spectral Processing:Streaming</title></refentryinfo>
  <refmeta>
    <refentrytitle>pvscale</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>pvscale</refname>
    <refpurpose>
      Scale the frequency components of a pv stream.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Scale the frequency components of a pv stream, resulting
in pitch shift. Output amplitudes can be optionally modified in order
to attempt formant preservation.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>fsig <command>pvscale</command> fsigin, kscal[, kkeepform, kgain, kcoefs]</synopsis>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>fsig</emphasis> -- output pv stream
    </para>

    <para>
      <emphasis>fsigin</emphasis> -- input pv stream
    </para>

    <para>
      <emphasis>kscal</emphasis> -- scaling ratio.
    </para>

    <para>
      <emphasis>kkeepform</emphasis> -- attempt to keep input signal
                                formants; 0: do not keep formants;
                                1: keep formants using a liftered cepstrum method; 2: keep formants by 
                                using a true envelope method
                                (defaults to 0). 
    </para>

    <para>
      <emphasis>kgain</emphasis> -- amplitude scaling (defaults to 1).
    </para>

<para>
      <emphasis>kcoefs</emphasis> -- number of cepstrum coefs used in formant preservation (defaults to 80).
    </para>


    <para>
      The quality of the pitch shift will be improved with the use of a
      Hanning window in the pvoc analysis. Formant preservation method 1 is less intensive than method 2, which might not be suited
      to realtime use.
    </para>
    <warning>
      <para>
        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.
      </para>
   </warning>

  </refsect1>
  <refsect1>
    <title>Examples</title>
    <para>
      <example>
        <title>Example</title>
        <programlisting>
asig  in                                 ; get the signal in

fsig  pvsanal   asig, 1024, 256, 1024, 1 ; analyse it
ftps  pvscale   fsig, 1.5, 1, 1          ; transpose it keeping formants
atps  pvsynth  ftps                      ; synthesise it

adp   delayr .1                          ; delay original signal
adel  deltapn 1024	                 ; by 1024 samples
      delayw  asig
       out atps+adel                     ; add tranposed and original
</programlisting>
      </example>
    </para>
    <para>
    The example above shows a vocal harmoniser. The delay is necessary to
    time-align the signals, as the analysis-synthesis process will imply a
    delay of 1024 samples between the analysis input and the synthesis output.
    </para>
    <para>
      Here is an example of the use of the <emphasis>pvscale</emphasis> opcode. It uses the file <ulink url="examples/pvscale.csd"><citetitle>pvscale.csd</citetitle></ulink>.
      <example>
        <title>Example of the <emphasis>pvscale</emphasis> opcode.</title>
        <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>
          <xi:include href="examples-xml/pvscale.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="pvsanal"><citetitle>pvsanal</citetitle></link>,
      <link linkend="pvsynth"><citetitle>pvsynth</citetitle></link>,
      <link linkend="pvsadsyn"><citetitle>pvsadsyn</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namevictor;</member>
        <member>November 2004 </member>
      </simplelist>
    </para>

    <para>New plugin in version 5</para>
    <para>November 2004.</para>
  </refsect1>
</refentry>