Quantizing .stop on a pattern?

Hello, well i see there is this previous post on the same question, but he didn’t seem to have answered it properly.

Take this example, i’ve writen what i basically want to acomplish:

a = Pbind(\dur,0.25).play(quant:1)
b = Pbind(\degree, 3,\dur,0.25).play(quant:1);

a should stop exactly when b start playing. how is that to be accomplished? Is there someway of having a quant key also for the stop? This code yields:

WARNING: keyword arg ‘quant’ not found in call to EventStreamPlayer:stop

thank you very much!

I’d use Pdef for that:

Pdef(\a, Pbind(\dur,0.25)).play(quant:1);
Pdef(\a ,Pbind(\degree, 3,\dur,0.25))

thx very much for the reply, but somehow i still had problems because the Pdefs seemed sometimes does not change with the right quantization. Anyhow I came up with my own solution, with which i can quantize any arbitrary command.

(just read if ur interested, the problem is basically solved by now)

I’ve basically written my own class which calls a Pbind and then this Pbind calls a Pfunc to stop all the input of the Class with the quantization. This way you can quantize anything! The method is kinda weird, because i dont know how to properly code this. But this solution surely does its job!

Anyhow, here is the class (the class is called Q.sc):

Q { *uant {arg quant,input;
	^Pbind(\amp, Pseq([0],1),\foo,Pfunc{input.value()}).play(quant:quant)

And then I try to quantize free a synth like this:


a = Synth(\sinn);
Q.uant(6,{a.free;'now it stops!'.postln;})

This way, i don’t only can stop a Pbind with a quantization but also a synth or do what ever quantized.

I bet nobody cares at this point, but i just wanted to complete this thread.