///////////////////////////////////////////////////
// History, as it was on Thu Aug 24 00:23:48 2006.
///////////////////////////////////////////////////

// - 0:1:19.76 -  
SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1; 
var sound, env;

//env=EnvGen.ar(Env([1,0],[sustain],'lin'),doneAction:2);

sound=Mix(SinOsc.ar([1,1.05,1.3,1.56,1.79,1.81,2.1,3.1,4.5]*freq,0,amp));

Out.ar(out, Pan2.ar(sound,pan))
}).store;

// - 0:2:24.64 -  
a= Array.fill(4,{arg i; Synth(\lcsynth1,[\freq, (i+1)*110])});

// - 0:2:58.21 -  
a.do({arg val; val.free})	

// - 0:2:59.59 -  
a= Array.fill(4,{arg i; Synth(\lcsynth1,[\freq, (i+1)*110,\amp,0.05])});

// - 0:3:34.05 -  
Tdef(\lctask1,{

inf.do {

a.choose.set(\freq,{rrand(110,440)});
1.0.wait;
};

}).play;

// - 0:3:55.04 -  
Tdef(\lctask1,{

inf.do {

a.choose.set(\freq,rrand(110,440));
1.0.wait;
};

}).play;

// - 0:4:8.44 -  
Tdef(\lctask1,{

inf.do {

a.choose.set(\freq,rrand(110,440));
0.1.wait;
};

}).play;

// - 0:4:14.38 -  
Tdef(\lctask1,{

inf.do {

a.choose.set(\freq,rrand(110,440));
0.25.wait;
};

}).play;

// - 0:4:53.09 -  
Tdef(\lctask2,{

inf.do {

a.choose.set(\amp,exprand(0.01,0.25));
0.25.wait;
};

}).play;

// - 0:5:13.44 -  
SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1; 
var sound, env;

//env=EnvGen.ar(Env([1,0],[sustain],'lin'),doneAction:2);

sound=Resonz.ar(Mix(SinOsc.ar([1,1.05,1.3,1.56,1.79,1.81,2.1,3.1,4.5]*freq,0,amp)),1000,0.1);

Out.ar(out, Pan2.ar(sound,pan))
}).store;

// - 0:5:15.6 -  
a.do({arg val; val.free})	

// - 0:5:16.38 -  
a= Array.fill(4,{arg i; Synth(\lcsynth1,[\freq, (i+1)*110,\amp,0.05])});

// - 0:5:26.42 -  
Tdef(\lctask1,{

inf.do {

a.choose.set(\freq,rrand(110,440));
0.125.wait;
};

}).play;

// - 0:5:30.92 -  
Tdef(\lctask1,{

inf.do {

a.choose.set(\freq,rrand(110,4400));
0.125.wait;
};

}).play;

// - 0:5:41.36 -  
Tdef(\lctask1,{

inf.do {

a.choose.set(\freq,exprand(110,4400));
0.125.wait;
};

}).play;

// - 0:6:1.94 -  
Tdef(\lctask1,{

inf.do {

if(0.1.coin, {a.choose.set(\freq,exprand(110,4400));});
0.25.wait;
};

}).play;

// - 0:6:54.75 -  
SynthDef(\lcsynth2, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1; 
var sound, env;

env=EnvGen.ar(Env([1,0],[sustain],'lin'),doneAction:2);

sound=Resonz.ar(Mix(SinOsc.ar([0.79,1,1.79,1.81,2.1,3.1,4.5]*freq,0,amp)),XLine.kr(5000,1000,0.1),0.1);

Out.ar(out, Pan2.ar(sound*env,pan))
}).store;

// - 0:8:6.68 -  
Tdef(\lctask1,{
var f;

inf.do {
f=rrand(400,500);

Synth(\lcsynth2,[\freq,f]);
Synth(\lcsynth2,[\freq,f+19]);
Synth(\lcsynth2,[\freq,f+24]);

1.0.wait;
};

}).play;

// - 0:8:34.13 -  
Tdef(\lctask1,{
var f;

inf.do {
f=rrand(400,500);

Synth(\lcsynth2,[\freq,f, \amp, 0.5]);
Synth(\lcsynth2,[\freq,f+20, \amp, 0.5]);
Synth(\lcsynth2,[\freq,f+24, \amp, 0.5]);

1.0.wait;
};

}).play;

// - 0:9:16.63 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=rrand(400,500);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.5]);
gap.wait;
Synth(\lcsynth2,[\freq,f+20, \amp, 0.5]);
gap.wait;
Synth(\lcsynth2,[\freq,f+24, \amp, 0.5]);

(1.0-(2*gap)).wait;
};

}).play;

// - 0:9:33.11 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=exprand(400,5000);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.5]);
gap.wait;
Synth(\lcsynth2,[\freq,f+20, \amp, 0.5]);
gap.wait;
Synth(\lcsynth2,[\freq,f+24, \amp, 0.5]);

(1.0-(2*gap)).wait;
};

}).play;

// - 0:10:20.49 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=exprand(400,5000);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+20, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+24, \amp, 0.5, \pan, 1.0.rand2]);

(1.0-(2*gap)).wait;
};

}).play;

// - 0:11:49.61 -  
SynthDef(\lcsynth3, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1; 
var sound,input;

input=In.ar(0,2);
sound=CombN.ar((input**3),0.03,0.03,5);

Out.ar(out, Pan2.ar(sound,LFNoise1.kr(0.5)))
}).store;

// - 0:12:31.37 -  
Synth.tail(RootNode.new, \lcsynth3);

// - 0:13:1.68 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=exprand(400,5000);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+20, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+24, \amp, 0.5, \pan, 1.0.rand2]);

(0.2-(2*gap)).wait;
};

}).play;

// - 0:13:12.69 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=exprand(4000,5000);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+20, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+24, \amp, 0.5, \pan, 1.0.rand2]);

(0.2-(2*gap)).wait;
};

}).play;

// - 0:13:29.57 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=exprand(4000,5000);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+2, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+2, \amp, 0.5, \pan, 1.0.rand2]);

(0.2-(2*gap)).wait;
};

}).play;

// - 0:13:38.37 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=exprand(400,500);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+2, \amp, 0.5, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+2, \amp, 0.5, \pan, 1.0.rand2]);

(0.2-(2*gap)).wait;
};

}).play;

// - 0:14:8.13 -  
b= Array.fill(4,{Synth.tail(RootNode.new, \lcsynth3);});

// - 0:14:25.01 -  
b.do({arg val; val.free})	

// - 0:14:35.01 -  
Tdef(\lctask1,{
var f, gap;

inf.do {
f=exprand(400,500);
gap=rrand(0.01,0.1);
Synth(\lcsynth2,[\freq,f, \amp, 0.15, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+2, \amp, 0.15, \pan, 1.0.rand2]);
gap.wait;
Synth(\lcsynth2,[\freq,f+2, \amp, 0.15, \pan, 1.0.rand2]);

(0.2-(2*gap)).wait;
};

}).play;

// - 0:14:46.72 -  
Tdef(\lctask1).stop	

// - 0:14:53.09 -  
Tdef(\lctask1).stop	

// - 0:14:56.47 -  
Tdef(\lctask0).stop	

// - 0:15:1.25 -  
Tdef(\lctask2).stop	

//definitely not the best really!