pvread
Reads from a pvoc file and returns the frequency and amplitude from a single analysis 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.
Syntax
Initialization
ifile -- the pvoc number (n in pvoc.n) or the name in quotes of the analysis file made using pvanal. (See pvoc.)
ibin -- the number of the analysis channel from which to return frequency in Hz and magnitude.
ifiletime (optional, default=0) -- zero keeps the original time mapping, which uses Csound's output sample rate to convert ktimpnt to a file frame. Set to 1 to use the analysis file's sample rate instead, so ktimpnt refers to seconds in the source recording. The modes differ only when those sample rates differ.
Performance
kfreq, kamp -- outputs of the pvread 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 ibin argument. Interpolation between analysis frames is performed at k-rate resolution and dependent of course upon the rate and direction of ktimpnt.
ktimpnt -- the passage of time, in seconds, through this file. ktimpnt must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.
For a 22,050 Hz analysis file played by Csound at 44,100 Hz, the default mode reads the frame at file time 2 seconds when ktimpnt is 1. With kfreq, kamp pvread 1, "source.pvx", 2, 1, it reads file time 1 second.
Examples
The example below shows the use pvread to synthesize a single component at a time 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.
See Also
Short-time Fourier Transform (STFT) Resynthesis
Credits
Author: Richard Karpen
Seattle, Wash
1997
New in version 3.44