How to fade out patterns with long events?


I am facing a problem I simply cannot figure out: How can I elegantly fade out a pattern that is playing really long events (longer than the fade out time) in a way that is elegant and nice, and doesn’t block other patterns in the same parent group? This is as far as I have come, and it causes all manners of problems, including applying the fade to the bus that other synths are using. Does anyone have good solutions for this particular problem? I really want the fade out to be responsible for release all the inner synths in the group at fadeout, I think this is the way to go for stopping these long events. Anyways, I am stuck. Any ideas?

var numChannels = 2;
var name = "fader2";
SynthDef(name, {
    var out = \;
    var sig =, numChannels:numChannels);
    var fadeInTime = \;
    var fadeOutTime = \;
    var envGate = \;
    var env = Env.asr(fadeInTime, 1, fadeOutTime, \sine);
    env = envGate, doneAction: Done.freeGroup).poll(label: "env");, channelsArray:sig * env);


SynthDef(\sine, {
    var out = \;
    var freq = \;
    var amp = \;
    var envGate = \;
    var env =, 1, 1, \sine), envGate, doneAction:Done.freeSelf);
    var sig =, mul:amp).dup(numChannels) * env;, channelsArray:sig);
var fadeOutTime = 4;
var fadeInTime = 4;

var inpattern = Pbind(
    \instrument, \sine,
    \dur, 32,
    \delta, 4,
    \freq, Pwhite(50,250)

p = Pgroup(Pfx(inpattern, "fader2", \fadeInTime, fadeInTime, \fadeOutTime, fadeOutTime)).play;
o = Pgroup(Pfx(Pbindf(inpattern, \freq, Pkey(\freq) + 100), "fader2", \fadeInTime, fadeInTime, \fadeOutTime, fadeOutTime)).play;


// Stop one, to hear problem

Would it work to play each pattern on a private bus, and let the fader synth have separate in and out buses, routing from the private bus to the main out (with a regular Out UGen)?