can we display x^2 on params?

hi,

is there any way to setup a param in a way that it will display x^2 value? such as min = 0.0f, max = 1.0f (i.e. normalized) and it will output:

0,00: 0
0,25: 0,0625
0,50: 0,25
0,75: 0,5625
1,00: 1

tried with some combinations of displayBase and displayMultiplier, without any results. thanks

you can display any string you want if you use a custom param quantity. This has been the recommended way to do it for a long time:

    class LimitParam : public ParamQuantity {
    public:
        std::string getDisplayValueString() override {
            const int value = int((std::round(getValue())));
            std::string tip;
            if (value <= 0) {
                // value = 32;
                tip = "(natural:32)";
            } else {
                SqStream s;
                s.add(value);
                tip = s.str();
            }
            return tip;
        }
    };
    this->configParam<LimitParam>(Comp::LENGTH_PARAM, 0, 16, 0, "Note Buffer Length");
3 Likes

yeah of course, I just think that doing somethings “basic” would be already implemented, without introduce custom struct. but if none, I’ll do this way.

thanks