oneShot: free the responder before running user func (avoid error)
[supercollider.git] / HelpSource / Classes / PV_Mul.schelp
blob984634caf5c44a32f1d1a1f5f9c2e36c0cb0b4ac
1 class:: PV_Mul
2 summary:: Complex multiply.
3 related:: Classes/FFT, Classes/IFFT, Classes/PV_Add, Classes/PV_CopyPhase, Classes/PV_MagMul, Classes/PV_Max, Classes/PV_Min
4 categories:: UGens>FFT
6 Description::
8 Complex Multiplication:
10 formula::
12 (RealA * RealB) - (ImagA * ImagB),
13 (ImagA * RealB) + (RealA * ImagB)
18 classmethods::
20 method::new
22 argument::bufferA
23 FFT buffer A.
25 argument::bufferB
26 FFT buffer B.
28 Examples::
30 code::
32 s = Server.internal.boot;
34 b = Buffer.alloc(s,2048,1);
35 c = Buffer.alloc(s,2048,1);
39 SynthDef("help-mul", { arg out=0, bufnumA=0, bufnumB=1;
40         var inA, chainA, inB, chainB, chain ;
41         inA = SinOsc.ar(500, 0, 0.5);
42         inB =  SinOsc.ar(Line.kr(100, 400, 5), 0, 0.5);
43         chainA = FFT(bufnumA, inA);
44         chainB = FFT(bufnumB, inB);
45         chain = PV_Mul(chainA, chainB); 
46         Out.ar(out,  0.5 * IFFT(chain).dup);
47 }).play(s,[\out, 0, \bufnumA, b.bufnum, \bufnumB, c.bufnum]);
48 s.scope;
52 SynthDef("help-mul2", { arg out=0, bufnumA=0, bufnumB=1;
53         var inA, chainA, inB, chainB, chain ;
54         inA = SinOsc.ar(500, 0, 0.5) * Line.kr;
55         inB = LFNoise1.ar(20);
56         chainA = FFT(bufnumA, inA);
57         chainB = FFT(bufnumB, inB);
58         chain = PV_Mul(chainA, chainB); 
59         Out.ar(out,  0.5 * IFFT(chain).dup);
60 }).play(s,[\out, 0, \bufnumA, b.bufnum, \bufnumB, c.bufnum]);
61 s.scope;