Hello! I’m hoping to completely override the randomize feature [CTRL-r] in my module. A similar discussion was posted here, and @Coirt suggested that it’s possible to achieve this with code similar to:
void randomize() override {}
Here’s my situation: I’ve received a request from @secretcinema to change how randomization works in Digital Sequencer. Digital Sequencer has custom controls on the front panel for setting the CV sequence and gate sequence. I’d like to only randomize those two features using custom code. Parameters, such as sequence length, should be left alone.
You can’t override this function, it is what gets called when you select randomize. The only way to do what you want (I think) is to have all the controls that you DON’T want randomized override ParamWidget::ranodmize(). so each knob, switch, etc that you use will need to implement that function and do nothing.
How can I override ParamWidget::Randomize? Would I need to create my parameters differently, and if so, is there an example or conversation to show me how to do that?
yes, I think I see the confusion. You don’t do this in configParam, you do it in your module widget consructors, where you add all the widgets like knobs. so it’s like the knobs themselved that need to get the overriden widget.
Unfortunately my code uses too many helpers and has too much legacy baggace to see easily, but:
If you ignore my baggage, this is in the main constructor for my whole UI widget. You will have your own ModuleWidget::addParam() calls, and you will be using some class of widget (in my case it’s a Blue30Knob).
So in my case I would make a new widget:
class KnobNoRandom : public Blue30Knob {
pubilc:
void randomize() override {} // do nothing. base class would actually randomize
};
then use that widget when I’m making my module widget / UI.