///////////////////////////////////////////////////
// History, as it was on Thu Aug 31 18:39:29 2006.
///////////////////////////////////////////////////

// - 0:0:0 -  
//polychordal scales on the final day

// - 0:3:45.84 -  
~f1={arg in, num; var ratios, scale; in=in.sort; scale=List[1]; ratios= Array.fill(in.size-1,{arg i; in[i+1]/in[i]}); 

num.do({arg j; var start; start= (ratios.last)**j; ratios.do({arg rat; var tmp; 

tmp= rat*start;

tmp= tmp/(2**(log2(tmp).asInteger));

scale.add(tmp)}); });

scale.asArray.sort;
}

// - 0:4:11.24 -  
~scale1= ~f1.value([3,7,9],3)

// - 0:4:19.26 -  
~scale1= ~f1.value([3,7,9],4)

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

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

sound=Resonz.ar(Blip.ar(freq,XLine.kr(numharm,10,sustain*0.25),amp),500,0.2)*env;

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

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

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

sound=RLPF.ar(Blip.ar(freq,XLine.kr(numharm,10,sustain*0.25),amp),500,0.2)*env;

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

// - 0:8:24.87 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

Synth(\lcsynth1,[\freq, pitches.next]);
rhy.next.wait;
};

}).play;

// - 0:8:48.34 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

Synth(\lcsynth1,[\freq, pitches.next, \amp, 0.5]);
(rhy.next*0.5).wait;
};

}).play;

// - 0:9:25.13 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({Synth(\lcsynth1,[\freq, pitches.next, \amp, 0.3]);});

(rhy.next*0.5).wait;
};

}).play;

// - 0:10:19.9 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({Synth(\lcsynth1,[\freq, pitches.next, \amp, 0.3, \numharm, (~scale1.choose)*100]);});

(rhy.next*0.5).wait;
};

}).play;

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

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

sound=Resonz.ar(Blip.ar(freq,XLine.kr(numharm,10,sustain*0.25),amp),500,0.2)*env;

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

// - 0:10:51.35 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({Synth(\lcsynth1,[\freq, pitches.next, \amp, 0.7, \numharm, (~scale1.choose)*100]);});

(rhy.next*0.5).wait;
};

}).play;

// - 0:11:19.65 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth1,[\freq, pitches.next, \amp, 0.7, \pan, i-1, \numharm, (~scale1.choose)*100]);});

(rhy.next*0.5).wait;
};

}).play;

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

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

sound=RLPF.ar(LFSaw.ar(freq,0,amp),resfreq,0.2)*env;

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

// - 0:12:2.61 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\freq, pitches.next, \amp, 0.7, \pan, i-1, \numharm, (~scale1.choose)*100]);});

(rhy.next*0.25).wait;
};

}).play;

// - 0:12:7.95 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\freq, pitches.next, \amp, 0.1, \pan, i-1, \numharm, (~scale1.choose)*100]);});

(rhy.next*0.25).wait;
};

}).play;

// - 0:12:19.31 -  
~scale1= ~f1.value([3,5,9],4)

// - 0:13:54.11 -  
Tdef(\lctask3,{

inf.do {

if(0.2.coin,{
~scale1= ~f1.value([[2,3].choose,[5,7].choose,[9,11].choose],rrand(2,5));
});

1.0.wait;
};

}).play;

// - 0:14:20.62 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\sustain,2,\freq, pitches.next, \amp, 0.1, \pan, i-1, \numharm, (~scale1.choose)*100]);});

(rhy.next).wait;
};

}).play;

// - 0:14:46.9 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth1,[\sustain,2, \freq, pitches.next, \amp, 0.7, \pan, i-1, \numharm, (~scale1.choose)*100]);});

(rhy.next*2).wait;
};

}).play;

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

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

sound=Resonz.ar(Blip.ar(freq,XLine.kr(numharm,3,sustain*0.5),amp),500,0.2)*env;

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

// - 0:15:11.38 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\sustain,2,\freq, pitches.next, \amp, 0.05, \pan, i-1, \numharm, (~scale1.choose)*100]);});

