[chuck-users] public class connections mystery

Kassen signal.automatique at gmail.com
Fri Feb 24 04:59:44 EST 2012

On Fri, Feb 24, 2012 at 12:07:49AM -0500, mike clemow wrote:
> Seems to be the same object references but they are definitely not
> connected by the time they get that call from the second shred.
> Almost as if the UGen connections had scope...

Hmmm, yes. But that is not so strange; in a way they *do* and really
should. Consider this trivial example of a shred;

SinOsc s => dac;
second => now;
//the end

In that case s will be disconnected from the dac (and should be
garbage collected, not sure that happens yet, fairly sure it doesn't).
"s" should be disconnected because there are no longer any references
to it. More exactly; all connections from a UGen (to it doesn't
matter) that has no references any more should be removed once the
reference count reaches 0, regardless of what shred made those

Here the issue may well be that this mechanism somehow counts
references incorrectly. The algorithm was changed a few times, first
to stop double connections. That change was undone when it turned out
those were extremely useful for squaring signals using a Gain set to
multiply. That resulted in UGens with double connections potentially
keeping (at least) one of those when they went to 0 references. That
last bug was fixed, but the fix may have been too agressive, leading
to the current behaviour?


More information about the chuck-users mailing list