View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

SuperCollider images

Home   How To   Code Pool   Public Library   Theory   Events

Uploaded Image: 2d_plot_3.gif
// funcadelics.
// (uses addField method from PenExtensions)
(
var a, w, i=0, run=true, cfunc, lfunc;
a = Array.fill2D(10, 20, { arg i, j; (i & j + i) % j  / 10 });

w = SCWindow("si", Rect(128, 164, 460, 460));
w.view.background = Color.black;
cfunc = { |val| Color(
			0.2*i.fold(0, 0.4), 
			val*i.fold(0, val.wrap(0, 0.4)), 
			val*i.fold(0, 1.1), 
			0.5
			) 
};
lfunc = {|val|  1/ val ** i.fold(0, 1.1) * i.fold(val,2) * 0.5 };
w.drawHook = { 
			i = i + 0.01;
			Pen.rotate(i, 240, 240);
			Pen.translate(100,100);
			Pen.addField(a, Rect(0, 0, 200, 200), \fillOval, cfunc, lfunc) 
};
w.front;
w.onClose = { run = false };
{ while { run } { w.refresh; 0.05.wait; } }.fork(AppClock)
)




Link to this Page