View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

SC3 course networking script

Home   How To   Code Pool   Public Library   Theory   Events

(
a = [82, 87, 81, 90, 91, 83, 89, 92, 95, 42, 86, 88, 96].collect({ arg el;
	Server("test"++el, NetAddr("10.10.10." ++ el, 57110))
});
)

a[0].makeWindow;

f = { arg synthDef; a.do({ arg el; synthDef.send(el) }) };

(
SynthDef("finesine", { arg out, freq=440, amp=0.1, pan, sustain=0.01, x=0.5;
		var e, u;
		e = EnvGen.ar(Env.perc(0.001, sustain, amp), doneAction:2);
		u = SinOsc.ar(freq * [1.0, 5/6, 17/8] * XLine.ar(1 + x, 1, sustain)).sum * amp;
		Out.ar(out, u)
}).send(a[0]);
)

(
f.value(
	SynthDef("finesine", { arg out, freq=440, amp=0.1, pan, sustain=0.01, x=0.5;
		var e, u;
		e = EnvGen.ar(Env.perc(0.001, sustain, amp), doneAction:2);
		u = SinOsc.ar(freq * [1.0, 5/6, 17/8] * XLine.ar(1 + x, 1, sustain)).sum * amp;
		Out.ar(out, u)
	})
)
)

(
Tdef(\x, {
	a.scramble.do { arg el, i;
		Synth.grain(\finesine, [\freq, 1000 *( i % 4).postln + 1000], el);
		0.1.wait;
	}
}).play;
)


(
Tdef(\x, {
	var pat;
	pat = Pseq([0, 3, 1, 0, 0, 0, 0, 0]);
	pat.asStream.do { arg serverIndex, i;
		Synth.grain(\finesine, [\freq, 1000 *(serverIndex).postln + 1000], a[serverIndex]);
		0.1.wait;
	}
}).play;
)









Link to this Page