(rhy.next).wait;
};

}).play;

// - 0:15:33.6 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\sustain,2,\freq, pitches.next, \amp, 0.05, \pan, i-1, \numharm, (~scale1.choose)*100]);});

1.0.wait;
};

}).play;

// - 0:15:40.26 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth1,[\sustain,2, \freq, pitches.next, \amp, 0.7, \pan, i-1, \numharm, (~scale1.choose)*100]);});

1.0.wait;
};

}).play;

// - 0:16:15.93 -  
SynthDef(\lcsynth3, {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=SinOsc.ar(SinOsc.ar(10,0,10*5,freq),0,amp)*env;

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

// - 0:16:36.74 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\sustain,2,\freq, pitches.next, \amp, 0.05, \pan, i-1, \numharm, (~scale1.choose)*100]);});

1.75.wait;
};

}).play;

// - 0:17:46.04 -  
Tdef(\lctask1,{
var rhy;

rhy=Pseq([0.25,0.25,0.5,0.5,0.5,0.25,0.25, Prand([0.5,0.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth3,[\freq,rrand(60,70)]);
rhy.next.wait;
};

}).play;

// - 0:17:54.89 -  
Tdef(\lctask4,{
var rhy;

rhy=Pseq([0.25,0.25,0.5,0.5,0.5,0.25,0.25, Prand([0.5,0.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth3,[\freq,rrand(60,70)]);
rhy.next.wait;
};

}).play;

// - 0:18:13.46 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth1,[\sustain,2, \freq, pitches.next, \amp, 0.7, \pan, i-1, \numharm, (~scale1.choose)*100]);});

2.25.wait;
};

}).play;

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

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

sound=Resonz.ar(Blip.ar(XLine.kr(freq,freq*0.5,0.05),XLine.kr(numharm,3,sustain*0.5),amp),500,0.2)*env;

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

// - 0:19:0.15 -  
~amp=0.1;	

// - 0:19:3.24 -  
Tdef(\lctask4,{
var rhy;

rhy=Pseq([0.25,0.25,0.5,0.5,0.5,0.25,0.25, Prand([0.5,0.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth3,[\freq,rrand(60,70), \amp, ~amp]);
rhy.next.wait;
};

}).play;

// - 0:19:54.39 -  
Tdef(\lctask3,{
var amp;

amp=Pseq([0.1,0.2,0.35,0.5,0.75,0.5,0.35,0.2,0.1],inf).asStream; 
inf.do {

if(0.2.coin,{
~scale1= ~f1.value([[2,3].choose,[5,7].choose,[9,11].choose],rrand(2,5));
~amp=amp.next;
});

1.0.wait;
};

}).play;

// - 0:20:22.93 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\sustain,2,\freq, pitches.next, \amp, 0.05, \pan, i-1, \numharm, (~scale1.choose)*100]);});

4.75.wait;
};

}).play;

// - 0:20:33.52 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth1,[\sustain,2, \freq, pitches.next, \amp, 0.7, \pan, i-1, \numharm, (~scale1.choose)*100]);});

5.25.wait;
};

}).play;

