TITLE:: PVSynth
summary:: Resynthesize Csound PV data
categories:: Libraries>JoshUGens, UGens>FFT
related:: Classes/PVFile, Classes/PVInfo

DESCRIPTION::
Resyntesize data with a bank of sine tones from a CSound PV analysis file.

note::
This currently only works with .pv files. .pvx and CSound 5 files will be implemented soon.::

warning::
The values stored inside the pv file for magnitudes are NOT scaled to a linear amplitude system. See PVFile (and the example below) for suggestions on how to scale these values so you don't destroy things.
::

CLASSMETHODS::

METHOD:: categories

METHOD:: ar

ARGUMENT:: pvbuffer
The buffer containing pv data (stored with PVFile).

ARGUMENT:: numBins
The number of bins to resynthesize. Default is 0.

ARGUMENT:: binStart
The bin number to start on. Default value is 0.

ARGUMENT:: binSkip
The number of bins to skip. Default value is 1.

ARGUMENT:: filePointer
A pointer into the soundfile. 0.0 is the beginning, 1.0 is the end. Default value is 0.

ARGUMENT:: freqMul
Freq value scaler. Default value is 1.0.

ARGUMENT:: freqAdd
Freq value offset. Default value is 0.0.

ARGUMENT:: mul

ARGUMENT:: add




INSTANCEMETHODS::


EXAMPLES::

code::
s.boot;

// load a file and save it to a buffer
a = PVFile.new(Platform.resourceDir +/+ "sounds/cl-c4.pv", s).loadToBuffer;

(
x = SynthDef(\helpPVSynth, {arg scale = 1;
	Out.ar(0, Pan2.ar(
		PVSynth.ar(a.buffer, a.nBins, 0, 1, MouseX.kr(0, 1),
			mul: a.magScale * scale),
		0.0));
}).play(s, [\scale, 0.2]);
)

x.free;
::
