Filter Env not triggered in pattern

Hi there,

The synth below used to work normally til I downloaded a recent version of SC. I’m now on version 3.13.0-rc1 running on a Macbook pro (M1 Max), OS Ventura 13.0.

SynthDef(\pm,
	{
		arg gate = 1, trig = 1, buf = 0, clip=1;
		var env, envctl, sig, out;
		env = EnvGen.kr(Env.asr(\attack.kr(0.01), 1, \release.kr(1)), gate, doneAction:2);
		envctl=\env.kr(Env.newClear(3).asArray);

		sig = PlayBuf.ar(1, buf, BufRateScale.kr(buf) * \rate.kr(1), trig, \startPos.kr(0)*BufSampleRate.kr(buf), \loop.kr(0));
		sig = SVF.ar(sig, \ffreq.kr(20000), \res.kr(0.1), \lo.kr(1), \band.kr(0), \hi.kr(0), \notch.kr(0), \pk.kr(0), \vol.kr(1));
		sig = Clip.ar(sig, clip.neg, clip);
		sig = SVF.ar(sig, EnvGen.kr(envctl), \eres.kr(0.1), \elo.kr(1), \eband.kr(0), \ehi.kr(0), \enotch.kr(0), \epk.kr(0)); // this line seems to behave strangely... 
		sig = sig * env;
		out = [sig, DelayC.ar(sig, 0.2, \del.kr(0))];
		Out.ar(\outbus.kr(0), out)
}).add;

The second SVF (with a triggered Env on the cutoff freq) doesn’t seem to work in patterns anymore (it used to…)

t = TempoClock(140/60).permanent_(true);
(
Pbindef(\a,
	\instrument, \pm,

	\legato, 0.7,
	\release, 0.5,
	\dur, 0.5,

	\buf, // a mono buffer,
	\rate, 0.midiratio,
	\startPos, 10,

	\del, 0,

	\ffreq, 20000,
	\res, 0,
	\lo, 1,
	\band, 0,
	\hi, 0,
	\notch, 0,
	\pk, 0,

	\env, Env([20000, 200, 20], [0.2, 0.1], ['exp', 'sin']),
	\eres, 0,
	\elo, 1,
	\eband, 0,
	\ehi, 0,
	\enotch, 0,
	\epk, 0,

	\vol, 1,
	\clip, 1,
	\outbus, 0
).play(t);
)

Does anyone have an idea on what’s happening?

Thanks

I think you’ll need to wrap the envelope in array brackets. As it is now, I believe it’s treated as a stream and not passed as an Env.

hjh

1 Like