///////////////////////////////////////////////////
// History, as it was on Sat Aug 12 20:15:15 2006.
///////////////////////////////////////////////////

// - 0:0:0 -  
//today more 3x+1

// - 0:0:28.72 -  
//how about looking at numbers close together as starting points and then seeing how they diverge?

// - 0:1:46.69 -  
~f1= {arg in; if(in.even, {while({in.even},{in=in.div(2);})  },{in=3*in+1;}); in};

// - 0:2:11.28 -  
~f1.value(5);

// - 0:2:15.17 -  
~f1.value(4);

// - 0:2:17.97 -  
~f1.value(32);

// - 0:2:38.3 -  
//snakes and ladders is what this maths is really about

// - 0:3:2.65 -  
~starts= [37,38,39];

// - 0:3:11.37 -  
~now=~starts;

// - 0:5:0.47 -  
a=Prout({~now= ~now.collect({arg val; ~f1.value(val); }); ~now.differentiate.yield;}).asStream;

// - 0:5:4.71 -  
a.next

// - 0:5:6.95 -  
a.next

// - 0:5:29.19 -  
~now=~starts;

// - 0:5:31.7 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:34.91 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:36.58 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:37.43 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:38.16 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:38.87 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:39.56 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:40.47 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:47.46 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:48.4 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:49.23 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:50.17 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:51.52 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:52.48 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:53.38 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:54.31 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:5:55.18 -  
~now= ~now.collect({arg val; ~f1.value(val); }); 

// - 0:6:1.76 -  
//ok, got a mechanism

// - 0:6:26.95 -  
a=Prout({~now= ~now.collect({arg val; ~f1.value(val); }); ~now.sort.differentiate.yield;}).asStream;

// - 0:6:28.89 -  
a.next

// - 0:6:30.63 -  
a.next

// - 0:6:47.8 -  
a=Prout({inf.do({ ~now= ~now.collect({arg val; ~f1.value(val); }); ~now.sort.differentiate.yield;}); }).asStream;

// - 0:6:49.35 -  
a.next

// - 0:6:51.26 -  
a.next

// - 0:6:53.08 -  
a.next

// - 0:6:54.27 -  
a.next

// - 0:6:54.69 -  
a.next

// - 0:6:55.06 -  
a.next

// - 0:6:55.4 -  
a.next

// - 0:6:55.71 -  
a.next

// - 0:6:56.04 -  
a.next

// - 0:6:56.31 -  
a.next

// - 0:7:0.65 -  
~starts= [37,38,39];

// - 0:7:2.56 -  
a.next

// - 0:7:2.95 -  
a.next

// - 0:7:3.42 -  
a.next

// - 0:7:3.85 -  
a.next

// - 0:7:6.03 -  
~now=~starts;

// - 0:7:7.63 -  
a.next

// - 0:7:8.04 -  
a.next

// - 0:7:8.39 -  
a.next

// - 0:7:8.77 -  
a.next

// - 0:7:9.23 -  
a.next

// - 0:7:9.55 -  
a.next

// - 0:7:9.74 -  
a.next

// - 0:7:9.88 -  
a.next

// - 0:7:10.02 -  
a.next

// - 0:7:10.17 -  
a.next

// - 0:7:10.32 -  
a.next

// - 0:7:10.45 -  
a.next

// - 0:7:10.58 -  
a.next

// - 0:7:10.72 -  
a.next

// - 0:7:10.86 -  
a.next

// - 0:7:11.02 -  
a.next

// - 0:7:11.18 -  
a.next

// - 0:7:11.34 -  
a.next

// - 0:7:11.51 -  
a.next

// - 0:7:11.67 -  
a.next

// - 0:7:11.85 -  
a.next

// - 0:7:12.04 -  
a.next

// - 0:7:12.23 -  
a.next

// - 0:7:12.45 -  
a.next

// - 0:7:12.66 -  
a.next

// - 0:7:12.87 -  
a.next

// - 0:7:13.09 -  
a.next

// - 0:7:13.28 -  
a.next

// - 0:7:28.38 -  
//ok, interesting, now to use for frequencies?

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

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

sound=SinOsc.ar(Saw.ar(modf, modf*index, freq),0,amp);

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

// - 0:8:51.99 -  
b= Synth(\lcsynth1);	

// - 0:10:45.8 -  
Tdef(\lctask1,{

inf.do {
var data;

data= a.next;

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
1.0.wait;
};

}).play;

// - 0:11:55.08 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

data= a.next;

waittime= ((data.sum)*0.1).max(0.1).min(1.0);

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
waittime.wait;
};

}).play;

// - 0:12:0.57 -  
~starts= [37,38,39];

// - 0:12:2.52 -  
~now=~starts;

// - 0:12:25.75 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

data= a.next;

waittime= ((data.sum)*0.1).max(0.1).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
waittime.wait;
};

}).play;

// - 0:12:31.95 -  
~now=~starts;

// - 0:12:40.81 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

data= a.next;

waittime= ((data.sum)*0.03).max(0.1).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
waittime.wait;
};

}).play;

// - 0:12:56.97 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

data= a.next;

waittime= ((data.sum)*0.03).max(0.1).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
waittime.wait;
};

}).play;

// - 0:13:46.92 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.02.coin, {

~starts= [0,1,2]+rrand(30,50);

~starts.postln;

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.03).max(0.1).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
waittime.wait;
};

}).play;

// - 0:13:49.42 -  
~starts= [37,38,39];

// - 0:14:10.45 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.02.coin, {

