2 // Julian Rohrhuber, 2007
8 var activity, nAtoms, tHalf, n;
10 tHalf = 3.92; // Radon-219, discovered 1904 by Giesel and Debierne.
11 nAtoms = 1e+5; // ca. 3.6e-14 mg
13 n = max(0, nAtoms - PulseCount.ar(LocalIn.ar(2)));
14 activity = Dust.ar( n * 2.log / tHalf);
15 LocalOut.ar(activity);
24 var sources, u, uu, above, aside;
25 above = MouseY.kr(0, 2).round(1);
26 aside = MouseX.kr(1, 1.6);
28 WhiteNoise.ar([0.3, 0.3]),
34 LFDNoise1.kr(4).range(0, sources.size),
37 u = u + DelayN.ar(u, 0.1, [0.001, 0.0012], 0.1);
39 uu = u.collect {|chan|
42 { rrand(100.0, 340) * aside }.dup(4),
46 uu = CombL.ar(uu.reverse, 0.05, 0.05, 0.3, 0.3) * LFNoise2.kr(0.2).max(0) + uu;
47 SelectX.ar(above.lag(0.4), [u, uu]) * 2;
55 OffsetOut.ar(0, Pulse.ar(1000, 0.5, EnvGen.ar(Env.linen(0, 0.01, 0, 0.1), doneAction:2)))
61 if(coin.coin) { coin = rrand(0.1, 1) };
62 (coin * (1 + 0.5.rand2) * 20).wait;
63 (instrument: \ibm).play;
72 var pat, trig, rate, which, mfv, numbers, both, dial, sig, n = 8;
73 mfv = [[697, 770, 852, 941], [1209, 1336, 1477, 1633]];
74 numbers = [[3, 1]] ++ {:[a,b], a<-(0..2), b<-(0..2)}.all;
75 n = Dwhite(7, 12, inf);
76 rate = Dseq([ Dwhite(2, 7, 1), Dbrown(0.1, 0.2, 0.01, n) ], inf);
78 trig = Trig.kr(TDuty.kr(rate, 0, Dseq((1..10), inf)), 0.09);
79 pat = Latch.kr(trig, trig);
80 which = Hasher.kr(pat * MouseX.kr).range(0, numbers.size).trunc.poll(trig, "");
81 both = Select.kr(which, numbers);
82 dial = Select.kr(both, mfv.flop);
83 sig = SinOsc.ar(dial) * 0.05 * trig;
88 LFDNoise3.kr(0.5).range(0, 0.01)
90 + GrayNoise.ar(0.01) + HPF.ar(GrayNoise.ar(0.02), 3000)]
98 "MathLib".include; // needs MathLib
109 var str = axiom.rewriteString(rules, i + 6);
110 var dt = 2 ** i.neg * 10;
111 var trig = TDuty.ar(dt, 0,
112 Dseq(str.collectAs(_.digit, Array).postln)
114 var freq = ExpRand(200, i + 1 / 7 * 10100);
115 Ringz.ar(trig, freq * [1, 1.2, 1.5], ExpRand(2 ** i.neg * 0.1, 1.101) ).sum.distort
122 // sturmian sequencer II
125 "MathLib".include; // needs MathLib
138 var str = axiom.rewriteString(rules, i + 6);
139 var dt = 2 ** (n - i).neg * 20;
140 var trig = TDuty.ar(dt, 0,
141 Dseq(str.collectAs(_.digit, Array), inf)
143 var freq = TExpRand.kr(200, (n - i) / n * 10100, trig);
144 trig = BPF.ar(trig, LFNoise2.kr(0.1, 0.02, 1) * freq, 0.2);
145 Ringz.ar(trig, freq * [1, 1.1, 1.2], ExpRand(2 ** i.neg * 0.1, 0.5)).sum.distort;
151 // sturmian sequencer III
154 "MathLib".include; // needs MathLib
166 var str = axiom.rewriteString(rules, i + 6);
167 var dt = SampleDur.ir / (n - i + 2) * MouseX.kr(1, SampleRate.ir, 2);
169 Dseq(str.collectAs(_.digit, Array) - 0.5, inf)
178 // practise in the abstract
180 SynthDef(\strings, { arg out, freq=440, amp=0.1, gate=1, pan, freqLag=0.2;
181 var env, in, delay, f1, f2;
182 f1 = freq.lag(freqLag);
183 f2 = freq.lag(freqLag * 0.5);
185 env = Env.asr(0, 1, 0.3);
186 in = WhiteNoise.ar(180);
187 in = CombL.ar(in, delay, delay, 1);
188 in = Resonz.ar(in, f1, 0.001).abs;
189 in = in * EnvGen.kr(env, gate, doneAction:2);
190 Out.ar(out, Pan2.ar(in, pan, amp));
196 \instrument, \strings,
199 Pshuf([0, 2, 3, 5], 10),
200 Pseq([\rest], { 9.rand })
202 + Prand([0, 0, 0, [0, 3], [0, 1]], inf),
203 \dur, Pseq([1, 2, 0.3, 0.5, 0.5], inf) + (Prand([0.3, 0, 0.2], inf) * 0.1),
204 \detune, Pseg(Pwhite(-2, 2, inf), 1.3)
217 var freq, u, amp, rate;
219 rate = ExpRand(0.1, 2);
220 freq = if(0.6.coin) {
221 LFNoise1.kr(rate.dup).exprange(0.01, 10)
223 LFNoise1.kr(rate.dup).exprange(10, 50)
225 u = LFSaw.kr(LinExp.kr(saw, -1, 1, freq, freq * LFNoise1.kr(rate.dup).exprange(2, 10)));
227 u * [1 - saw, saw.reverse].choose
229 u * LFSaw.kr(freq * 0.1, 0, 0.1, 1)
237 n.do { func = func <> func };
243 freq = g.(f, 4).value(LFSaw.kr(0.2 * [1, 1.1])).exprange(6, 11000);
244 BPF.ar(Saw.ar(freq).product, [70, 800, 9000, 5242], 0.2).sum.dup * 0.3