There's nothing intrinsic in a Synth running on the server that would let you differentiate based on who created it. But I can think of two ways you might filter things -
1. Use a separate group for each Pbind - then you can snapshot just that group. This wouldn't work if you needed individual synths from one Pbind to end up in different groups, but that's not a very common requirement (this is what I was doing in my example code).
2. Add a dummy parameter to your synth, set it from your Pbind, and filter based on that. That can't be done by TreeSnapshot alone, but you could just walk through the snapshot once you receive it, and search for synths with that parameter. E.g. (didn't test this code....):
SynthDef(\foo, { |createdBy| ... }).add;
Pbind(
\instrument, \foo
\createdBy, 1
);
TreeSnapshot.get({
|sn|
var node, nodes = List.newFrom(sn.children);
while { nodes.empty.not } {
node = nodes.removeAt(nodes.size - 1);
if (node.isKindOf(GroupSnapshot) {
nodes.addAll(node.children);
} {
if (node.controls[\createdBy] == 1) {
node.postln;
}
}
}
})
And incidentally - if you're finding it useful to filter the TreeSnapshot by other things than just the synthdef name, let me know - it's a very small change to support filtering via an arbitrary function, so I might add that functionality.
- S