Debian Codegraph @

spectral/realtime.xml

raw symbols SCIP
1
2 <section id="SpectralRealTime">
3 <title>Tools for Real-time Spectral Processing (pvs opcodes)</title>
4
5 <para>
6 With these opcodes, two new core facilities are added to Csound. They offer improved audio quality, and fast performance, enabling high-quality analysis and resynthesis (together with transformations) to be applied in real-time to live signals. The original Csound phase vocoder remains unaltered; the new opcodes use an entirely separate set of functions based on <quote>pvoc.c</quote> in the CARL distribution, written by Mark Dolson.
7 </para>
8
9 <para>
10 The Csound <link linkend="dnoise"><citetitle>dnoise</citetitle></link> and <link linkend="src_conv"><citetitle>src_conv</citetitle></link> utilities (also by Dolson, from CARL) also use this pvoc engine. CARL pvoc is also the basis for the phase vocoder included in the Composer's Desktop Project. A few small but important modifications have been made to the original CARL code to support real-time streaming.
11 </para>
12
13 <para>
14 <orderedlist>
15 <listitem><para>Support for the new PVOC-EX analysis file format. This is a fully portable (cross-platform) open file format, supporting three analysis formats, and multi-channel signals. Currently only the standard amplitude+frequency format has been implemented in the opcodes, but the file format itself supports amplitude+phase and complex (real-imaginary) formats. In addition to the new opcodes, the original Csound pvoc opcodes have been extended (and thereby with enhanced audio quality in some cases) to read PVOC-EX files as well as the original (non-portable) format.</para>
16
17 <para>Full details of the structure of a PVOC-EX file are
18 available via the website: <ulink
19 url="http://www.cs.bath.ac.uk/~jpff/NOS-DREAM/researchdev/pvocex/pvocex.html"><citetitle>http://www.cs.bath.ac.uk/~jpff/NOS-DREAM/researchdev/pvocex/pvocex.html</citetitle></ulink>. This
20 site also gives details of the freely available console programs
21 pvocex and pvocex2 which can be used to create PVOC-EX files in
22 all supported formats.
23 </para></listitem>
24
25 <listitem><para>
26 A new frequency-domain signal type, fully
27 streamable, with <emphasis>f</emphasis> as the leading character.
28 In this document it is conveniently referred to as an
29 <emphasis>fsig</emphasis>. Primary support for fsigs is provided
30 by the opcodes pvsanal and pvsynth, which perform conventional
31 phase vocoder overlap-add analysis and resynthesis, independently
32 of the orchestra control-rate. The only requirement is that the
33 control-rate kr be higher than or equal to the analysis rate,
34 whch can be expressed by the requirement that ksmps &lt;=
35 overlap, where overlap is the distance in samples between
36 analysis frames, as specified for pvsanal. As overlap is
37 typically at least 128, and more usually 256, this is not an
38 onerous restriction in practice. The opcode pvsinfo can be used
39 at init time to acquire the properties of an fsig.</para>
40
41 <para>The fsig enables the nominal separation between the
42 analysis and resynthesis stages of the phase vocoder to be
43 exposed to the Csound programmer, so that not only can
44 alternatives be employed for either or both of these stages (not
45 only oscillator-bank resynthesis, but also the generation of
46 synthetic fsig streams), but opcodes, operating on the fsig
47 stream, can themselves become more elemental. Thus the fsig
48 enables the creation of a true streaming plugin framework for
49 frequency domain signals. With the old pvoc opcodes, each opcode
50 is required to act as a resynthesiser, so that facilities such
51 as pitch scaling are duplicated in each opcode; and in many
52 cases the opcodes are parameter-rich. The separation of analysis
53 and synthesis stages by means of the fsig encourages the
54 development of a wide range of simple building-block opcodes
55 implementing one or two functions, with which more elaborate
56 processes can be constructed.
57 </para></listitem>
58 </orderedlist>
59 </para>
60
61 <para>
62 This is very much a preliminary and experimental release, and it is possible that the precise definition of the opcodes may change, in response to user feedback. Also, clearly, many new possibilities for opcodes are opened up; these factors may also have a retrospective influence on the opcodes presented here.
63 </para>
64
65 <para>
66 Note that some opcode parameters currently have restricted or
67 missing implementation. This is at least in part in order to keep
68 the opcodes simple at this stage, and also because they highlight
69 important design issues on which no decision has yet been made,
70 and on which opinions from users are sought.
71 </para>
72
73 <para>
74 One important point about the new signal type is that because the
75 analysis rate is typically much lower than kr, new analysis frames
76 are not available on each k-cycle. Internally, the opcodes track
77 ksmps, and also maintain a frame counter, so that frames are read
78 and written at the correct times; this process is generally
79 transparent to the user. However, it means that k-rate signals
80 only act on an fsig at the analysis rate, not at each k-cycle.
81 The opocde pvsftw returns a k-rate flag that is set when new fsig
82 data is valid.
83 </para>
84
85 <para>
86 Because of the nature of the overlap-add system, the use of these
87 opcodes incurs a small but significant delay, or latency,
88 determined by the window size (max(ifftsize,iwinsize)). This is
89 typically around 23msecs. In this first release, the delay is
90 slightly in excess of the theoretical minimum, and it is hoped
91 that it can be reduced, as the opcodes are further optimized for
92 real-time streaming.
93 </para>
94
95 <para>
96 The opcodes for real-time spectral processing are
97 <link linkend="pvsadsyn"><citetitle>pvsadsyn</citetitle></link>,
98 <link linkend="pvsanal"><citetitle>pvsanal</citetitle></link>,
99 <link linkend="pvscross"><citetitle>pvscross</citetitle></link>,
100 <link linkend="pvsfread"><citetitle>pvsfread</citetitle></link>,
101 <link linkend="pvsftr"><citetitle>pvsftr</citetitle></link>,
102 <link linkend="pvsftw"><citetitle>pvsftw</citetitle></link>,
103 <link linkend="pvsinfo"><citetitle>pvsinfo</citetitle></link>,
104 <link linkend="pvsmaska"><citetitle>pvsmaska</citetitle></link>, and
105 <link linkend="pvsynth"><citetitle>pvsynth</citetitle></link>.
106 </para>
107
108 <para>
109 In addition there are a number of opcodes available as plugins in
110 Csound5, and in the core for Csound6. These are
111 <link linkend="pvstanal"><citetitle>pvstanal</citetitle></link>,
112 <link linkend="pvsdiskin"><citetitle>pvsdiskin</citetitle></link>,
113 <link linkend="pvscent"><citetitle>pvscent</citetitle></link>,
114 <link linkend="pvsdemix"><citetitle>pvsdemix</citetitle></link>,
115 <link linkend="pvsfreeze"><citetitle>pvsfreeze</citetitle></link>,
116 <link linkend="pvsbuffer"><citetitle>pvsbuffer</citetitle></link>,
117 <link linkend="pvsbufread"><citetitle>pvsbufread</citetitle></link>,
118 <link linkend="pvsbufread2"><citetitle>pvsbufread2</citetitle></link>,
119 <link linkend="pvscale"><citetitle>pvscale</citetitle></link>,
120 <link linkend="pvshift"><citetitle>pvshift</citetitle></link>,
121 <link linkend="pvsifd"><citetitle>pvsifd</citetitle></link>,
122 <link linkend="pvsinit"><citetitle>pvsinit</citetitle></link>,
123 <link linkend="pvsin"><citetitle>pvsin</citetitle></link>,
124 <link linkend="pvsout"><citetitle>pvsout</citetitle></link>,
125 <link linkend="pvsosc"><citetitle>pvsosc</citetitle></link>,
126 <link linkend="pvsbin"><citetitle>pvsbin</citetitle></link>,
127 <link linkend="pvsdisp"><citetitle>pvsdisp</citetitle></link>,
128 <link linkend="pvsfwrite"><citetitle>pvsfwrite</citetitle></link>,
129 <link linkend="pvsmix"><citetitle>pvsmix</citetitle></link>,
130 <link linkend="pvsmooth"><citetitle>pvsmooth</citetitle></link>,
131 <link linkend="pvsfilter"><citetitle>pvsfilter</citetitle></link>,
132 <link linkend="pvsblur"><citetitle>pvsblur</citetitle></link>,
133 <link linkend="pvstencil"><citetitle>pvstencil</citetitle></link>,
134 <link linkend="pvsarp"><citetitle>pvsarp</citetitle></link>,
135 <link linkend="pvsvoc"><citetitle>pvsvoc</citetitle></link>,
136 <link linkend="pvsmorph"><citetitle>pvsmorph</citetitle></link>,
137 <link linkend="pvsbandp"><citetitle>pvsbandp</citetitle></link>,
138 <link linkend="pvsbandr"><citetitle>pvsbandr</citetitle></link>,
139 <link linkend="pvsbandwidth"><citetitle>pvsbandwidth</citetitle></link>,
140 <link linkend="pvswarp"><citetitle>pvswarp</citetitle></link>,
141 <link linkend="pvsgain"><citetitle>pvsgain</citetitle></link>,
142 <link linkend="pvs2tab"><citetitle>pvs2tab</citetitle></link>,
143 <link linkend="pvstrace"><citetitle>pvstrace</citetitle></link>,
144 <link linkend="pvsceps"><citetitle>pvsceps</citetitle></link>,
145 <link linkend="tab2pvs"><citetitle>tab2pvs</citetitle></link>
146
147 </para>
148 <para>
149 A number of opcodes are designed to generate and process streaming
150 partials tracks data. these are
151 <link linkend="binit"><citetitle>binit</citetitle></link>
152 <link linkend="partials"><citetitle>partials</citetitle></link>,
153 <link linkend="part2txt"><citetitle>part2txt</citetitle></link>,
154 <link linkend="trcross"><citetitle>trcross</citetitle></link>,
155 <link linkend="trfilter"><citetitle>trfilter</citetitle></link>,
156 <link linkend="trsplit"><citetitle>trsplit</citetitle></link>,
157 <link linkend="trmix"><citetitle>trmix</citetitle></link>,
158 <link linkend="trscale"><citetitle>trscale</citetitle></link>,
159 <link linkend="trshift"><citetitle>trshift</citetitle></link>,
160 <link linkend="trlowest"><citetitle>trlowest</citetitle></link>,
161 <link linkend="trhighest"><citetitle>trhighest</citetitle></link>
162 <link linkend="tradsyn"><citetitle>tradsyn</citetitle></link>,
163 <link linkend="sinsyn"><citetitle>sinsyn</citetitle></link>,
164 <link linkend="resyn"><citetitle>resyn</citetitle></link>,
165 <link linkend="tabifd"><citetitle>tabifd</citetitle></link>
166
167 </para>
168 <para>
169 See the <link linkend="ControlStacks"><citetitle>Stacks</citetitle> section </link> for information on the stack opcodes which can stack f-signals.
170 </para>
171
172 </section>