Why do these chords overlap?

When I play the pattern below on the default clock the chords do not overlap. However, when I play it on the TempoClock I create, they overlap. How can I get them not to overlap at the higher tempo.

s.boot;

//tempoclock configuration
t = TempoClock(180/60).permanent_(true)
(
SynthDef(\woo, {
	arg dur =1, rate = 8;
	var sig, env, filtrFreq;
	filtrFreq = SinOsc.ar(rate).range(300, 3000);
	sig = 5.collect({
		Saw.ar(\freq.kr(440) + Rand(-1, 1), mul: 0.2)});
	sig = Splay.ar(sig);
	sig = MoogFF.ar(sig, filtrFreq);
	env = Env([0,1,0], [dur/2,dur/2], curve: -3).ar(Done.freeSelf);
	sig = sig * env;
	Out.ar(0, sig);
}).add;
)

(
x = Pbind(\instrument, \woo,
	\dur, 4,
	\freq, Pseq([[48, 58], [50,60]].midicps, 3)
)
)

~player = x.play(t);
~player.stop;

This is because your Synth doesn’t know about the tempo, and interprets the dur control in seconds

One possible way:

//tempoclock configuration
t = TempoClock(180/60).permanent_(true)
(
SynthDef(\woo, {
	arg durSecs = 1, rate = 8;
	var sig, env, filtrFreq;
	filtrFreq = SinOsc.ar(rate).range(300, 3000);
	sig = 5.collect({
		Saw.ar(\freq.kr(440) + Rand(-1, 1), mul: 0.2)});
	sig = Splay.ar(sig);
	sig = MoogFF.ar(sig, filtrFreq);
	env = Env([0,1,0], [durSecs / 2, durSecs / 2], curve: -3).ar(Done.freeSelf);
	sig = sig * env;
	Out.ar(0, sig);
}).add;
)

(
x = Pbind(\instrument, \woo,
	\dur, 4,
	\durSecs, Pfunc { |event| event.dur / t.tempo },
	\freq, Pseq([[48, 58], [50,60]].midicps, 3)
)
)

~player = x.play(t);
~player.stop;
1 Like