///////////////////////////////////////////////////
// History, as it was on Thu Aug 10 00:42:42 2006.
///////////////////////////////////////////////////

//don't feel like making any sounds tonight

//probably left it too late, after midnight

//but I will try to code some maths and see where I go

//rather than considering the reduction steps, I want to consider the numbers related `above' a starting point in a chain- that is, those occuring as less primitive on the way to 1

// - 0:2:22.9 -  
~f1= {arg in, num; Array.fill(num, {arg i; in*(2**num)})}

// - 0:2:40.5 -  
~f1= {arg in=1, num=8; Array.fill(num, {arg i; in*(2**num)})}

// - 0:2:43 -  
~f1.value

// - 0:2:51.8 -  
~f1.value(5,8)

// - 0:3:3.7 -  
~f1= {arg in=1, num=8; Array.fill(num, {arg i; in*(2**i)})}

// - 0:3:4.7 -  
~f1.value(5,8)

//function to test if an even number-1 is divisible by 3 
~f2= {|in| if(in.even,{in= if( (((in-1)%3)==0) && (in>3),{in=(in-1).div(3)}) }); in};

// - 0:6:49.5 -  
~f2.value(4);

// - 0:7:1.6 -  
~f2.value(16);

// - 0:7:6.5 -  
~f2.value(18);

// - 0:7:21.6 -  
~f2= {|in| if(in.even,{in= if( (((in-1)%3)==0) && (in>3),{in=(in-1).div(3)},{in}) }); in};

// - 0:7:22.7 -  
~f2.value(18);

// - 0:7:26.1 -  
~f2.value(19);

// - 0:7:28.6 -  
~f2.value(20);

// - 0:7:56.6 -  
~f3= {arg in=1, num=8; Array.fill(num, {arg i; ~f2.value(in*(2**i))})}

// - 0:8:31.9 -  
~f3= {arg in=1, num=8; Array.fill(num, {arg i; ~f2.value(in*(2**i))})}

// - 0:8:55 -  
~f3= {arg in=1, num=8; Array.fill(num, {arg i; ~f2.value((in*(2**i)).asInteger)})}

// - 0:8:56 -  
~f3.value(5,8)

// - 0:9:4.7 -  
~f3.value(5,16)

// - 0:10:36.2 -  
~f3.value(5,8)

// - 0:11:12.5 -  
(~f3.value(15,8))*(12/33)  //convert to midinotes

// - 0:11:20.2 -  
(~f3.value(14,8))*(12/33)  //convert to midinotes

// - 0:11:30.7 -  
(~f3.value(5,8))*(12/33)  //convert to midinotes

// - 0:11:43.4 -  
~f3.value(5,8)

// - 0:11:49.1 -  
~f3.value(5,8)+400

// - 0:12:25.6 -  
~modf=~f3.value(4,8)

// - 0:12:54.6 -  
~freq= ~f3.value(5,8)+400

// - 0:13:5.2 -  
~modf=(~f3.value(4,8))/10

// - 0:13:13.1 -  
~modf=(~f3.value(4,8))/10

// - 0:13:20.7 -  
a={Pan2.ar(Mix(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*5, ~freq),0,0.1)),0.0)}.play;

// - 0:13:54.2 -  
~modf=(~f3.value(3,8))/10

// - 0:14:7.1 -  
~modf=(~f3.value(3,8))/384

// - 0:14:13.2 -  
~modf=(~f3.value(4,8))/10

// - 0:14:23.6 -  
~pan=2*((~f3.value(3,8))/384)-1;

// - 0:14:42.9 -  
a.free

// - 0:14:44.1 -  
a={Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*5, ~freq),0,0.1),~pan))}.play;

// - 0:15:49.4 -  
a.free

// - 0:15:50.7 -  
a={Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq),0,0.1),~pan))}.play;

// - 0:16:34 -  
a.free

// - 0:16:35.6 -  
a={Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(5,1,50)),0,0.1),~pan))}.play;

