pvsbin
Read the amplitude and frequency of a PVS bin at control or audio rate.
Syntax
Performance
kamp, aamp -- bin amplitude at control or audio rate
kfr, afr -- bin frequency at control or audio rate
fsig -- an input pv stream
kbin -- bin number, counted from zero. Fractional values are truncated before selecting the amplitude/frequency pair. The value must be nonnegative and less than the number of bins (N/2 + 1 for an FFT size of N). Invalid values cause a performance error when the bin is selected.
For frame-based PVS streams, the opcode selects the bin only when a new frame arrives. A change to kbin between frame updates takes effect at the next frame. Both output forms hold the selected values between frames; audio output repeats those values over the active samples in each block.
For sliding PVS streams, audio output reads each active sample's spectrum. Control output reads the first active sample's spectrum. Audio samples outside the note's active range are zero.
Examples
Here is an example of the pvsbin opcode. It uses the file pvsbin.csd. This example uses realtime input, but you can also use it for soundfile input.
See also
Tools for Real-time Spectral Processing (pvs opcodes)
Credits
Author: Victor Lazzarini
August 2006