Feature request: subpatcher invocation from within codebox / GenExpr

Dan Gayle's icon

Currently, composing gen~ algorithms from reusable abstractions requires working at the visual patcher level. It would be very useful to be able to invoke a gen abstraction as a function call from within a GenExpr.

gen (which loads a .gendsp abstraction) and setparam (which drives named parameters inside a subpatcher) are both exclusively visual objects. There is no equivalent within GenExpr codebox code. The only related construct in GenExpr is Param (capital P), which declares an externally-drivable parameter, but requires passing params via setparam in the parent patcher.

This means that if you're authoring a complex algorithm inside a codebox, you cannot call out to an abstraction. You have to either inline everything, or split your design across mixed codebox/visual-patcher layers, which can get unwieldy.

Something along the lines of this would be cool, no need for complex import statements:

out1, out2 = gen("example.filter", in1, freq: cutoff, q: resonance);

This would allow building modular, composable DSP algorithms entirely within the codebox authoring context, treating abstractions as first-class callable units rather than requiring a context switch to visual patching just to wire in a subpatcher.