That’s true – if the node was created in a way that isn’t prepared to accept this kind of modulation, then it can get tricky.
Here, I think there is a difference between experimenting with ideas (where you might not have prepared the synthesis structure for additional modulation) and production (where you probably already have some idea what you want to do). What you’re saying is that it’s not possible without preparation (true) but it came across a bit like it’s not possible in general.
One of the purposes of Teaser: ddwPlug quark (work-in-progress, not public yet) (which is public now btw) was to reduce the distance between Synth() style and NodeProxy-style control mapping. That is: Currently, the first thing we teach new users is Synth(). Then they want to plug a signal into some input and… “well… OK, get ready to learn about control buses and asMap, and manage these resources by yourself.” They might find their way to JITLib, but then give up the easy polyphony that Synth() provides.
I wanted a structure that is superficially like Synth() but easily mappable, e.g.:
(
x = Syn(\default, [
freq: Plug({ |value = 440, time = 1|
VarLag.kr(value, time, warp: Env.shapeNumber(\lin))
})
]);
)
x.set("freq/value", 880, "freq/time", 2);
x.release;
The \default SynthDef has not been changed, but you get the glissando. Patterns…? Sure. This interface might look a little funky, but I wanted to preserve events’ pitch calculations, which would be overridden if a Plug were provided for \freq.
(
p = Pbind(
\type, \syn,
\instrument, \default, // no change to SynthDef, again
\dur, Pexprand(0.2, 0.8, inf),
\legato, Pwhite(2.0, 5.0, inf),
\degree, Pwhite(0, 10, inf),
\freqPlug, { |freq|
Plug({ |freq, time|
freq * EnvGen.kr(Env([0.5, 1], [time], -3))
}, [freq: freq, time: ~sustain.value * 0.25])
}
).play;
)
p.stop;
Note that all of these overlap (very hard to do with proxy mapping!) and there’s no bus leakage.
One thing that I want to do, but haven’t done yet, is to allow Plugs to be added in .set
– then you wouldn’t even need to prepare, just x = Syn(\default)
and x.set(\freq, Plug(...))
later.
If this were to enter the SC lexicon in general, then it wouldn’t be “oh that’s hard,” but rather just a few keystrokes away. But it’s difficult for ideas like this to gain traction, because Synth() and its limitations are deeply ingrained.
hjh