///////////////////////////////////////////////////
// History, as it was on Fri Aug 18 00:57:58 2006.
///////////////////////////////////////////////////

// - 0:0:0 -  
//tired but must do something!

// - 0:0:11.38 -  
//hmm, primitive roots modulo a prime

// - 0:1:21.93 -  
//all are primitive, so do general case of nonprime

// - 0:5:31.23 -  
~f1={|p| var primitive; (p-1).do {|i| var test=i+1;
var pass=true;

p.div(2).do({|j| if(((test**j)%p)==0, {pass=false}); });

if (pass, {primitive=i});

}; primitive};

// - 0:5:37.67 -  
~f1.value(8)

// - 0:5:57.66 -  
6*4

// - 0:6:24.17 -  
(6**4)

// - 0:6:34.38 -  
(6**8)

// - 0:6:38.27 -  
(6**8)%8

// - 0:7:27.61 -  
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=RLPF.ar(Saw.ar(freq),XLine.kr(5000,1000,sustain*0.5),0.1,amp*env);

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

// - 0:8:59.81 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%16)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp]);
});

1.0.wait;
};

}).play;

// - 0:9:19.9 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%16)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp]);
});

0.5.wait;
};

}).play;

// - 0:9:30.86 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%16)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp]);
});

0.5.wait;
};

}).play(quant:1.0);

// - 0:10:11.31 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%17)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,99*temp]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

// - 0:10:34.76 -  
~freqmult=98;

// - 0:10:40.7 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%17)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult*temp]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

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

inf.do {

~freqmult=(~freqmult-1)%10+90;
1.0.wait;
};

}).play;

// - 0:11:31.23 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%17)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult*temp]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

// - 0:11:40.64 -  
~freqmult

// - 0:11:43.56 -  
~freqmult

// - 0:11:45.81 -  
~freqmult

// - 0:11:53.48 -  
Tdef(\lctask3,{

inf.do {

~freqmult=(~freqmult-1)%10+90;
1.0.wait;
};

}).play;

// - 0:11:56.85 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%16)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp]);
});

0.5.wait;
};

}).play(quant:1.0);

// - 0:12:7.44 -  
Tdef(\lctask3,{

inf.do {

~freqmult=(~freqmult-1)%20+80;
1.0.wait;
};

}).play;

// - 0:12:15.93 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%8)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp]);
});

0.5.wait;
};

}).play(quant:1.0);

// - 0:12:20.9 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%8)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult*temp]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

// - 0:12:39.6 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%8)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult*temp, \sustain, rrand(0.1,0.5)+0.5]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

// - 0:13:1.64 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%8)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp, \sustain, 0.1+exprand(0.1,1.0)]);
});

0.5.wait;
};

}).play(quant:1.0);

// - 0:13:25.83 -  
~freqmult2=101;

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

inf.do {

~freqmult=(~freqmult-1)%20+80;
~freqmult2=(~freqmult2-1)%20+100;
1.0.wait;
};

}).play;

// - 0:13:59.01 -  
Tdef(\lctask4,{
var count,temp;

count=4;

inf.do {

count=((count+1)%10)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult2*temp, \sustain, rrand(0.1,0.5)+0.5]);
});

(0.5*3/2).wait;
};

}).play(quant:1.0);

// - 0:14:5.59 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%9)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult*temp, \sustain, rrand(0.1,0.5)+0.5]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

// - 0:14:25.18 -  
Tdef(\lctask3,{

inf.do {

~freqmult=100-(~freqmult-1)%50;
~freqmult2=(~freqmult2-1)%50+100;
1.0.wait;
};

}).play;

// - 0:14:47.7 -  
Tdef(\lctask3,{

inf.do {

~freqmult=100-((~freqmult-1)%50);
~freqmult2=(~freqmult2-1)%50+100;
1.0.wait;
};

}).play;

// - 0:15:6.07 -  
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=RLPF.ar(Saw.ar(freq),XLine.kr(5000,1000,sustain*0.1),0.1,amp*env);

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

// - 0:15:16.79 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%8)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp, \sustain, 0.1+exprand(0.1,1.0)]);
});

0.25.wait;
};

}).play(quant:1.0);

// - 0:15:23.03 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%8)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp, \sustain, 0.1+exprand(0.1,1.0)]);
});

0.125.wait;
};

}).play(quant:1.0);

// - 0:15:58.77 -  
~modcount=8;

// - 0:16:1.88 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%~modcount)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp, \sustain, 0.1+exprand(0.1,1.0)]);
});

0.125.wait;
};

}).play(quant:1.0);

// - 0:16:36.76 -  
Tdef(\lctask3,{

inf.do {

~freqmult=100-((~freqmult-1)%50);
~freqmult2=(~freqmult2-1)%50+100;
if(0.25.coin,{~modcount= (~modcount+1)%10+10});
1.0.wait;
};

}).play;

// - 0:16:54.29 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%~modcount)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult*temp, \sustain, rrand(0.1,0.5)+0.5]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

// - 0:17:2.98 -  
Tdef(\lctask4,{
var count,temp;

count=4;

inf.do {

count=((count+1)%~modcount)+4;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult2*temp, \sustain, rrand(0.1,0.5)+0.5]);
});

(0.5*3/2).wait;
};

}).play(quant:1.0);

// - 0:17:8.07 -  
Tdef(\lctask2,{
var count,temp;

count=4;

inf.do {

count=((count+1)%~modcount)+5;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,~freqmult*temp, \sustain, rrand(0.1,0.5)+0.5]);
});

(0.5*5/4).wait;
};

}).play(quant:1.0);

// - 0:17:13.39 -  
Tdef(\lctask1,{
var count,temp;

count=4;

inf.do {

count=((count+1)%~modcount)+6;

temp=~f1.value(count);

if(temp.notNil,{
Synth(\lcsynth1,[\freq,100*temp, \sustain, 0.1+exprand(0.1,1.0)]);
});

0.125.wait;
};

}).play(quant:1.0);

// - 0:17:35.78 -  
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=RLPF.ar(Saw.ar(freq),XLine.kr(5000,100,sustain*0.1),0.1,amp*env);

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

// - 0:17:56.02 -  
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=RLPF.ar(Saw.ar(freq),XLine.kr(5000,100,sustain*0.1),XLine.kr(0.5,0.1,0.1),amp*env);

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

// - 0:19:20.52 -  
Tdef(\lctask5,{
var count;
count=10;

10.do {

TempoClock.default.tempo_(count.max(1));

count=count-1;
1.0.wait;
};

}).play;

// - 0:19:39.05 -  
Tdef(\lctask5,{
var count;
count=10;

100.do {

TempoClock.default.tempo_((count/10).max(1));

count=count-1;
1.0.wait;
};

}).play;

// - 0:19:56.73 -  
Tdef(\lctask5,{
var count;
count=100;

100.do {

TempoClock.default.tempo_((count/10).max(1));

count=count-1;
1.0.wait;
};

}).play;

// - 0:20:30.28 -  
Tdef(\lctask5,{
var count;
count=10;

10.do {

TempoClock.default.tempo_((count/10).max(0.1));

count=count-1;
1.0.wait;
};

}).play;

// - 0:20:51.33 -  
Tdef(\lctask1).stop	

// - 0:20:53.88 -  
Tdef(\lctask2).stop	

// - 0:20:56.6 -  
Tdef(\lctask4).stop