Saturday, November 01, 2008

CC3 Week 8 - FFT II

I extended my patch further from the previous FFT week. I have used the same panner but the X-Y coordinates control different parameters. The X coordinate controls the string sample and the Y coordinate controls the saw wave synth def. By moving the panner in different directions the freeze point of each sound changes. If the panner is on the bottom left corner, both sounds play as normal. If it is on the top right corner, both sounds freeze. If it is on the top left corner the string sounds continues to play and the saw wave freezes and if it is on the bottom right the string sound freezes and the saw wave continues to play.

I have an audio example of me messing around with the panner. Click here to have a listen. [1.7MB]




s.boot;
(
b = Buffer.alloc(s,1024);
c = Buffer.read(s,"sounds/100- strings.wav");

// string sample [3.6MB]

SynthDef("help-freeze", { arg out=0, bufnum=0, x=0;
var in, chain;
in = Saw.ar(LFNoise1.kr(5.2,250,400), 0.25);
chain = FFT(bufnum, in);
chain = PV_Freeze(chain, x > 0.5);
Out.ar(out, 0.5 * IFFT(chain).dup);
}).send(s);


SynthDef("help-magFreeze2", { arg out=0, bufnum=0, soundBufnum=2, y=0;
var in, chain;
in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
chain = FFT(bufnum, in);
chain = PV_Freeze(chain, y > 0.5 );
Out.ar(out, 0.5 * IFFT(chain).dup);
}).send(s);

)
(
t = Synth("help-freeze",[\out, 0, \bufnum, b.bufnum]);
u = Synth("help-magFreeze2",[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);

w = SCWindow("Orkester", Rect(100, 500, 400, 400))
.front;
w.view.background_(Color.white);
w.alpha = 0.8;

p = SC2DSlider(w, Rect(20, 20,350, 350))
.x_(0.5) // initial location of x
.y_(1) // initial location of y
.action_({p.background = (Color.new(p.x, p.y, 200, 1));
t.set(\x, p.x);
u.set(\y, p.y);
});
//w.front;

);

[1] Christian Haines. "Creative Computing: Semester 2 - Week 8 - FFT III". Lecture presented at the Electronic Music Unit, University of Adelaide, South Australia, 18th September 2008

No comments: