vpvoc
Prev | Orchestra Opcodes and Operators | Next

## vpvoc

vpvoc — Implements signal reconstruction using an fft-based phase vocoder and an extra envelope.

## Description

Implements signal reconstruction using an fft-based phase vocoder and an extra envelope.

## Syntax

    ares vpvoc ktimpnt, kfmod, ifile [, ispecwp] [, ifn]

## Initialization

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

ispecwp (optional, default=0) -- if non-zero, attempts to preserve the spectral envelope while its frequency content is varied by kfmod. The default value is zero.

ifn (optional, default=0) -- optional function table containing control information for vpvoc. If ifn = 0, control is derived internally from a previous tableseg or tablexseg unit. Default is 0. (New in Csound version 3.59)

## Performance

ktimpnt -- The passage of time, in seconds, through the analysis 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.

kfmod -- a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and .5 down an octave.

This implementation of pvoc was orignally written by Dan Ellis. It is based in part on the system of Mark Dolson, but the pre-analysis concept is new. The spectral extraction and amplitude gating (new in Csound version 3.56) were added by Richard Karpen based on functions in SoundHack by Tom Erbe.

vpvoc is identical to pvoc except that it takes the result of a previous tableseg or tablexseg and uses the resulting function table (passed internally to the vpvoc), as an envelope over the magnitudes of the analysis data channels. Optionally, a table specified by ifn may be used.

The result is spectral enveloping. The function size used in the tableseg should be framesize/2, where framesize is the number of bins in the phase vocoder analysis file that is being used by the vpvoc. Each location in the table will be used to scale a single analysis bin. By using different functions for ifn1, ifn2, etc.. in the tableseg, the spectral envelope becomes a dynamically changing one. See also tableseg and tablexseg.

## Examples

The following example, using vpvoc, shows the use of functions such as

    f 1 0 256 5 .001 128 1 128 .001
    f 2 0 256 5 1 128 .001 128 1
    f 3 0 256 7 1 256 1

to scale the amplitudes of the separate analysis bins.

    ktime   line         0, p3, 3 ; time pointer, in seconds, into file
            tablexseg    1, p3*0.5, 2, p3*0.5, 3
    apv     vpvoc        ktime, 1, "pvoc.file"

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.

Here is a complete example of the vpvoc opcode. It uses the file vpvoc.csd.

Example 1100.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

    <CsoundSynthesizer>
    <CsOptions>
    ; Select audio/midi flags here according to platform
    -odac     ;;;realtime audio out
    ;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
    ; For Non-realtime ouput leave only the line below:
    ; -o vpvoc.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    sr = 44100
    ksmps = 32
    nchnls = 2
    0dbfs  = 1

    instr 1
    ; analyze "fox.wav" with PVANAL first
    iend  = p4
    ktime line 0, p3, iend
          tablexseg p5, p3, p6		;morph from table 1
    asig  vpvoc ktime, 1, "fox.pvx"		;to table 2
          outs asig*3, asig*3

    endin
    </CsInstruments>
    <CsScore>
    f 1 0 512 9 .5 1 0
    f 2 0 512 5 1 60 0.01 390 0.01 62 1

    i 1 0 5 2.7 1 2
    e
    </CsScore>
    </CsoundSynthesizer>

## See Also

pvoc

## Credits

Authors: Dan Ellis and Richard Karpen
Seattle, WA USA
1997

New in version 3.44

Prev | Up | Next
vpowv_i | Home | vrandh