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

static statistics


//____static statistics
//Julian Rohrhuber 2001
(
var x, v, o, m, dx, dy, add, sound, pen;
dx = 1024;
dy = 768;

sound = #{ { EnvGen.kr(Env.linen(3.0.rand, 3.0.rand))*Mix.ar(SinOsc.ar(rrand(1, 19)*200, 0, 0.01)) }.play };
pen = Pen(action: \fill, foreColor: Color.new(200, 180, 40), textFont: \Courier, textSize: 18);
x = GUIScreen.new("bbb", Rect.newBy(0,0,dx,dy));
x.view = View.new(Pen(action: \fill, backColor: Color.black), 

	[ 
		Rect.newBy(0,0,dx,dy),
		v =  View.new,
		View.new(pen, [ Rect.newBy(0, dy/2, dx, 1) ]),
		s = TextBox(pen, Rect.newBy(0, dy/2, 80, 11), "234.,4")
		
	 ]);

add = { var cm; cm=rrand(0.3, 1.0).trunc(1/8); v.items = v.items.add( View.new(Pen(action: \fill, foreColor: Color.new(200*cm, 180*cm, 40*cm)),  [Rect.newBy(rrand(1, dx), rrand(1, 0.9)*dy, 10, dy) ]))};
10.do({ add.value });

//v.items.do({ arg item; item.postln });
x.fullScreen(dx, dy);
x.sched(0, inf, { 
	v.items.do({ arg item; var rect; rect = item.items.at(0); rect = rect.set(rect.left, rect.top - 3.0.rand, rect.right, rect.bottom) });
	if(0.07.coin, { v.items = v.items.scramble;   });
	if(0.1.coin, { add.value; sound.send; });
	s.string = 1234.0.rand.asString;
	x.refresh; 
	0.01
});
)




Links to this Page