Setting an individual NodeProxy Parameter

Hello -
I know there is a way to do this - but I am maybe forgetting or finding it difficult to find the right words to search for.

If I want to set ~a[0] and ~a[1] separately, is there a way to do it? I’d like to be able to set them both at the same time or address them separately, with different messages.

Thank you!

~a = NodeProxy(s, \audio,2).play;

~a[0] = { SinOsc.ar(\freq.kr(400), 0, 0.1)};
~a[1] = { SinOsc.ar(\freq.kr(500), 0, 0.1)};


~a.set(\freq, 400);

I’m far from a specialist, but why not using Group? you could have an array of synths grouped, and you can address the group to set all, and the items of the array to set specifics?

1 Like

As I understand it, parameters are set per nodeproxy. They would need different names to have different values, or reside in different proxies.

(In my JITLib-for-modular-synthesis environment, I go a step further and have one value per parameter name over the entire proxyspace… not relevant for standard JITLib usage, but just pointing out that there may be more than just one concept of locality here.)

hjh

1 Like

I don’t know if it’s recommended, but you could do

~a.objects[1].set(\freq, 600);

This works well - is there a reason that it isn’t recommended?

The reason I hesitate to recommend this approach is because it dissociates the \freq control for this particular synth from what is in the ProxyNodeMap. As @jamshark70 mentioned, the parameters are set per nodeproxy. This is baked into the design of NodeProxy, wherein all of the parameter mappings for a nodeproxy are stored in a single ProxyNodeMap, and as far as I know, there is no way to specify different mappings for different slots.

When you do ~a.objects[1].set(\freq, 600), you are bypassing the nodemap and setting the control directly. So now if you do an action that relies on the nodemap, like ~a.send, the results may not be what you expected. This may not be an issue for your use case, but I didn’t want to present it as a universal solution since there are so many different ways to use nodeproxies.

1 Like