Why is NodeProxy outputting on the wrong bus if In.kr(\out.ir) is used inside its function?

Feeling like procrastinating – here is a sketch that takes care of the problem for out.

@julian – What do you think about this?

Summarizing the issue, it is that the current approach in ProxySynthDef, of always creating its own out control, means that there is no way for the user’s synthdef to have access to the output channel and have the proxy play on the correct channel. The solution here is to look at all existing control names in the def, and trace from this to the correct OutputProxy channel of whichever Control object is responsible for this input. If none is found (which would be most of the time), the ProxySynthDef can make its own out control. Otherwise, it can create the Out UGen using the existing control created by the user.

(
s.waitForBoot {
	c = Bus.control(s, 10);
	
	Ndef(\x, { |out|
		In.kr(out)
	});
};

Ndef(\x).trace

TRACE 1001  temp__0x-129297539_1007    #units: 9
  unit 0 Control
    in 
    out 10

... snip...

  unit 8 Out
    in  10 0
    out
)

In principle we should do the same thing for gates, but I don’t understand the logic.

hjh

1 Like