For Pfxb, it’s possible but not at all obvious (I had to read the class source code to understand it):
s.boot;
(
SynthDef(\filter, { |out, gate = 1, ffreq = 2000|
var sig = In.ar(out, 2);
sig = LPF.ar(sig, ffreq);
ReplaceOut.ar(out, sig);
}).add;
b = Bus.audio(s, 2); // private bus
)
(
p = Pchain(
Pfxb(
Pbind(\degree, Pn(Pseries(0, 1, 8), inf), \dur, 0.25),
\filter,
\ffreq, 900
),
(out: b) // set private bus here
).play;
)
s.scope(2, b.index); // signal is on the private bus
p.stop;
I’m not sure this really fits into the pattern system’s design.
Patterns don’t play on buses. They create events. If those events play synths, they can pass parameters to tell the synths to play on specific buses.
So to “allocate a whole Pdef to a specific output” means to have the Pdef automatically forward an output-bus parameter to the pattern that it’s controlling. In most cases that would be by inserting \out, busIndex
into the output events. But, as we just saw, Pfxb is different. There isn’t a standardized way that Pdef can do it.
In the ddwChucklib quark, I introduced the idea of a “musical process,” which is a pattern plus all of the resources needed to run the pattern. With this, you can write the constructor/destructor logic once in the “process prototype,” and then this runs automatically every time you create a playable instance of the prototype. Then this is an object which plays onto a bus.
hjh