SchedAbs delay when stopping/starting Ndefs

I have the following code:

t.schedAbs(, { Ndef(\y).stop; } );
t.schedAbs(, { Ndef(\comb).play; } );

t.schedAbs(, Ndef(\comb).stop; );
t.schedAbs(, Ndef(\y).play;  );

My expectation is that the server would, in the future, stop and start the appropriate NDefs on the beat and I would, essentially, get a hard cut between the two.

What I am hearing instead is that the playing Ndef is cut on the beat, but the Ndef to play takes a few hundred milliseconds (at least) to start playing.

What is happening here ? Is this standard JITLib behavior ? If I wanted to cut back and forth between the two would it make more sense to have an audio sink that’s essentially a muted bus ?

I guess it’s the built-in fade: NodeProxy | SuperCollider 3.12.2 Help


You might be happy to know that you don’t need schedAbs for this - quantization is already built into NodeProxy and Ndef:

Ndef(\foo).quant = 1;
Ndef(\foo, {
	var trig, hpFreq;
	trig =;
	hpFreq = 4000;

	Env.perc(0, 1, 1, -42).kr(gate:trig) *, hpFreq)

Try changing hpFreq and resetting the synth - changes will be quantized according to quant, and thus it will stay in sync with itself. This should apply to play/stop as well.

And, fwiw, stop IS actually just muting the bus - the synth is still playing in the background in this case.

Ah, testing this for the play/stop case I see that play is implemented to use quant, but stop is NOT. In fact, stop doesn’t even necessarily use the correct clock to schedule the stop!

I haven’t tested this too much, but this extension seems to fix the issue by scheduling the stop according to quant (and the correct clock!) the saw way that it’s done for play:

+BusPlug {
	stop { | fadeTime, reset = false |
		var bundle =;
		monitor.stopToBundle(bundle, fadeTime);
		bundle.schedSend(this.homeServer, this.clock ? TempoClock.default, this.quant);
		if(reset) { monitor = nil };
		this.changed(\stop, [fadeTime, reset]);

This definitely feels like a bug in BusPlug - JITLib is usually impressively bulletproof with this kind of thing, I’m surprised this bug has been around for so long without being discovered!

wow! I found a bug!
Thanks for the help, scztt.

@scztt - that change looks like it works.
Good stuff! Thank you.