«hypno-sliderz» by vividsnow

on 01 Mar'12 05:15 in guihypnosis

bizzare idea ) tested under sc3.5 qt gui

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(
var size = 5;
var side = 108;
var w = Window('hypno-sliderz', Rect(50,50,size*(side+5),size*(side+5))).front;
w.addFlowLayout();
~sliders = Array.fill(size.squared, { Slider2D( w.view,side@side ) });
~nodes = Array.fill(size.squared, { |i| Ndef('nd'++i, { |x,y,m,n,amp=1|
	Pan2.ar(
		PMOsc.ar(
			x.linexp(-1,1,20,15000),
			y.linexp(-1,1,25,250),
			LFSaw.kr(SinOsc.kr(1/size.squared).exprange(1/size,size)).range(0,size)
		),
		i.mod(size).linlin(0,4,-1,1),
		amp/(size.squared * 2)
	)
}).play });
~task = Routine( { var t = 0; var sz = 0; loop {
	t = t + 45;
	sz = sz + ((t/250).sin.abs * 5);
	~sliders.do({ |i,n| 
		i.background = 0.5.coin.if({ Color.rand }, { Color((t>>n).cos/2+0.5,(n&t).cos/2+0.5,(t|n).cos/2+0.5) }); 
		i.knobColor = Color([0,1].choose,[0,1].choose,[0,1].choose);
		i.setXY(
			(n * 10 + ((n.mod(2) * 2 - 1) * t / 180)).sin/2 * ((sz/145).cos/2+0.5) + 0.5,
			(n * 10 + ((n.mod(2) * 2 - 1) * t / 180)).cos/2 * ((sz/145).cos/2+0.5) + 0.5
		);
		i.resizeTo(side - 5 + (sin(n+t)*5), side - 5 + (cos(n+t)*5));
		i.moveTo(i.bounds.left + (cos(n+t)*2), i.bounds.top + (sin(n+t)*2));
		~nodes[n].set(*[x: sin(n+t), y: cos(n+t), amp: 0.7.rrand(1)]);
	});
	(1/25).wait;
}}).play(AppClock);
w.onClose = { 
	~task.stop;
	~nodes.do({|i| i.clear(size.sqrt) });
};
)
raw 1315 chars (focus & ctrl+a+c to copy)
comments