// - 0:16:53 -  
~freq= ~f3.value(7,8)+400

// - 0:17:18.5 -  
a.free

// - 0:17:20.1 -  
a={Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.1),~pan))}.play;

// - 0:19:41.6 -  
a.free

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

inf.do {

~freq= ~f3.value(rrand(4,10),5)+400;

~modf=(~f3.value(rrand(4,10),5))/10;

~pan=2*((~f3.value(rrand(4,10),5))/384)-1;

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.1),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.0.wait;
};

}).play;

// - 0:21:7.2 -  
Tdef(\lctask2,{

inf.do {

~freq= ~f3.value(rrand(4,11),7)+200;

~modf=(~f3.value(rrand(4,11),7))/5;

~pan=(2*((~f3.value(rrand(4,11),7))/200)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.1),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
3.0.wait;
};

}).play;

// - 0:22:13.6 -  
Tdef(\lctask2,{

inf.do {

~freq= ~f3.value(rrand(4,11),7)+200;

~modf=(~f3.value(rrand(4,11),7))/5;

~pan=(2*((~f3.value(rrand(4,11),7))/200)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.01),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
3.0.wait;
};

}).play;

// - 0:22:19.2 -  
Tdef(\lctask1,{

inf.do {

~freq= ~f3.value(rrand(4,10),5)+400;

~modf=(~f3.value(rrand(4,10),5))/10;

~pan=2*((~f3.value(rrand(4,10),5))/384)-1;

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.01),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.0.wait;
};

}).play;

// - 0:22:28.7 -  
Tdef(\lctask3,{

inf.do {

~freq= ~f3.value(rrand(5,11),6)+300;

~modf=(~f3.value(rrand(5,11),6))/7.5;

~pan=(2*((~f3.value(rrand(5,11),6))/300)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.01),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.5.wait;
};

}).play;

// - 0:22:44.5 -  
Tdef(\lctask3,{

inf.do {

~freq= ~f3.value(rrand(5,11),6)+300;

~modf=(~f3.value(rrand(5,11),6))/7.5;

~pan=(2*((~f3.value(rrand(5,11),6))/300)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.5.wait;
};

}).play;

// - 0:22:50.2 -  
Tdef(\lctask2,{

inf.do {

~freq= ~f3.value(rrand(4,11),7)+200;

~modf=(~f3.value(rrand(4,11),7))/5;

~pan=(2*((~f3.value(rrand(4,11),7))/200)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
3.0.wait;
};

}).play;

// - 0:22:57.3 -  
Tdef(\lctask1,{

inf.do {

~freq= ~f3.value(rrand(4,10),5)+400;

~modf=(~f3.value(rrand(4,10),5))/10;

~pan=2*((~f3.value(rrand(4,10),5))/384)-1;

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.0.wait;
};

}).play;

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

inf.do {

~freq= ~f3.value(rrand(4,10),5)+400;

~modf=(~f3.value(rrand(4,10),5))/10;

~pan=2*((~f3.value(rrand(4,10),5))/384)-1;

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.0.wait;
};

}).play(quant:1.0);

