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

[sc-users] Cannot get trigger argument to, like, trigger



So here's a SynthDef:

(
SynthDef(\ceed,
	{
		|freq = 200, amp = 0.2, gate = 1, t_cutofftrig = 1, pan = 0, out = 0,
cutoff = 1000, res = 0.8, fenvamt = 0, fenvtime = 0.1, bend = 0|
		var audio, env, fenv;
		freq = Lag.kr(freq,bend); 
		freq = freq + (freq * 0.01 * LFNoise1.kr(0.2));
		env = EnvGen.kr(Env.cutoff, gate, amp, doneAction: 2);
		fenv = EnvGen.kr(Env.new([cutoff + (cutoff *
fenvamt),cutoff],[fenvtime]),t_cutofftrig);
		audio = SawDPW.ar(freq, mul: env);
		audio = RLPFD.ar(audio, min(fenv,30000), res);
		audio = Pan2.ar(audio, pan);
		Out.ar(out, audio);
	}
).add;
)

So the filter envelope (fenv) is triggered by an argument called
t_cutofftrig. My understanding is that I can retrigger by setting the
corresponding event key (cutofftrig) to 1 in my pattern. (In fact it
shouldn't even be necessary to do that since it has a default value of 1).

(
~chord = [0,2,4];
Pdef(\patterns,
	Pmono(\ceed,
		\octave, Pstutter(Pwhite(1,8,inf),Pwrand([3,6],[0.92,0.08],inf)),
		\degree, Pseq((0..2),inf).collect({|x|~chord[x]}),
		\pan, 0.3,
		\dur, 0.25,
		\cutoff, 1000,
		\fenvamt, 1,
		\fenvtime, 0.2,
		\res, 0.6,
		\amp, 0.2,
		\cutofftrig, 1,
		\bend, Pseq([Pkey(\dur)/4,0,0],inf)
	)
).play;
)

But no dice. You hear the filter envelope when the Pmono starts, but not any
time after that.

What mistake am I making?



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Cannot-get-trigger-argument-to-like-trigger-tp7622360.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/