title:: PV_OddBin
summary:: Return the odd numbered bins in an FFT buffer
categories:: Libraries>JoshUGens, UGens>FFT
related:: Classes/PV_EvenBin

DESCRIPTION::
code::
PV_OddBin(buffer)
::


CLASSMETHODS::


INSTANCEMETHODS::


EXAMPLES::

code::
// resynthesize only odd or even bins
s.boot;

// a sample sig
{SinOsc.ar(440 + SinOsc.kr(0.05).range(0, 440), 0, 0.5)}.play;

(
SynthDef(\evenbin, {arg fftbuf1, fftbuf2;
    var in, chain1, chain2, out1, out2;
    in = SinOsc.ar(440 + SinOsc.kr(0.05).range(0, 440), 0, 0.5);
    chain1 = FFT(fftbuf1, in);
    chain1 = PV_EvenBin(chain1);
    out1 = IFFT(chain1);
    chain2 = FFT(fftbuf2, in);
    chain2 = PV_OddBin(chain2);
    out2 = IFFT(chain2);
    //   Out.ar(0, out1 + out2); // add back together
    Out.ar(0, [out1, out2]); // or split apart
}).add;
)

// the fft buf
s.sendMsg(\b_alloc, 0, 2048);
s.sendMsg(\b_alloc, 1, 2048);

// start the synth
s.sendMsg(\s_new, \evenbin, z = s.nextNodeID, 0, 1, \fftbuf1, 0, \fftbuf2, 1);
// free it
s.sendMsg(\n_free, z);
s.sendMsg(\b_free, 0);
s.sendMsg(\b_free, 1);

s.quit
::