How to edit tooltip labels (custom parameters)?

Hi Everyone,

I am wondering something here and maybe someone can help me out on this one:

I have a selector knob that selects 0, 1 and 2, for example. So I want to have the selector’s tool tip text be like: “0-Saw”, “1-Triangle”, “2-Square”, depending on the currently selected option. Instead of just showing 0, 1 and 2. Can it be done? Could someone maybe point me to that direction or maybe some example?

Thanks you all very much, Marcelo.

Hello Marcello,

Have a look at ParamQuantity::setDisplayValueString(), didn’t try it yet but I think it should allow you to set the tooltip label in any way you want. From the module struct, something like paramQuantities[PARAM_ID].setDisplayValueString("Square")maybe

There is a detailed thread here where @Vortico explains the correct way to do this. Configuring custom parameter display in v1

Done this on my LFO module like so:

You can of course set any range you wish. You’ll still be able to input numbers also just returns a string when the param value hits a certain range.

Original discussion:

Thanks a lot guys, with the tips from here I was able to implement.

Thank you very much, Marcelo.

This is an old posting, and I’m fairly certain that this has changed in V2. Could someone post an example of how to do this with the more modern SDK? I’d be very interested in learning! Thanks!!

There are multiple ways to achieve this.

  • Use configSwitch() to configure the param. Yes, you can use configSwitch for a knob. It’s not just for things that look like switches. :-).

If don’t have static descriptions of the values as in configSwitch, and you need something more dynamic:

[edit: removed bogus method that doesn’t exist]

  • Subclass ParamQuantity and override getDisplayValueString.
  • Without making a derived class, you can pq->setDisplayValueString.

When manipulating the value string, the tip is prepended by the name of the param. To change the name, just set the name member.

When making a ParamQuantity subclass it often makes sense to make a companion configMyParam template to configure it.

2 Likes

I gave this a shot based on your answer:

paramQuantities[SHAPE_KNOB]->setDisplayValueString("foo");

But it didn’t seem to work. Any suggestions?

Here’s my entire test:

        
configParam(SHAPE_KNOB, 0.0f, (NUMBER_OF_PLAYBACK_MODES * 2) - 1, 0.0f, "Shape");
paramQuantities[SHAPE_KNOB]->snapEnabled = true;
paramQuantities[SHAPE_KNOB]->setDisplayValueString("foo");

I realize that I already set the name to “Shape”, but I expected the setDisplayValueString call to overwrite the initial value.

When I tried setDisplayString, I got an error:

error: ‘struct rack::engine::ParamQuantity’ has no member named ‘setDisplayString’; did you mean ‘setDisplayValueString’?

Thanks!

1 Like

Abject apologies for mentioning a method that doesn’t exist. Edited the post. My eyes must have been bleary from a long day at the computer. Fall of next year I’m probably having cataract surgery.

1 Like