tab2pvs
Copies amplitude and frequency data from k-rate arrays into an f-signal. Also known as pvsfromarray.
Syntax
Initialization
karr[] -- One-dimensional array of alternating amplitude and frequency values, starting with DC and ending with Nyquist. Its length must be even and at least 4. An array of length L gives FFT size N = L - 2.
kmags[], kfreqs[] -- Separate one-dimensional arrays of amplitudes and frequencies, with one value per bin. Both must have the same length L, with at least two bins. The FFT size is N = 2 * (L - 1).
ihopsize -- Hop size in samples. Zero selects the default, the integer part of N/4. The hop must be at least ksmps, but need not be a multiple of it. If the default is too small, supply an explicit hop. Fractional sample counts are truncated.
iwinsize -- Analysis window size stored in the f-signal. Zero selects the default, N. The size must be positive; fractional sample counts are truncated.
iwintype -- Analysis window type stored in the f-signal, default 1 (von Hann). This opcode copies data; it does not apply an analysis window.
Performance
fsig -- Output in amplitude+frequency format (0), using ordinary frames, not sliding frames.
The first performance cycle copies the current array data. Each later frame is copied on the first control cycle at or after its hop boundary. Between updates, the output keeps the previous frame. Changes to array values take effect at the next copy.
Keep the array dimensions and lengths unchanged during performance. To change the FFT size, reinitialize the arrays, this opcode and any opcodes that use its output.
Examples
kFrame[] init 1026
; Put a partial at bin 10; leave the other amplitudes at zero.
kFrame[20] = .5
kFrame[21] = 440
fSpectrum tab2pvs kFrame, 256
aOut pvsynth fSpectrum
See also
Tools for Real-time Spectral Processing (pvs opcodes)
Credits
Author: Victor Lazzarini
October 2011
New plugin in version 5
October 2011.