The other day I checked the code for Pbindef
and Pbindf
because people use them for the same purpose but I don’t quite get how.
Pbindef
is part of the JITlib, it uses a proxy space that is always playing, at least virtually, so when your code is evaluated:
// first call
Pbindef(\a,
\instrument, \lowClick,
\dur, 1/4).play(quant: [1, 0]);
// seconds call
Pbindef(\a,
\instrument, \lowClick,
\dur, 1/4).play(quant: [0.5, 0]);
I notice it’s calling play twice for the second call. From the documentation, the first Pbindef object creates the proxy space at the symbol \a and later calls don’t have to call play:
Pbindef(\a).trace.play;
Pbindef(\a, \degree, Pseq([1, 2, 3], inf)); // .play shouldn't be called here
In fact, calling play a second time for the same symbol will be ignored internally and the quant parameter will not take effect because it will be using playQuant
property from Pbindef, so the solution could be to keep a reference to the original Pbindef and set the property
p = Pbindef(\a, \degree, Pseq([0, 0, 0, 0]));
p.playQuant = 4;
p.trace.play;
Pbindef(\a, \degree, Pseq([1, 2, 3], inf));
p.playQuant = 3
Pbindef(\a, \degree, Pseq([10, 20, 30], inf));
That seems to work, but I’m not sure it is working as I would expect, I might probably be missing something.
Similar but different is Pbindf which is a filter pattern and receives an event pattern as the first argument:
a = Pbind(\x, Pseq([1, 2, 3]), \z, 9000); // input stream, the original
b = Pbindf(a, \y, Prand([100, 300, 200], inf), \z, 99).play; // filter and play
I this case, I guess, people use it with stop and play like in the following example (I’m guessing because I don’t know):
a = Pbind(\x, Pseq([1, 2, 3], inf), \z, 9); // input stream, the original
(
// filter and play
b = Pbindf(a, \y, Prand([10, 30, 20], inf), \z, 90).trace.play(quant:1);
)
(
// stop, filter and play again.
b.stop;
b = Pbindf(a, \y, Prand([100, 300, 200], inf), \z, 900).trace.play(quant: 1);
)
In this later case quant works with play.
I’m sorry I can’t give more details, I don’t have them.