// - 0:23:13.5 -  
Tdef(\lctask2,{

inf.do {

~freq= ~f3.value(rrand(4,11),7)+200;

~modf=(~f3.value(rrand(4,11),7))/5;

~pan=(2*((~f3.value(rrand(4,11),7))/200)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
3.0.wait;
};

}).play(quant:1.0);

// - 0:23:19.3 -  
Tdef(\lctask3,{

inf.do {

~freq= ~f3.value(rrand(5,11),6)+300;

~modf=(~f3.value(rrand(5,11),6))/7.5;

~pan=(2*((~f3.value(rrand(5,11),6))/300)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.5.wait;
};

}).play(quant:1.0);

//fundamentally change algorithm

// - 0:24:47.9 -  
~f2= {|in| if(in.even,{in= if( (((in-3)%3)==0) && (in>3),{in=(in-3).div(3)},{in}) }); in};

// - 0:25:19.1 -  
~f2= {|in| if(in.even,{in= if( (((in-3)%5)==0) && (in>3),{in=(in-3).div(5)},{in}) }); in};

// - 0:25:27.8 -  
~f2= {|in| if(in.even,{in= if( (((in-1)%3)==0) && (in>3),{in=(in-1).div(3)},{in}) }); in};

// - 0:25:53.2 -  
Tdef(\lctask3,{

inf.do {

~freq= ~f3.value(rrand(5,11),6)+300;

~modf=(~f3.value(rrand(5,11),6))/7.5;

~pan=(2*((~f3.value(rrand(5,11),6))/300)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.5.wait;
};

}).play(quant:1.0);

// - 0:25:58.6 -  
Tdef(\lctask2,{

inf.do {

~freq= ~f3.value(rrand(4,11),7)+200;

~modf=(~f3.value(rrand(4,11),7))/5;

~pan=(2*((~f3.value(rrand(4,11),7))/200)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
3.0.wait;
};

}).play(quant:1.0);

// - 0:26:4.4 -  
Tdef(\lctask1,{

inf.do {

~freq= ~f3.value(rrand(4,10),5)+400;

~modf=(~f3.value(rrand(4,10),5))/10;

~pan=2*((~f3.value(rrand(4,10),5))/384)-1;

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(SinOsc.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0,0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.0.wait;
};

}).play(quant:1.0);

// - 0:26:21.1 -  
Tdef(\lctask1,{

inf.do {

~freq= ~f3.value(rrand(4,10),5)+400;

~modf=(~f3.value(rrand(4,10),5))/10;

~pan=2*((~f3.value(rrand(4,10),5))/384)-1;

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(Saw.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.0.wait;
};

}).play(quant:1.0);

// - 0:26:53.2 -  
Tdef(\lctask3,{

inf.do {

~freq= ~f3.value(rrand(5,11),6)+300;

~modf=(~f3.value(rrand(5,11),6))/7.5;

~pan=(2*((~f3.value(rrand(5,11),6))/300)-1).min(1);

SynthDef(\lcsynth1, {arg out=0, amp=0.1, pan=0.0, freq=440, sustain=2.1; 
var sound, env;

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

sound=Mix(Pan2.ar(Pulse.ar(SinOsc.ar(~modf,0, ~modf*Line.kr(1,10,50), ~freq*XLine.kr(2,1,200)),SinOsc.kr(~modf,0,0.1,0.5),0.05),~pan));

Out.ar(out, sound*env)
}).play;

Synth(\lcsynth1);
2.5.wait;
};

}).play(quant:1.0);

// - 0:28:46.4 -  
b={arg in; in=InFeedback.ar(0,2); Out.ar(0,CombL.ar((((in*in).distort)*7).clip2(0.5),0.1,0.1,5))}.play;

// - 0:29:21.9 -  
~f2= {|in| if(in.even,{in= if( (((in-1)%5)==0) && (in>5),{in=(in-1).div(5)},{in}) }); in};

// - 0:29:37.7 -  
~f2= {|in| if(in.even,{in= if( (((in-1)%5)==0) && (in>5),{in=(in-1).div(5)},{in}) }); in*2};

// - 0:29:45.7 -  
~f2= {|in| if(in.even,{in= if( (((in-1)%5)==0) && (in>5),{in=(in-1).div(5)},{in}) }); in*4};

// - 0:29:54.8 -  
~f2= {|in| if(in.even,{in= if( (((in-1)%5)==0) && (in>5),{in=(in-1).div(5)},{in}) }); in*8};

// - 0:30:1.7 -  
~f2= {|in| if(in.even,{in= if( (((in-1)%5)==0) && (in>5),{in=(in-1).div(5)},{in}) }); in};

// - 0:30:9.1 -  
b.free;