show 2 value in 1 label

  • Hello,
    I'm looking for how to display the values ​​of the Frequency button in a lfo modulator using a label.
    knowing that it has 2 different values, one from 0 to 40 and the other is the synchronization of time (1/2, 1/4 ...)
    I put a button on my interface which allows to activate or not the tempo sync. but I would like that depending on if the tempo sync is activated or not, the value is displayed in the label therefore, either in frequency or in 1/2 1/4 ....
    how can i do?

  • @yall Put all sync values in an array such as const var tempoValues = ["1/1", "1/2D", "1/2", "1/2T", etc...];

    Then it depends if you use 2 different knobs (one for freq and another for sync values) or a single knob changing its properties (min, max, stepSize...)

    In the knob callback, get the array index when in sync mode using the knob value for the label Label.set("text", tempoValues[value]);

Log in to reply