NodeProxy .controlKeysValues except bug?

hey,

here i create a NodeProxy and specify two NamedControls \freq and \amp:

(
x = NodeProxy.new.source_({ 
	var freq = \freq.kr(440);
	var amp = \amp.kr(0.5);
});
)

when i call .controlKeysValues.pairsDo i get:

x.controlKeysValues.pairsDo{ |key, val| key.postln; };
-> [ freq, 440, amp, 0.5 ]

which i would expect, but when i use the .except method with [\amp] i get beside \freq all the internal keys:

x.controlKeysValues(except: [\amp]).pairsDo{ |key, val| key.postln; };
-> [ freq, 440, gate, 1.0, fadeTime, 0.02, out, 0, i_out, 0 ]

compare it with this version where i specifiy the internalKeys to be excepted explicitly:

x.controlKeysValues(except: x.internalKeys ++ [\amp]).pairsDo{ |key, val| key.postln; };
-> -> [ freq, 440 ]

is this a bug?

many thanks :slight_smile:

This happens in NodeProxy:controlNames:

except = except ? this.internalKeys;

(Which might be slightly more efficient as except = except ?? { this.internalKeys };.)

So the rule presently is: Excluding internalKeys is a default, which is overridden by any value given to except.

It’s probably up to Julian or Alberto to say if that’s a bug or not.

hjh

hey, thanks for your reply :slight_smile:

it would probably be nice if an additional argument would be added to be able to set noInternalKeys to true or false, like its done in getKeysValues which is set to true per default.