at the risk of misunderstanding codebox:
v = v*in2 + (1-in2)*in1;
out1 = v;
Pipe your parameter value into the first inlet, and a constant value into the second inlet which should be between around 0.85 and 0.999. The higher the value, the more smoothing - try with 0.95.
This implements a simple IIR filter: exponential smoothing. The constant is the
lambda factor which determines how quickly the value can change.
The idea is that the code updates a state variable called
v, but I'm not sure what value it will be initialised to...
Let me know if this works then we can try out hysteresis!