Added help for Pen and updated some other docs
[supercollider.git] / HelpSource / Classes / PV_Conj.schelp
blob8acc63690d01590284e38453595c0428bb72b980
1 class:: PV_Conj
2 summary:: Complex conjugate
3 categories:: UGens>FFT
5 description::
6 Converts the FFT frames to their complex conjugate (i.e. reverses the sign of their imaginary part). This is not usually a useful audio effect in itself, but may be a component of other analysis or transformation processes...
8 classmethods::
9 method:: new
10 argument:: chain
11 fft chain.
13 examples::
14 code::
15 s.boot;
18 b = Buffer.alloc(s,2048,1);
19 c = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
20 d = Buffer.alloc(s,2048,1);
24 SynthDef(\help_pvconj, {  arg out=0, bufnum=0, soundBufnum=2;
25         var in, chain;
26         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
27         chain = FFT(bufnum, in);
28         chain = PV_Conj(chain);
29         // Original is left, conj is right
30         Out.ar(out, 0.3 * [in, IFFT(chain)]);
31 }).play(s,[\out, 0, \bufnum, b, \soundBufnum, c]);
35 SynthDef(\help_pvconj2, {  arg out=0, bufnum=0, soundBufnum=2;
36         var in, chainA, chainB;
37         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
38         chainA = FFT(bufnum, in);
39         chainB = PV_Copy(chainA, d);
40         chainB = PV_Conj(chainB);
41         // Now we have the original and conjugate, what happens if we add them?
42         Out.ar(out, 0.3 * (IFFT(PV_Add(chainA, chainB)).dup));
43 }).play(s,[\out, 0, \bufnum, b, \soundBufnum, c]);