2 //(C) Nick Collins 2007
5 //first send the SynthDefs; make sure the Server is on
8 arg freq=440,amp=0.1, sustain=0.1, pan=0.0;
11 source= LPF.ar(Mix(LFPar.ar(freq*[0.999,1.001],0,amp)).distort,EnvGen.kr(Env([10000,2000,4000,1000],[0.005,Rand(0.009,0.05),0.005])));
13 env= EnvGen.kr(Env([0,1,0.4,0.7,0],[Rand(0.001,0.005),0.005,0.005,sustain]), doneAction:2);
15 Out.ar(0,Pan2.ar(source*env,pan))
19 //preferred version if you have the FreeVerb UGen, commented out by default
21 //ReplaceOut.ar(0,FreeVerb.ar(In.ar(0,2),0.33,1.5))
24 //adapted from JmC reverb
27 c = 2; // number of comb delays
28 a = 3; // number of allpass delays
31 // reverb predelay time :
32 z = DelayN.ar(in, 0.048,0.048);
34 //for delaytime if want modulation- //LFNoise1.kr(0.1.rand, 0.04, 0.05)
35 y=Mix.arFill(c,{CombL.ar(z,0.1,rrand(0.01, 0.1),5)});
37 // chain of 4 allpass delays on each of two channels (8 total) :
38 a.do({ y = AllpassN.ar(y, 0.051, [rrand(0.01, 0.05),rrand(0.01, 0.05)], 1) });
40 // add original sound to reverb and play it :
49 Synth(\goeysynth,[\freq,440]); //test
55 var n, octaves, basenote, selections, probs;
56 var ioirow, ioimult, noterow, amprow, susrow, panrow;
59 n=12; //notes per octave
61 fxsynth= Synth(\goeyfx);
63 noterow=(0..(n-1)).scramble; //[4,0,5,14,13,15,21,19,20,11,6,10]%12;
64 amprow= Pseq((1,3..36).neg.dbamp.scramble,inf).asStream;
65 susrow= Pseq((((1..37)/37).exp/exp(1)).scramble,inf).asStream;
66 panrow= Pseq((((0..31)/31)*2-1).scramble,inf).asStream;
70 ioirow= n**(((1..n).scramble)/n); //exponential spacing 1 to n
71 ioirow= Pseq(ioirow,inf).asStream;
75 selections= Array.fill(n,{0});
76 probs=Array.fill(n,{1.0});
84 if(ioimult.coin,{ioimult=[0.01,0.025,0.05,0.1,0.2].choose;});
86 if(0.03.coin,{selections= Array.fill(n,{0});});
87 if(0.02.coin,{octaves= rrand(2,5);});
88 if(0.01.coin,{basenote=rrand(35,47);});
91 probs.do{|val,i| if(val<0.9999,{probs[i]=probs[i]+0.1})};
93 s.makeBundle(s.latency, {
94 [1,2,3,4,5].wchoose([0.5,0.35,0.1,0.025,0.025]).do{
95 notenow= noterow.wchoose(probs.normalizeSum);
99 selections[notenow]=selections[notenow]+1;
101 Synth.before(fxsynth, \goeysynth,[\freq, ((((selections[notenow]%octaves)*12)+ basenote) + ((notenow/n)*12)).midicps,\amp,(amprow.next)*0.2, \sustain, susrow.next, \pan, panrow.next]);
107 ((ioirow.next)*ioimult).wait;
115 //future possibilities:
116 //add different rhythmic sections, and also, use fold or wrap on array data
117 //up to four notes at once in selection; optional slight spread? really need independent voices too