«alarms» by redFrik

on 01 Oct'11 02:11 in

i wrote this for a sleeping bag concert in stockholm nov 2010. never set it off in the end as planned.

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
39
40
//--set alarms
(
~num= 25;		//number of alarms
~fadeTime= 10;		//fade in time in seconds
~num.do{|i|
	Ndef(("alarm"++i).asSymbol, {|amp= 0, lag= 5|
		var src= Pulse.ar(
			ExpRand(300, 3000)+LFPulse.kr(ExpRand(3, 30), 0, Rand(0.4, 0.6), Rand(-100, 100)),
			Rand(0.4, 0.6),
			LFPulse.kr(LinRand(0.05, 2), 0, LinRand(0.1, 0.5), 0.5)
		);
		Pan2.ar(src, Rand(-0.95, 0.95), amp.lag(lag));
	});
};
Ndef.all;		//list them
)


//--start alarms (takes a while)
(
~task.stop;
~task= Task({
	~num.do{|i|
		Ndef(("alarm"++i).asSymbol).play(fadeTime: ~fadeTime).set(\amp, 7/~num).postln;
		i.linlin(0, ~num-1, ~fadeTime*2, ~fadeTime/2).wait;
	};
}).play;
)


//--stop alarms
(
~task.stop;
~task= Task({
	~num.do{|i|
		Ndef(("alarm"++i).asSymbol).stop(fadeTime: 1/~fadeTime);
		i.linlin(0, ~num-1, 1/~fadeTime, 10/~fadeTime).wait;
	};
}).play;
)
raw 873 chars (focus & ctrl+a+c to copy)
reception
comments
Roberto Lombardo user 02 Oct'11 21:56

niccccccce!