// - 0:21:28.96 -  
SynthDef(\lcsynth4, {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=LPF.ar(PinkNoise.ar(amp),XLine.kr(10000,1000,sustain))*env;

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

// - 0:22:16.22 -  
Tdef(\lctask5,{
var rhy;

rhy=Pseq([0.25,1.25,0.5,0.5,1.5,0.25,0.25, Prand([0.5,1.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth3,[\sustain, exprand(0.01,0.1), \amp, ~amp]);
rhy.next.wait;
};

}).play;

// - 0:22:43.84 -  
SynthDef(\lcsynth4, {arg out=0, amp=0.1, pan=0.0, freq=1000, sustain=0.1; 
var sound, env;

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

sound=LPF.ar(PinkNoise.ar(amp),XLine.kr(10000,freq,sustain))*env;

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

// - 0:23:5.42 -  
Tdef(\lctask6,{
var rhy;

rhy=Pseq([0.25,1.25,0.5,0.5,1.5,0.25,0.25, Prand([0.5,1.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth4,[\sustain, exprand(0.01,0.1), \amp, ~amp*0.25]);
rhy.next.wait;
};

}).play;

// - 0:23:47.76 -  
Tdef(\lctask7,{
var rhy;

rhy=Pseq([0.25,1.25,0.5,0.5,1.5,0.25,0.25, Prand([0.5,1.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth4,[\sustain, exprand(0.01,0.1), \amp, ~amp*0.5]);
(rhy.next*0.5).wait;
};

}).play;

// - 0:23:56.53 -  
Tdef(\lctask7,{
var rhy;

rhy=Pseq([0.25,1.25,0.5,0.5,1.5,0.25,0.25, Prand([0.5,1.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth4,[\sustain, exprand(0.01,0.4), \amp, ~amp*0.5]);
(rhy.next*0.5).wait;
};

}).play;

// - 0:24:1.34 -  
Tdef(\lctask7,{
var rhy;

rhy=Pseq([0.25,1.25,0.5,0.5,1.5,0.25,0.25, Prand([0.5,1.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth4,[\sustain, exprand(0.01,0.4), \amp, ~amp]);
(rhy.next*0.5).wait;
};

}).play;

// - 0:24:5.03 -  
Tdef(\lctask6,{
var rhy;

rhy=Pseq([0.25,1.25,0.5,0.5,1.5,0.25,0.25, Prand([0.5,1.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth4,[\sustain, exprand(0.01,0.1), \amp, ~amp*0.5]);
rhy.next.wait;
};

}).play;

// - 0:25:0.84 -  
Tdef(\lctask4,{
var rhy;

rhy=Pseq([0.25,0.25,0.5,0.5,0.5,0.25,0.25, Prand([0.5,0.75,1.0],1)],inf).asStream;

inf.do {

Synth(\lcsynth3,[\freq,~scale1.choose*70, \amp, ~amp]);
rhy.next.wait;
};

}).play;

// - 0:25:23.34 -  
Tdef(\lctask2,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth2,[\sustain,2,\freq, pitches.next, \amp, 0.05, \pan, i-1, \numharm, (~scale1.choose)*100]);});

8.75.wait;
};

}).play;

// - 0:25:28.32 -  
Tdef(\lctask1,{
var rhy, pitches;

rhy=Pn(Plazy({Pseq(~scale1,1)}),inf).asStream;

pitches= Pfunc({~scale1.choose*440}).asStream;

inf.do {

3.do({arg i; Synth(\lcsynth1,[\sustain,2, \freq, pitches.next, \amp, 0.7, \pan, i-1, \numharm, (~scale1.choose)*100]);});

7.25.wait;
};

}).play;

// - 0:26:23.96 -  
Tdef(\lctask3,{
var amp;

amp=Pseq([0.1,0.2,0.35,0.5,0.75,0.5,0.35,0.2,0.1],inf).asStream; 
inf.do {

if(0.2.coin,{
~scale1= ~f1.value([[2,3].choose,[5,7].choose,[9,11].choose],rrand(2,5));
~amp=amp.next;
TempoClock.default.tempo_([1,rrand(0.9,1.1),2,4].choose);
});

1.0.wait;
};

}).play;

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

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

sound=Resonz.ar(Blip.ar(XLine.kr(freq,freq*0.25,0.05),XLine.kr(numharm,3,sustain*0.5),amp),XLine.kr(4000,1000,0.5),0.2)*env;

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

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

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

sound=RLPF.ar(LFSaw.ar([1,1.03]*freq,0,amp),resfreq,0.2)*env;

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

// - 0:28:26.41 -  
g=Group.tail(RootNode.new)

// - 0:29:58.09 -  
b=SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1; 
var input, sound;

input= In.ar(0,2);

sound= Limiter.ar(CombN.ar(input*input*5,0.05,0.05,5),0.99);

Out.ar(out, sound)
}).play(g,addAction:\addToTail);

// - 0:31:8.42 -  
b.free;	

// - 0:31:13 -  
\\ended with some sort of error, synths piling up...