pvsfread — Read a selected channel from a PVOC-EX analysis file.
Create an fsig stream by reading a selected channel from a PVOC-EX analysis file loaded into memory, with frame interpolation. Only format 0 files (amplitude+frequency) are currently supported. The operation of this opcode mirrors that of pvoc, but outputs an fsig instead of a resynthesized signal.
ifn -- Name of the analysis file. This must have the .pvx file extension.
A multi-channel PVOC-EX file can be generated using the extended pvanal utility.
ichan -- (optional) The channel to read (counting from 0). Default is 0.
ktimpt -- Time pointer into analysis file, in seconds. See the description of the same parameter of pvoc for usage.
Note that analysis files can be very large, especially if multi-channel. Reading such files into memory will very likely incur breaks in the audio during real-time performance. As the file is read only once, and is then available to all other interested opcodes, it can be expedient to arrange for a dedicated instrument to preload all such analysis files at startup.
Here is an example of the pvsfread opcode. It uses the file pvsfread.csd.
Example 691. Example of the pvsfread opcode.
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 pvsfread.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> sr = 44100 ksmps = 32 0dbfs = 1 nchnls = 2 instr 1 ; create a PVOC-EX (*.pvx) file with PVANAL first idur filelen "kickroll.pvx" ;find duration of (stereo) analysis file kpos line 0,p3,idur ;to ensure we process whole file fsigr pvsfread kpos,"kickroll.pvx", 1 ;create fsig from right channel aout pvsynth fsigr ;resynthesise it outs aout, aout endin </CsInstruments> <CsScore> i 1 0 10 i 1 11 1 e </CsScore> </CsoundSynthesizer>