HISE Logo Forum
    • Categories
    • Register
    • Login

    show 2 value in 1 label

    Scheduled Pinned Locked Moved General Questions
    2 Posts 2 Posters 167 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yall
      last edited by

      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?

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @yall
        last edited by ustk

        @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]);

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        49

        Online

        1.7k

        Users

        11.7k

        Topics

        101.8k

        Posts