[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] Pattern-stuff



Hello folks,

concerning Patterns...
I thought in order to introduce new Event Parts I have to define a new msgFunc.
But in this Event below it is never ever evaluated...

Why? What am I doing wrong?
Is it something with \type, \set ?

in hope for any help

Till

(
var iNum = 10;
iNum.do{|i|
~a[i] = {|freq = 0, amp = 1, pan = 0, attac = 0.1, ndur = 1, t_gate = 1|
		var sum;

		sum = [LFSaw, SinOsc].choose.ar(
			freq.lag(0.3),
			mul: SinOsc.kr(0.1, 0.2pi*i).range(1, 3)
		).softclip * iNum.reciprocal * EnvGen.kr(
			Env.perc(attac, 1-attac),
			gate: t_gate,
			levelScale: amp*0.95,
			levelBias: amp*0.05,
			timeScale: ndur
		);
		Pan2.ar(sum, pan);
	}
}
)

~a.play




Pdef(\aer).play


b = 12
a = 0
(
Pdef(\aer,
	Pbind(
		\type, \set,
		\id, Pfunc({ ~a.objects.choose.nodeID },
			inf),
\freq, Pfunc({([0, 2, 8, 9, 12, 14, 15, 24].choose+[40, 52].choose+a +b).midicps},
			inf),
		\amp, Pfunc({rrand(0.2, 1)},
			inf),
		\attac, Pfunc({rrand(0.001, 0.5)},
			inf),
		\ndur, Pfunc({rrand(0.02, 0.2)},
			inf),
		\t_gate, Pfunc({rand2(1.0)},
			inf),
		\pan, Prand([-1, 0, 1],
			inf),
		\dur, Prand([0.25],
			inf),
		\msgFunc, { arg id, freq;
		[[
			9, ~instrument, id, 0, ~group,
			\out, ~out,
			\freq, freq,
			\amp, ~amp,
			\pan, ~pan,
			\vol, ~vol,
			\attac, ~attac,
			\ndur, ~ndur,
			\t_gate, ~t_gate
		]].postln;
		}
	)
)
)
Pdef(\aer).stop


~a.free(12)


regards
Till