Display notes, not numbers, in parameter display box?

Hey :slight_smile:

Was wondering if there would be a way to be able to set transpose notes, like C-1, B2, D3 etc. in the parameters text filed, rather than volts and then some text? So you can see which note you are actually setting on the knob?

I did check the the Plugin Api tutorial on parameters settings:

But it doesn’t show any examples of doing that and couldn’t find any examples.

Would that even be possible?

Sure you just need to write a custom param quantity subclass.

It’s possible to display whatever you want in a custom ParamQuantity: deriving from rack::engine::ParamQuantity and overriding getDisplayValue.

Another approach is using a Switch, but that’s unwieldy for such a large range.

Thanks, I’ll look into that :slight_smile:

I just learned about the Quantify today, when I wanted some params to be able to snap to integers.

Snapping is built in:

    var p = configParam(...);
    p->snapEnabled = true;

I did it like this:

configParam(MUTE_PARAM, 0.f , 100.0 , 0.f   , "Freeze %");
paramQuantities[MUTE_PARAM]->snapEnabled = true; 

Which is pretty much the same I guess, just without the variable.

But to be honest I’d rather have a free flowing knob, so the knob itself doesn’t snap, only the value for the display snaps to integer values. I already made the parameters used in the code integers, so that side is fine. It’s just the display side of it.

I’ll look into to paramQuantities tomorrow :slight_smile:

Works also. Another succinct way is:

    configParam(MUTE_PARAM, 0.f, 100.0, 0.f, "Freeze %")
        ->snapEnabled = true;

Too bad it isn’t already part of the template – it’s common enough. But then, it’s easy enough to create a variant of the template that does the boilerplate. I’ve done a few like that.

The example I posted above is exactly that. Free flowing frequency that also shows and accepts typeins of notes. Use the surge vcf and wiggle the frequency knob and you’ll see if in action

1 Like

Ah yes, that did indeed to that. Awesome. It’s only added to the display value, not the parameter itself.

Thanks!

For the original post, I need to dig into that to get it working. Just checked the code from Surge. I’ll need to look into that a few times before trying implementing it, I think :slight_smile:

Yeah so my suggestion is have the param either be voct or midi note and just transform the display values in the ui.