klipp av logo

some supercollider code to generate old school klipp av logos.

click the window in the sc code to generate new pictures.

//redFrik
(
	var width= 800, height= 600;
	var win, usr, p0, p1, l= 50, w= 10, h= 15, c= 0.9, o= 0.1;
	win= Window("nystan", Rect(128, 64, width, height), false);
	usr= UserView(win, Rect(0, 0, width, height));
	usr.mouseDownAction= {usr.refresh};
	usr.background= Color.new255(51, 47, 57);
	win.front;
	usr.drawFunc= {
		Pen.translate(width*0.5, height*0.5);
		5.rrand(20).do{
			var p, pp1, len;
			Pen.rotate(pi.linrand);
			p0= Point(0, 0);
			p1= Point(0, h.rand*10.linrand);
			pp1= p1;
			(20.linrand).do{|i|
				len= l+l.rand2;
				Pen.color= Color(c, c, c.rrand(1.0), (1-c).rrand(1.0));
				Pen.moveTo(p0);
				Pen.lineTo(p1);
				if(o.coin, {
					p= 200.rand;
					p0= p0+p;
					p1= p1+p;
				}, {
					p0= p0+Point(len+w.rand2, h.rand);
					p1= p1+Point(len+w.rand2, h.rand);
				});
				Pen.lineTo(p1);
				Pen.lineTo(p0);
				Pen.draw(0);
			};
			Pen.moveTo(p0);
			Pen.lineTo(p1);
			Pen.lineTo(pp1);
			Pen.lineTo(Point(0, 0));
			Pen.draw(5.rand);
		};
	};
	CmdPeriod.doOnce({if(win.isClosed.not, {win.close})});
)