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 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
<TITLE>PVREAD</TITLE>
</HEAD>
<BODY>
<CENTER><A NAME="pvread"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SIG_GENS.html#">Top of this section</A></B> - <A HREF="adsyn.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="fof.html">Next</A>
<HR></CENTER>
<H2>
pvread, pvbufread, pvinterp, pvcross, tableseg, tablexseg, vpvoc</H2>
<PRE>kfreq,kamp <B>pvread</B> ktimpnt, ifile, ibin
<B>pvbufread</B> ktimpnt, ifile
ar <B>pvinterp</B> ktimpnt, kfmod, ifile, kfreqscale1,\
kfreqscale2, kampscale1, kampscale2, \
kfreqinterp, kampinterp
ar <B>pvcross</B> ktimpnt, kfmod, ifile, kamp1, kamp2,\
[ispecwp]
<B>tableseg</B> ifn1, idur1, ifn2[, idur2, ifn3[...]]
<B>tablexseg</B> ifn1, idur1, ifn2[, idur2, ifn3[...]]
ar <B>vpvoc</B> ktimpnt, kfmod, ifile, [ispecwp]</PRE>
<HR>
<H4>
<U>DESCRIPTION</U></H4>
<B>pvread</B> reads from a <B>pvoc</B> file and returns the frequency and
amplitude from a single anaylsis channel or bin. The returned values can
be used anywhere else in the csound instrument. For example, one can use
them as arguments to an oscillator to synthesize a single component from
an analyzed signal or a bank of pvreads can be used to resynthesize the
analyzed sound using additive synthesis by passing the frequency and magnitude
values to a bank of oscillators.
<P><B>pvbufread</B> reads from a pvoc file and makes the retrieved data
available to any following <B>pvinterp</B> and <B>pvcross</B> units that
appear in an instrument before a subsequent <B>pvbufread</B> (just as lpread
and lpreson work together). The data is passed internally and the unit
has no output of its own. <B>pvinterp</B> and<B> pvcross</B> allow the
interprocessing of two phase vocoder analysis files prior to the resynthesis
which these units do also. Both of these units receive data from one of
the files from a previously called <B>pvbufread</B> unit. The other file
is read by the <B>pvinterp</B> and/or <B>pvcross</B> units. Since each
of these units has its own time-pointer the analysis files can be read
at different speeds and directions from one another. pvinterp does not
allow for the use of the ispecwp process as with the<B> </B><A HREF="adsyn.html">pvoc</A>
and <B>vpvoc</B> units.
<P><B>pvinterp</B> interpolates between the amplitudes and frequencies,
on a bin by bin basis, of two phase vocoder <A HREF="../Utility/pvanal.html">analysis
files</A> (one from a previously called <B>pvbufread</B> unit and the other
from within its own argument list), allowing for user defined transitions
between analyzed sounds. It also allows for general scaling of the amplitudes
and frequencies of each file separately before the interpolated values
are calculated and sent to the resynthesis routines. The <I>kfmod</I> argument
in <B>pvinterp</B> performs its frequency scaling on the frequency values
after their derivation from the separate scaling and subsequent interpolation
is performed so that this acts as an overall scaling value of the new frequency
components.
<P><B>pvcross</B> applies the amplitudes from one phase vocoder <A HREF="../Utility/pvanal.html">analysis
file </A>to the data from a second file and then performs the resynthesis.
The data is passed, as described above, from a previously called <B>pvbufread</B>
unit. The two k-rate amplitude arguments are used to scale the amplitudes
of each files separately before they are added together and used in the
resynthesis (see below for further explanation). The frequencies of the
first file are not used at all in this process. This unit simply allows
for cross-synthesis through the application of the amplitudes of the spectra
of one signal to the frequencies of a second signal. Unlike <B>pvinterp</B>,
pvcross does allow for the use of the <I>ispecwp</I> as in<B> pvoc</B>
and <B>vpvoc</B>.
<P><B>tableseg</B> and <B>tablexseg</B> are like <A HREF="line.html">linseg</A>
and <A HREF="line.html">expseg</A> but interpolate between values in a
stored function tables. The result is a new function table passed internally
to any following <B>vpvoc</B> or <B>voscili</B> which occurs before a subsequent
<B>tableseg</B> or <B>tablexseg</B> (much like <A HREF="../Modifier/lpread.html">lpread/lpreson</A>
pairs work). The uses of these are described below under <B>vpvoc</B> and
(see also <B>voscili</B> which allows the use of these units in an interpolating
oscillator).
<P><B>vpvoc</B> is identical to <A HREF="pvoc.html">pvoc</A> except that
it takes the result of a previous <B>tableseg</B> or <B>tablexseg</B> and
uses the resulting function table (passed internally to the <B>vpvoc</B>),
as an envelope over the magnitudes of the analysis data channels. The result
is spectral enveloping. The function size used in the t<B>ableseg</B> should
be <I>framesize/2,</I> where framesize is the number of bins in the phase
vocoder analysis file that is being used by the <B>vpvoc</B>. Each location
in the table will be used to scale a single analysis bin. By using different
functions for <I>ifn1</I>, <I>ifn2</I>, etc.. in the<B> tableseg</B>, the
spectral envelope becomes a dynamically changing one.
<H4>
<U>PERFORMANCE</U></H4>
<I>ifile</I> is the pvoc number (n in pvoc.n) or the name in quotes of
the analysis file made using <A HREF="../Utility/pvanal.html">pvanal</A>.
See <A HREF="adsyn.html">pvoc</A> documentation in Csound manual.
<P><I>kfreq</I> and <I>kamp</I> are the outputs of the <B>pvread</B> unit.
These values, retrieved from a phase vocoder analysis file, represent the
values of frequency and amplitude from a single analysis channel specified
in the<I> ibin</I> argument. Interpolation between analysis frames is performed
at k-rate resolution and dependent of course upon the rate and direction
of <I>ktimpnt</I>.
<P><I>ktimpnt</I>, <I>kfmod</I>, and <I>ispecwp</I> used in<B> pvread</B>
and <B>vpvoc</B> are exactly the same as for pvoc (see above description
of<B> pvinterp</B> for its special use of <I>kfmod</I>).
<P><I>ibin</I> is the number of the analysis channel from which to return
frequency in cps and magnitude.
<P><I>kfreqscale1</I>, <I>kfreqscale2</I>, <I>kampscale1</I>, <I>kampscale2</I>
are used in<B> pvinterp</B> to scale the frequencies and amplitudes stored
in each frame of the phase vocoder analysis file.<I> kfreqscale1</I> and
<I>kampscale1</I> scale the frequencies and amplitudes of the data from
the file read by the previously called <B>pvbufread</B> (this data is passed
internally to the pvinterp unit). <I>kfreqscale2</I> and <I>kampscale2</I>
scale the frequencies and amplitudes of the file named by ifile in the
<B>pvinterp</B> argument list and read within the<B> pvinterp </B>unit.
By using these arguments it is possible to adjust these values before applying
the interpolation. For example, if file1 is much louder than file2, it
might be desirable to scale down the amplitudes of file1 or scale up those
of file2 before interpolating. Likewise one can adjust the frequencies
of each to bring them more in accord with one another (or just the opposite
of course!) before the interpolation is performed.
<P><I>kfreqinterp</I> and <I>kampinterp</I>, used in <B>pvinterp</B>, determine
the interpolation distance between the values of one phase vocoder file
and the values of a second file. When the value of <I>kfreqinterp</I> is
0, the frequency values will be entirely those from the first file (read
by the <B>pvbufread</B>), post scaling by the <I>kfreqscale1</I> argument.
When the value of <I>kfreqinterp</I> is 1 the frequency values will be
those of the second file (read by the <B>pvinterp</B> unit itself), post
scaling by kfreqscale2. When <I>kfreqinterp</I> is between 0 and 1 the
frequency values will be calculated, on a bin, by bin basis, as the percentage
between each pair of frequencies (in other words, <I>kfreqinterp</I>=.5
will cause the frequencies values to be half way between the values in
the set of data from the first file and the set of data from the second
file).<I> kampinterp1</I> and <I>kampinterp2</I> work in the same way upon
the amplitudes of the two files. Since these are k-rate arguments, the
percentages can change over time making it possible to create many kinds
of transitions between sounds.
<P><I>ifn1</I>, <I>ifn2</I>, <I>ifn3</I>, etc... in <B>tableseg</B> and
<B>tablexseg</B> are stored functions, created from an f-card in the numeric
notelist.<I> ifn1</I>,<I> ifn2</I>, and so on, MUST be the same size.
<P><I>idur1</I>, <I>idur2</I>, etc...in <B>tableseg</B> and t<B>ablexseg</B>
are the durations during which interpolation from one table to the next
will take place.
<H4>
<U>EXAMPLE:</U></H4>
The example below shows the use pvread to synthesize a single component
from a phase vocoder analysis file. It should be noted that the kfreq and
kamp outputs can be used for any kind of synthesis, filtering, processing,
and so on.
<PRE>ktime <B>line</B> 0, p3, 3
kfreq, kamp <B>pvread</B> ktime, "pvoc.file", 7 ; read
;data from 7th analysis bin.
asig <B>oscili</B> kamp, kfreq, 1 ; function 1
;is a stored sine</PRE>
The example below shows an example using <B>pvbufread</B> with <B>pvinterp</B>
to interpolate between the sound of an oboe and the sound of a clarinet.
The value of <I>kinterp</I> returned by a linseg is used to determine the
timing of the transitions between the two sounds. The interpolation of
frequencies and amplitudes are controlled by the same factor in this example,
but for other effects it might be interesting to not have them sychnronized
in this way. In this example the sound will begin as a clarinet, transform
into the oboe and then return again to the clarinet sound. The value of
<I>kfreqscale2</I> is 1.065 because the oboe in this case is a semitone
higher in pitch than the clarinet and this brings them approximately to
the same pitch. The value of <I>kampscale2</I> is .75 because the analyzed
clarinet was somewhat louder than the analyzed oboe. The setting of these
two parameters make the transition quite smooth in this case, but such
adjustments are by no means necessary or even advocated.
<PRE>ktime1 <B>line</B> 0, p3, 3.5 ; used as index in the "oboe.pvoc" file
ktime2 <B>line</B> 0, p3, 4.5 ; used as index in the "clar.pvoc" file
kinterp <B>linseg</B> 1, p3*.15, 1, p3*.35, 0, p3*.25, 0, p3*.15, 1, p3*.1, 1
<B>pvbufread</B> ktime1, "oboe.pvoc"
apv <B>pvinterp</B> ktime2,1,"clar.pvoc",1,1.065,1,.75,1-kinterp,1-kinterp</PRE>
Below is an example using<B> pvbufread</B> with <B>pvcross</B>. In this
example the amplitudes used in the resynthesis gradually change from those
of the oboe to those of the clarinet. The frequencies, of course, remain
those of the clarinet throughout the process since<B> pvcross</B> does
not use the frequency data from the file read by <B>pvbufread</B>.
<PRE>ktime1 <B>line</B> 0, p3, 3.5 ; used as index in the "oboe.pvoc" file
ktime2 <B>line</B> 0, p3, 4.5 ; used as index in the "clar.pvoc" file
kcross <B>expon</B> .001, p3, 1
<B>pvbufread</B> ktime1, "oboe.pvoc"
apv <B>pvcross</B> ktime2, 1, "clar.pvoc", 1-kcross, kcross</PRE>
In following example using <B>vpvoc</B> shows the use of functions such
as
<PRE> <B>f</B> 1 0 256 5 .001 128 1 128 .001
<B>f</B> 2 0 256 5 1 128 .001 128 1
<B>f</B> 3 0 256 7 1 256 1</PRE>
to scale the amplitudes of the separate analysis bins.
<PRE>ktime <B>line</B> 0, p3,3 ; time pointer, in seconds, into file
<B>tablexseg</B> 1, p3*.5, 2, p3*.5, 3
apv <B>vpvoc</B> ktime,1, "pvoc.file"</PRE>
The result would be a time-varying "spectral envelope" applied to the phase
vocoder analysis data. Since this amplifies or attenuates the amount of
signal at the frequencies that are paired with the amplitudes which are
scaled by these functions, it has the effect of applying very accurate
filters to the signal. In this example the first table would have the effect
of a band- pass filter , gradually be band-rejected over half the note's
duration, and then go towards no modification of the magnitudes over the
second half.
<P><B><U>AUTHOR:</U></B>
<P>Richard Karpen
<BR>Seattle, Wash
<BR>1997
<BR>
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SIG_GENS.html#">Top of this section</A></B> - <A HREF="adsyn.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="fof.html">Next</A>
<HR></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|