«Re: network of loosely connected nodes (now working)» by LFSaw

on 21 Oct'13 20:30 in code forksynchronisationweak connection

Idea: network of loosely connected nodes. Each node has a dedicated pulse rate / phase. Inducing an irregular trigger signal influences the nodes to (gradually) adapt their pulsation freq (and phase?) to the one of the input. sound example: https://soundcloud.com/lfsaw/sync-weakconnection-tduty-time

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
(
Ndef(\nodeTest, {
	 // the input
//	var input = Impulse.ar([1, 3, 5].reciprocal * 1, phase: [0, 0.25, 0.5]).sum;

	//var input = Impulse.ar([2, 3], phase: [0, 0.25]).sum;
//	var input = Select.ar(Line.kr(0, 1, 10) * SinOsc.ar(0.01).range(0, 1), [Impulse.ar([0.2, 0.3], phase: [0, 0.25]).sum, LocalIn.ar(1)]);

	var input = Select.ar(Line.kr(0, 1, 10), [Impulse.ar(0.134), LocalIn.ar(1)]);
	// the nodes, each takes its predecessor as input and estimates the duration between two events.
	var nodes = (1..20).inject([input], {|last, item|
		var dur = Gate.ar(
			Timer.ar(TDelay.ar(last.first, Rand(1, 4))),
			last.first
		);

		[TDuty.ar(
			dur.lag(20),
			TDelay.ar(last.first, dur.lag(20)),
			1
		)] ++ last
	});


	LocalOut.ar(nodes.first);

	// add a pitch to each
	nodes = nodes.collect{|node, i|  SinOsc.ar((500 + (i*250)), 0.9pi)
//		* Decay2.ar(node, 0.01, 0.2)
		* EnvGen.ar(Env.perc(0.0001, 0.1), gate: node)
 * 2 * (25-i) * 0.01};

	// splay in stereo field
	//nodes.sum!2;
	Splay.ar(nodes)// + (SinOsc.ar(2000) * Decay2.ar(input, 0.01, 0.2) * 0.1);

}).play
)
raw 1113 chars (focus & ctrl+a+c to copy)
reception
comments