HISE Logo Forum
    • Categories
    • Register
    • Login

    How to change value of a LAF slider?

    Scheduled Pinned Locked Moved General Questions
    4 Posts 3 Posters 297 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.
    • andrei sA
      andrei s
      last edited by

      Hello!

      I made a GUI slider with LAF that uses value numbers from -100 to 0 dB.
      I need it to show values from 0 to 100 without decimals.

      What i need:
      Снимок экрана 2022-10-26 в 13.40.01.png

      If i use obj.value + 100; the slider value shows decimals:
      Снимок экрана 2022-10-26 в 13.39.47.png

      If i use obj.valueAsText; the value shows from -100 to 0:Снимок экрана 2022-10-26 в 13.41.24.png

      Other way is to set slider value properties from 0 to 100 dB and then decrease it -100 dB in script panel, but it scares me because if somehow decreasing won't work it could damage the user ears and monitors. Or it's a good solution?

      How can i change text value or delete decimal numbers in slider value?

      LindonL orangeO 2 Replies Last reply Reply Quote 0
      • LindonL
        Lindon @andrei s
        last edited by

        @problema post a snippet with your LAF in it

        HISE Development for hire.
        www.channelrobot.com

        1 Reply Last reply Reply Quote 0
        • orangeO
          orange @andrei s
          last edited by orange

          @problema You can use Math.round(obj.value) It will round the decimal value to the integer value.

          develop Branch / XCode 13.1
          macOS Monterey / M1 Max

          andrei sA 1 Reply Last reply Reply Quote 2
          • andrei sA
            andrei s @orange
            last edited by

            @orange this is exactly what I need. Thank you!

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

            32

            Online

            1.7k

            Users

            11.7k

            Topics

            102.0k

            Posts