You need include the testsuite in your sclang_conf.yaml (for the unit tests to usable).
Speaking of extensions… you could drop a new file (with a .sc
extension) in any of them, containing
+ EventPatternProxy {
constrainStream { arg stream, newStream, inval, cleanup;
var delta, tolerance, fadeOutCleanup;
var quantBeat, catchUp, deltaTillCatchUp, forwardTime, quant = this.quant;
^if(this.quant.isNil) {
cleanup !? { cleanup.exit(inval) };
newStream
} {
quantBeat = this.quantBeat ? 0;
catchUp = this.outset;
delta = thisThread.clock.timeToNextBeat(quant);
tolerance = quantBeat % delta % 0.125;
if(catchUp.notNil) {
deltaTillCatchUp = thisThread.clock.timeToNextBeat(catchUp);
forwardTime = quantBeat - delta + deltaTillCatchUp;
delta = newStream.fastForward(forwardTime, tolerance) + deltaTillCatchUp;
};
if(fadeTime.isNil) {
if(delta == 0) {
cleanup !? { cleanup.exit(inval) };
newStream
} {
Pseq([
EmbedOnce(
Pfindur(delta, stream, tolerance).asStream,
cleanup
),
newStream
]).asStream
}
}{
fadeOutCleanup = cleanup.copy;
cleanup.clear; // change need be seen by caller function, i.e. embedInStream
Ppar([
EmbedOnce(
PfadeOut(stream, fadeTime, delta, tolerance),
fadeOutCleanup
),
PfadeIn(newStream, fadeTime, delta, tolerance)
]).asStream
}
}
}
}
Then recompile your classlib. (You’ll get a warning about overrides, but that’s ok.) This is equivalent to the patch from github.
You can also do
EventPatternProxy.findMethod(\constrainStream).filenameSymbol
to see where’s it’s loaded from.