From 8f614722e00ddfb0d903416e76b745642212a4d3 Mon Sep 17 00:00:00 2001 From: Julian Rohrhuber Date: Mon, 11 Jun 2012 12:00:17 +0200 Subject: [PATCH] PV_Diffuser helpfile improved (cherry picked from commit 77256eff011efd638ef74d1283f7f9c4c0d9880f) Signed-off-by: Dan Stowell --- HelpSource/Classes/PV_Diffuser.schelp | 39 +++++++++++++-------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/HelpSource/Classes/PV_Diffuser.schelp b/HelpSource/Classes/PV_Diffuser.schelp index 6edada78db4..d5760752c8f 100644 --- a/HelpSource/Classes/PV_Diffuser.schelp +++ b/HelpSource/Classes/PV_Diffuser.schelp @@ -5,8 +5,7 @@ categories:: UGens>FFT Description:: -Adds a different constant random phase shift to each bin. The trigger -will select a new set of random phases. +Adds a different constant random phase shift to each bin. When triggered, it selects a new set of random phases. classmethods:: @@ -27,33 +26,31 @@ Examples:: code:: -s.boot; -( -b = Buffer.alloc(s,2048,1); -c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav"); -) + ( -//trig with MouseY -SynthDef("help-diffuser", { arg out=0, bufnum=0 ; +// trig with MouseY crossing center of screen +{ var in, chain; - in = Mix.ar(SinOsc.ar(200 * (1..10), 0, Array.fill(10, {rrand(0.1, 0.2)}) )); - chain = FFT(bufnum, in); + in = Mix.ar(SinOsc.ar(200 * (1..10), 0, Array.fill(10, { rrand(0.1, 0.2) }) )); + chain = FFT(LocalBuf(2048), in); chain = PV_Diffuser(chain, MouseY.kr > 0.5 ); - Out.ar(out, 0.5 * IFFT(chain).dup); -}).play(s,[\out, 0, \bufnum, b.bufnum ]); -) + 0.5 * IFFT(chain).dup; +}.play +); ( -//trig with MouseY -SynthDef("help-diffuser2", { arg out=0, bufnum=0, soundBufnum=2; +b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav"); + +// trig with MouseY crossing center of screen +{ var in, chain; - in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1); - chain = FFT(bufnum, in); + in = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1); + chain = FFT(LocalBuf(2048), in); chain = PV_Diffuser(chain, MouseY.kr > 0.5 ); - Out.ar(out, 0.5 * IFFT(chain).dup); -}).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]); -) + 0.5 * IFFT(chain).dup; +}.play +); ::