In Faust the controllers are defined with this syntax:
https://faustdoc.grame.fr/manual/syntax/#user-interface-primitives-and-configuration
The current Faust <==> UGen C++ code is only handling/connecting with Faust input controllers (button, sliders, nentry in Faut syntax…), see in particular this Faust_updateControls
code:
which basically uses the IN0
macro to access each controller and update its value, one per audio cycle:
Up to now, output controllers (bargraph in the Faust model) where not handled. So following the input model, I tried to do the same in this new version, handing input controllers with the IN0
macro and in this renamed Faust_updateInputControls
:
and this new Faust_updateOutputControls
function using the OUT0
macro here:
To be used at each audio cycle :
But Christof Ressi answered me:
As I explained, a UGen can only have one computation rate (audio or
control). So if your UGen already does audio computations, all outputs
must be audio rate. As I said, you could use audio outputs for control
information, but you would waste lots of space. Every output would be a
whole audio buffer, but you only write a single sample. (The remaining
samples need to duplicated or zeroed, btw!) If you have, say 100
controls, the UGen would essentially allocate 100 buffers! Also keep in
mind that your UGen is defined with the
kUnitDef_CantAliasInputsToOutputs, which means that it can’t reuse
existing buffers.
I would definitely look into using control busses or Buffers for output
controls.
I would recommend to get some more opinions on this, especially by Josh
Parmenter and Scott Carver.
So my current understating is that using this IN0
and OUTO
model is not appropriate at all.
What are Josh Parmenter and Scott Carve opinion on how the whole input/output controller model should be reworked ? Any UGen example code to look at ?
Thanks.