The Alternative Csound Reference Manual
Previous |  | Next

# pvbufread

pvbufread -- Reads from a phase vocoder analysis file and makes the retrieved data available.

## Description

pvbufread reads from a pvoc file and makes the retrieved data available to any following pvinterp and pvcross units that appear in an instrument before a subsequent pvbufread (just as lpread and lpreson work together). The data is passed internally and the unit has no output of its own.

## Syntax

pvbufread ktimpnt, ifile

## Initialization

ifile -- the pvoc number (n in pvoc.n) or the name in quotes of the analysis file made using pvanal. (See pvoc.)

## Performance

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.

## Examples

The example below shows an example using pvbufread with pvinterp to interpolate between the sound of an oboe and the sound of a clarinet. The value of kinterp 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 synchronized 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 kfreqscale2 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 kampscale2 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.

    ktime1  line      0, p3, 3.5 ; used as index in the "oboe.pvoc" file
    ktime2  line      0, p3, 4.5 ; used as index in the  "clar.pvoc" file
    kinterp linseg    1, p3*.15, 1, p3*.35, 0, p3*.25, 0, p3*.15, 1, p3*.1, 1
            pvbufread ktime1, "oboe.pvoc"
    apv     pvinterp  ktime2,1,"clar.pvoc",1,1.065,1,.75,1-kinterp,1-kinterp

Below is an example using pvbufread with pvcross. 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 pvcross does not use the frequency data from the file read by pvbufread.

    ktime1  line    0, p3, 3.5 ; used as index in the "oboe.pvoc" file
    ktime2  line    0, p3, 4.5 ; used as index in the "clar.pvoc" file
    kcross  expon     .001, p3, 1
            pvbufread ktime1, "oboe.pvoc"
    apv     pvcross   ktime2, 1, "clar.pvoc", 1-kcross, kcross

## See Also

pvcross, pvinterp, pvread, tableseg, tablexseg

## Credits

Author: Richard Karpen
Seattle, WA USA
1997

Previous | Home | Next
pvadd | Up | pvcross