~starts= [0,1,2]+rrand(30,50);

~starts.postln;

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.01).max(0.1).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
waittime.wait;
};

}).play;

// - 0:14:16.6 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,50);

~starts.postln;

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.01).max(0.1).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(10)), \modf, (data[1].min(100)), \freq, (10*data[2]).min(1000).max(100));
waittime.wait;
};

}).play;

// - 0:14:40.76 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,50);

~starts.postln;

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.01).max(0.1).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (10*data[2]).min(2000).max(200));
waittime.wait;
};

}).play;

// - 0:16:2.93 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,50);

~starts.postln;

b.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3)]);	

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.01).max(0.1).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (10*data[2]).min(2000).max(200));
waittime.wait;
};

}).play;

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

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

sound=Resonz.ar(LFSaw.ar(Saw.ar(modf, modf*index, freq),0,amp),1000,0.2,2);

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

// - 0:17:29.27 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.05.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3)]);	

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (10*data[2]).min(2000).max(200));
waittime.wait;
};

}).play;

// - 0:17:46.2 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.05.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3)]);	

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
waittime.wait;
};

}).play;

// - 0:18:7.93 -  
SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1, modf=10, index=5, cutoff=1000; 
var sound, env;

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

sound=Resonz.ar(LFSaw.ar(Saw.ar(modf, modf*index, freq),0,amp),cutoff,0.2,2);

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

// - 0:18:24.05 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.05.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	

~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

//waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
waittime.wait;
};

}).play;

// - 0:18:37.21 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.05.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
waittime.wait;
};

}).play;

// - 0:18:49.75 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
waittime.wait;
};

}).play;

// - 0:19:47.66 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:20:1.79 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:20:9.44 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:20:21.92 -  
b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

// - 0:20:33.84 -  
~starts= [0,1,2]+rrand(30,100);

// - 0:20:42.52 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:21:4.04 -  
	Tdef(\lctask1).stop

// - 0:21:11.05 -  
	Tdef(\lctask1).play

// - 0:21:14.7 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.05).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:22:10.5 -  
SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1, modf=10, index=5, cutoff=1000; 
var sound, env;

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

sound=Mix(Resonz.ar(LFSaw.ar(Saw.ar([0.9,1.0,1.1]*modf, modf*index, freq),0,amp),cutoff,0.2,2));

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

// - 0:22:26.85 -  
SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1, modf=10, index=5, cutoff=1000; 
var sound, env;

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

sound=Mix(Resonz.ar(LFSaw.ar(Saw.ar([0.9,1.0,1.1]*modf, modf*index, freq),0,amp),cutoff,0.2,2));

Out.ar(out, Pan2.ar(sound,Rand(-1.0,1.0)))
}).store;

// - 0:23:6.48 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.1.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.02).min(0.5);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:23:14.41 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.03.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.005).max(0.02).min(0.5);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:23:39.03 -  
SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=0.1, modf=10, index=5, cutoff=1000; 
var sound, env;

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

sound=Mix(Resonz.ar(LFSaw.ar(Saw.ar([0.7,0.8,0.9,1.0,1.1,1.2,1.3]*modf, modf*index, freq),0,amp),cutoff,0.2,2));

Out.ar(out, Pan2.ar(sound,Rand(-1.0,1.0)))
}).store;

// - 0:24:4.2 -  
Tdef(\lctask1,{

inf.do {
var data, waittime;

if (0.03.coin, {

~starts= [0,1,2]+rrand(30,100);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.001).max(0.02).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:24:51.82 -  
//competing tasks now

// - 0:25:32.62 -  
Tdef(\lctask2,{
var b,c,d; 

inf.do {
var data, waittime;

if (0.04.coin, {

~starts= [0,1,2]+rrand(30,200);

~starts.postln;

b.free; 
c.free; 
d.free; 

b= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

c= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);

d= Synth(\lcsynth1, [\freq,rrand(200,700),\amp,exprand(0.1,0.3), \cutoff, exprand(1000,4000)]);	
~now=~starts;
});

data= a.next;

waittime= ((data.sum)*0.001).max(0.02).min(1.0);

waittime.postln;

b.set(\index, 1+((data[0]/10.0).min(20)), \modf, (data[1].min(200)), \freq, (5*data[2]).min(2000).max(100));
c.set(\index, 1+((data[1]/10.0).min(20)), \modf, (data[2].min(200)), \freq, (5*data[0]).min(2000).max(100));
d.set(\index, 1+((data[2]/10.0).min(20)), \modf, (data[0].min(200)), \freq, (5*data[1]).min(2000).max(100));

waittime.wait;
};

}).play;

// - 0:26:56.57 -  
e={Out.ar(0,CombL.ar(InFeedback.ar(0,2),0.1,MouseX.kr(0.001,0.1,'exponential'),MouseY.kr(0.1,10,'exponential')))}.play;

// - 0:27:3.31 -  
e.free

// - 0:27:34.37 -  
e={Out.ar(0,CombL.ar(InFeedback.ar(0,2),0.1,MouseX.kr(0.005,0.1,'exponential'),MouseY.kr(0.1,1,'exponential'),0.2))}.play;

// - 0:27:53.4 -  
e.free

// - 0:28:2.97 -  
e={Out.ar(0,CombL.ar(InFeedback.ar(0,2),0.1,MouseX.kr(0.01,0.1,'exponential'),MouseY.kr(0.1,1,'exponential'),0.2))}.play;

// - 0:28:49.1 -  
~starts= [37,38,39];

~now=~starts;