«hommage à l'impressionnisme» by prko

on 08 Apr'18 09:48 in piecequasiinstrumental

An example of iterating randomly filtered pink noise with envelope controls.

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
79
80
81
82
83
84
85
86
// example 1: Klank with 16 Ringzes:
(
fork{
	SynthDef(\aKlank16, {
		arg atk, rls,
		frqs = #[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
		amps = #[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
		rngs = #[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
		var snd, env;
		snd = Klank.ar(`[frqs, amps, rngs], PinkNoise.ar(1!2));
		env = EnvGen.kr(Env([0,1,0], [atk, rls], -5), doneAction:2);
		OffsetOut.ar(0, snd * env);
	}).add;

	s.sync;

	{
		var numDo, ptchs, frqs, rngs, amps;
		numDo = 200;
		ptchs = (21, 23..135);
		frqs = { (ptchs.wchoose(Array.fill(ptchs.size, { |i| (i/ptchs.size*pi).sin }).normalizeSum).midicps) };
		amps = { (-96..-54).choose.dbamp };
		rngs = { exprand(1.5, 3.5) };
		numDo.do{
			arg i;
			var wait, waitFactor;
			wait = exprand(0.05, 2.5);
			waitFactor = 1; // Array.fill(numDo, { |i| 0.8 + ((numDo/2+i/numDo*pi).sin.abs * 2) })[i];

			s.makeBundle(0.2, {
				Synth(\aKlank16, [
					\atk,[0.01]++(wait*(2.5..5.5)).wchoose([0.3, 0.15, 0.2, 0.15, 0.2]),
					\rls, wait*(5.5..9.5).choose,
					\frqs, {frqs.()}.dup(16),
					\amps, {amps.()}!16,
					\rngs, {rngs.()}!16
			], 1, 0) });

			(waitFactor*wait).wait
		}
	}.fork
}
)


// example 2: Klank with 9 Ringzes(sc posts a warning message when exceeding 9 Ringzes):
(
fork{
	SynthDef(\aKlank9, {
		arg atk, rls;
		var snd, env, ptchs, wghts;
		ptchs = (21, 23..135);
		wghts = Array.fill(ptchs.size, { |i| (i/ptchs.size*pi).sin }).normalizeSum;
		snd = Klank.ar(
			`[
				{ TWChoose.kr( 1, ptchs.midicps, wghts) }!9,
				{ Rand(-96, -54).dbamp }!9,
				{ Rand(1.5, 3.5) }!9
			],
			PinkNoise.ar(1!2)
		);
		env = EnvGen.kr(Env([0,1,0], [atk, rls], -5), doneAction:2);
		OffsetOut.ar(0, snd * env);
	}).add;

	s.sync;

	{
		var numDo = 200;
		numDo.do{
			arg i;
			var wait, waitFactor;
			wait = exprand(0.05, 2.5);
			waitFactor = 1; // Array.fill(numDo, { |i| 0.8 + ((numDo/2+i/numDo*pi).sin.abs * 2) })[i];

			s.makeBundle(0.2, {
				Synth(\aKlank9, [
					\atk,[0.01]++(wait*(2.5..6.5)).wchoose([0.3, 0.15, 0.2, 0.15, 0.2]),
					\rls, wait*(5.5..9.5).choose
			], 1, 0) });

			(waitFactor*wait).wait
		}
	}.fork
}
)
raw 2166 chars (focus & ctrl+a+c to copy)
reception
comments
badnumbersmusic user 14 Apr'18 00:12

Leaves me with the image of bells heard through the leaves of trees. :)

Seriously, I have no idea how you did that. Bravo.