I noticed that a call to onRandomize will randomize all parameters.
However I use 2 gain parameters whose values shouldn’t get too large. So I thought I set them myself at the end of my version of onRandomize to an acceptable value. However, this code does not seem to have an effect:
void Vocode_O_Matic::onRandomize() {
// set some vars and state here.
…
…
params[CARRIER_GAIN_PARAM].value = INITIAL_CARRIER_GAIN;
params[MODULATOR_GAIN_PARAM].value = INITIAL_MODULATOR_GAIN;
}
A call to onRandomize does not random parameters. That is done lower in the call stack. onRandomize is an event that is called so your module can randomize its own internal state. If you wish to randomize certain parameters differently than uniform, you can override ParamWidget::onRandomize in v1.
Suggestions for better handling this is welcome, since the v1 API is not yet stable.