NodeProxy.map and many-to-one routing

One can easily create one-to-one routing between NodeProxies with .map or <>>:

(
Ndef(\effect, {
FreeVerb.ar(\in.ar(0!2));
});
Ndef(\source1, {
SinOsc.ar(440).dup;
});
Ndef(\source2, {
WhiteNoise.ar().dup;
});
Ndef(\source1) <>> Ndef(\effect);
);


Is there a JITlib-style way of routing \source2 to \effect's in such that it is added / mixed with \source1's signal?

Hello and welcome to the community!

I’m not sure it’s possible with a direct mapping using .map or <>>, but you can create an intermediate Ndef(\fxsend), which is mapped to Ndef(\effect). Then you can add multiple sources to the slots of Ndef(\fxsend).

(
Ndef(\effect, {
FreeVerb.ar(\in.ar(0!2));
});
Ndef(\source1, {
SinOsc.ar(440).dup;
});
Ndef(\source2, {
WhiteNoise.ar().dup;
});
Ndef(\fxsend) <>> Ndef(\effect);
Ndef(\fxsend)[0] = Ndef(\source1);
Ndef(\fxsend)[1] = Ndef(\source2);
Ndef(\effect).play;
)


I’m still relatively new to Ndefs myself, so perhaps there is a better solution, but I think this should work for most use cases.

1 Like

Another way (similar, but a little simplified):

Ndef(\effect, {
FreeVerb.ar(\in.ar(0!2));
}).play;

Ndef(\source)[0] = {
SinOsc.ar(440).dup;
};
Ndef(\source)[1] = {
WhiteNoise.ar().dup;
};

Ndef(\source) <>> Ndef(\effect);

1 Like

I think there is a ProxySubmix class in the JITLibExtensions quark.

hjh

1 Like