alarm

clean-up #19:

there was a sleeping-bag concert as part of the sound of stockholm festival this year. music for sleeping - what a great concept!
first i was assigned to play last and would thereby have had the honour/responsibility of waking everybody up for breakfast at 7:00 in the morning. both fun and daunting. how to let your audience sleep in as long as possible and then wake them up gently but firmly?
i assumed most people would be asleep when it was my turn and that i myself also would be very tired. so i prepared my solo set (using redThermoKontroll) to be extremely simple and static in nature. hardly no variation - only a couple of sounds sources (4 sc patches i think it was) with looong transitions between settings that i could control manually.
then there was the waking up part and for that i wrote the very simple sounding code below. it starts slowly with one little alarm going off. then a second alarm, then more and more until complete chaos. i made it so that this patch could be mixed in with my drones and with separate control over volume.
unfortunately when i got to stockholm they had changed the playing order and i did do my performance around midnight instead. and i never set the alarms off.

//--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
(
~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;
)