«Musical Toys For Little Robots» by mimetikmusic

on 31 Dec'12 07:25 in algorithmic aleatoric patterns mallets

An algorithmic/aleatoric composition for mallets and proxy patterns

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*"Musical Toys For Little Robots"

       or

  "How I learned to stop worrying and love the proxy"

http://soundcloud.com/unknown-artist-6/musical-toys-for-little-robots

 */

~fx=Bus.audio(s,2);

(
SynthDef(\mallet,{arg in=0,out=0,m=48,a=1,r=1,p=0;

	var sig=Array.fill(3,{|n| SinOsc.ar(m.midicps+(n*0.01),mul:a*0.3)}).sum;
        var env=EnvGen.kr(Env.perc(0.001,r),gate:1,doneAction:2);

	Out.ar(out,Pan2.ar(sig*env,pos:p));
};
).add;

SynthDef(\rev,{arg in=0,out=0;
	var sig=In.ar(in,2);
	sig=sig*0.8+CombC.ar(sig,0.5,0.3,0.5,0.2);
	Out.ar(out,sig)
	};
).add;
)

Synth(\rev,[\in:~fx]);


(
fork{
	var degrees=Prand([0,4,5,7,9,12],inf).asStream;
	var root=[36,48,60,72];
	var x;
	x=Array.new;
	a=PatternProxy(Pseq([0+root.wchoose([0.3,0.4,0.2,0.1])],inf));
	d=1/8;

	~streams=[];
	~names={|pbind| ~streams=~streams++pbind.play(quant:1)};

	~names.value(Pbind(*[\instrument:\mallet,
		               \m:a,
		               \dur:d,
		               \a:{rrand(0.4,1)*0.05},
			           \p:{rrand(-0.2,0.2)},
		               \r:{rrand(0.5,0.8)},
		               \out:~fx
	]));


    20.do({|n|
		x=x.add(degrees.next+root.wchoose([0.3,0.4,0.2,0.1]));
		x.postln;
        a.source=Pseq(x.scramble,inf);
		if ((n+1) % 6 == 0,{~names.value(Pbind(*[\instrument:\mallet,
			           \m:Pcollect({arg inval;inval-[-24,12].choose},a),
		               \dur:d,
			           \a:{rrand(0.4,1)*0.05/(n+1)},
			           \p:{rrand(-0.2,0.2)},
		               \r:{rrand(0.5,0.8)},
		               \out:~fx
		]));"new stream".postln});
			(n+1).wait});

	19.do({|n|
		x.removeAt(0);
		x.postln;
        a.source=Pseq(x.scramble,inf);
		(19-(n+1)).wait;});
4.wait;
	~streams.do{|n| n.stop;2.wait};
}
)
raw 1775 chars (focus & ctrl+a+c to copy)
reception
comments