rsc3/doc-schelp/HelpSource/Classes/PV_Add.schelp

49 lines
899 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
class:: PV_Add
summary:: Complex addition.
related:: Classes/FFT, Classes/IFFT, Classes/PV_CopyPhase, Classes/PV_MagMul, Classes/PV_Max, Classes/PV_Min, Classes/PV_Mul
categories:: UGens>FFT
Description::
Complex addition:
code::
RealA + RealB, ImagA + ImagB
::
classmethods::
method::new
argument::bufferA
FFT buffer A.
argument::bufferB
FFT buffer B.
Examples::
code::
s.boot;
b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
(
SynthDef("help-add", { arg out=0, soundBufnum;
var inA, chainA, inB, chainB, chain ;
inA = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum) * 0.5, loop: 1);
chainA = FFT(LocalBuf(2048), inA);
chainB = FFT(LocalBuf(2048), inB);
chain = PV_Add(chainA, chainB);
Out.ar(out, 0.1 * IFFT(chain).dup);
}).play(s, [\soundBufnum, b.bufnum]);
)
b.free
::