While I was looking at the \filter
NodeProxy role code for another reason, I noticed an issue in the code that can lead to the following difference in behaviors: an uninitialized NodeProxy can only have a filter that doesn’t use NamedControls, e.g.
Ndef.clear
Ndef(\prb)[1] = \filter -> { arg in, mfreq = 2; in * SinOsc.ar(mfreq) }
// ok
Ndef.clear
Ndef(\prb)[1] = \filter -> { arg in; in * SinOsc.ar(\mfreq.kr(2)) }
// ERR
This is caused by \filter
calling the function on the right-hand side of the association seemingly while no SynthDef is being built when the NodeProxy is not initialized.
if(proxy.isNeutral) {
ugen = func.value(Silent.ar);
Basically, if func
there tries to emit a NamedControl, that causes the same error, as shown below:
{ arg in; in * SinOsc.ar(\mfreq.kr(2)) }.(Silence.ar) // err
// whereas
{ arg in, mfreq = 2; in * SinOsc.ar(mfreq) }.(Silence.ar) // binop ugen
I’m not sure how to fix this problem other than saying “don’t do that”, for now