pvsbufread2
This opcode reads a circular buffer of f-signals (streaming PV signals), with binwise additional delays.
This opcode reads from a circular buffer of length ilen (secs), taking a handle for the buffer and a time pointer, which holds the current read position (also in seconds). It is used in conjunction with a pvsbuffer opocde. Reading is circular, wrapping around at the end of the buffer. Extra delay times are taken from a function table, with each point on it defining a delay time in seconds affecting the corresponding bin.
Syntax
Initialization
ift1 -- function table with at least fftisze/2+1 points where delays (in secs) for bin amplitudes are set (function table positions are equivalent to bin numbers)
ift2 -- function table with at least fftisze/2+1 points where delays (in secs) for bin frequencies are set (function table positions are equivalent to bin numbers)
Performance
fsig -- output pv stream
ktime -- time position of reading pointer (in secs).
khandle -- handle identifying the buffer to be read. When using k-rate handles, it is important to initialise the k-rate variable to a given existing handle. When changing buffers, fsig buffers need to be compatible (same fsig format).
With this opcode and pvsbuffer, it is possible to, among other things:
- time-stretch/compress a fsig stream, by reading it at different rates
- delay a fsig or portions of it.
- 'brassage' of two or more fsigs by switching buffers, since the reading handles are k-rate. Note that, when using k-rate handles, it is important to initialise the k-rate variable to a given handle (so that the fsig initialisation can take place) and it is only possible to switch handles between compatible fsig buffers (with the same fftsize and overlap).
Note
It is important that the handle value passed to pvsbufread2 is valid and was created by pvsbuffer. Csound will crash with invalid handles.
Examples
Here is an example of the pvsbufread2 opcode. It uses the file pvsbufread2.csd.
See also
Tools for Real-time Spectral Processing (pvs opcodes)
Credits
Author: Victor Lazzarini
July 2011