HISE Logo Forum
    • Categories
    • Register
    • Login

    Math.round(value * 100);

    Scheduled Pinned Locked Moved General Questions
    11 Posts 4 Posters 560 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.
    • JayJ
      Jay
      last edited by

      Re: label.set value...

      when using this my sliders are not moving like when I'm using [Engine.doubleToString(value * 100, 1);] my slider is just moving from 0 to 100 what can I do to fix it

      thanks in advance

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @Jay
        last edited by

        @Jay we will need a snippet.

        HISE Development for hire.
        www.channelrobot.com

        JayJ 2 Replies Last reply Reply Quote 0
        • JayJ
          Jay @Lindon
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • JayJ
            Jay @Lindon
            last edited by

            @Lindon

            HiseSnippet 1229.3oc0X0raabCDlqsnSz1lfFf9.rvmjKbs0eMs.FEN0x1oBw1Qvx0s2Bn1kRhvbIWrKkqUJxCRt0Gi1K8gnm5wds2xaP6PxUVTNRxRB8GTcvXI47MyvONyvgtUpLjlkISQdEuXXBE48g31CEp9M5SXBTyCQdOFeJISQSCrScvvDRVFMB44s9y0S3Ur.x76c6e.gSDgzwSgPWJYgzSXwL03Ya8rWv37iIQzKXwNRW+YMCkhFRtb.3OqiKiRHgWQ5QOinEaMLxaiihXJYZaEQQy.YNPFMrce42KrxeIKi0gS0CpfZCJxNMpQeFOp0n8ZFB4Un03c951c9GiOkEwtc9wLvGYVHXLBWNvas44RUVBWxywkJXcomfaGlxRTiWQ6Oe.to.NP5R.p10UrxhV64afaHAIDpchIWQONEFbKhROsb4sCf+r0d99.cmoBtljFbBoCkWI3KCFgrGU0PFmHEvfRaZWdS.ycfTc9PpNEH0lOjZSAR84CotFhOSvYBZP2AhPESJBjhzuUKqPkJ4kBGgYaPs7Azs7+A+c2sHWFR3AWC5+HQO.9NQxAvw0Ex1pTlnWIiraGTcq8B1c2fp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ote 0
            • d.healeyD
              d.healey @Jay
              last edited by

              @Jay What do you want it to do?

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              JayJ 1 Reply Last reply Reply Quote 0
              • JayJ
                Jay @d.healey
                last edited by

                @d-healey Change the parameter of the slider

                because as you can see, it update it when using the "Engine.doubleToString"

                d.healeyD ustkU 2 Replies Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Jay
                  last edited by

                  @Jay Set the knob mode to normalized percentage.

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

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

                    @Jay I think you are mixing things.
                    The slider callback reacts to the slider changes, and executes what's inside.
                    In your case, it shapes the value, and sets it to the label.
                    So calling a label.changed() here is of no use, because no callback is associated. component.changed() method is used to execute the callback of this very component from the script. But here your labels don't have callbacks, they are just passive components waiting for their values to update (not to change anything themselves).

                    In this snippet, either doubleToString or Math.round are working as expected when you comment/uncomment one or the other. Nothing troubling here, they are just doing it differently (value*100 in the Math.round() case, which could be done in doubleToString too).

                    Let me guess, do you intend to update the slider from typing a value in the label?
                    If this is the case, then you'll need a callback for the label too, so it can set and update the slider value.
                    In such a system, each callback is setting the other component.

                    Another point is that you are doing the same thing multiple times, which is a call for optimisation (one unique function for all sliders, and one for all labels in the eventuality they need to update the sliders of course...). But this will come later because...

                    ... Because I just realised there's a reverb module that isn't connected to anything. So I imagine this is what you want to do in the end, right?
                    There are two possible options for setting modules parameter.

                    • Connect the slider to the module parameter directly from within the PropertyEditor (no scripting required)
                    • Or declare the module in the script and write the different actions in each slider callbacks (myDeclaredModule.setAttribute(thisOrThatAttribute, value))

                    Please give us more info about what is it you are trying to achieve so we can guide you.

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

                    1 Reply Last reply Reply Quote 1
                    • d.healeyD
                      d.healey
                      last edited by

                      The label is assigned to processor ID/parameter ID. So calling .changed does trigger a change to the reverb.

                      @Jay Instead of calling changed, just set the value directly in the knob's callback.

                      HiseSnippet 1508.3oc2XEzSabDEdVfEhWRhJR4TUOrkSKUofswMsRnJbhARsBPrvDRykhV1cr8TVOi0tiIwIBodnG5odqRMGpT+ET0q8FpmajpT+Cj9On8WP6a1YW1wNqMFiIUEe.w7l2adeuu4Mu2LaEelCNHf4izxramVXj100q1gxaTpgMghJuFR6l5aYGvw9lRQ2qSK6f.rKRSax6KDnkYJT3u+Z06Y6YScvIhPn8XDG7ljlDdhzJEe.wyaCaW7tjlJZWnXYGFsDyi0Fvyj5YQsrcNztNdaagZSnizldcWBm4WkaywAHsotGysS0FrmRk5uGIfbfGVLHGpJrPRwav7bEHVHEUpAwysRbbGffUoRBKLojEtk9VDWxoxSXi2IbByDKT4CsI5FdS1E7xoBurJvKEHoo.oojPZN8pN9jV7jYD3YV8xTXyolMP6pPQpKZhucZ8RLPCJewl1Gh2vGFbpEV2Ia1aaB+YgULL.pOfadjsu4dX+CL+Tyv7fEqi4qWqF1gaMuP97cq5l1Gf8xAJG6DP8RrlsXTXf07xoE1ziI4GrI4SwjkGrIKmhIEFrIEBCFB0iPwl0ZSc3DF0jQ8erPWJ2m4Y4Daysgk0qMdAiWXjYok7XN1dlGAq+5z5f4K5xZC6r6xpx8Iz5Vg5day7Krh4RKYl2zkTmvCLxXjIwxsrA50m0l5JU27CLyEtUjwvD9A1Ef4l7FXSN9YbSVsv+2Sf7PEjj6hfRVyKzXd.hf0hoB+iX6RL6c4.lNnMGaEJABtMwGg8hCnULNdEizYIAQL+Bh0HhNJY64c.blzpKRJcVzYGa3+FHONxr3RKMT734gHymJQFMkSCaZcrq0fHKY71O5pK1neocDWnv6+WHrk6Ogs7PQXx3s+4WJrQeHrpjmi+OkuNGzUg9SWEFN5RDs8ksTnBXQTHosYb7CoVgzgwwFl8NUsZoNWzZ4g8ScZQia+AYnEscyCv9paFBEgtYc2hTu+sHU6f6HoDEEYzxTB+gsvz90WGEwihN7QnBTkG1L8lQMSq5Qbw9HBzybZcQIMTHdUuTCZHr8Z5xy28ZcDHNSqkI6il0ynGt4mhwOp7Z1bawsIhXBfcZg84DAwqsF9H3pYx6VjQeMbvgbVK.LmlxAKszo2HxogIqQHV17A8rDGtVwNIC9hhsh2IJGxshVOv047gaxAW9PHyPOtSDRbn.REzbkg7P6+7p9ud29WtlSqmcwrv8HOKv.DfcyVPIgyk+WVw+eE+h3+YzkY.mGuWP06GeQ7tg9NLVyvrHU.neVmUTX+xJ9u3WVrIw00CWgEPDkERT60qp5foN6CTIt3j5c6hgcghNakrP+LeTVn3iY8gyEqyadmc30BL21d17teBg3cSQSHXG06sKtaNEXsNpkfFauqXXg3b5UHbmFoiwIRAiPQlKCLF8ZranKeBRB.mReiO+svSuhdSLjNPZ1xCuCTsBN6H.PzwHUHb5YHEVItphhnSq5orAulemdjA5El1pHXCeL94XXOI1C+3Ke4urp1jCcfmav79Nr1b.qvsc7IPVt91saVEdItCFncJE6I5VqMgnBsbbVwXAvphotgC9G3Wzj4Di0hlLW7juU7QSaGe19NxNmhczqEJAhaZ32QHi9Vhwl4haYpKJShfRVj8cbD4VeHbchzsI+HXyxifMEFAa9nQvl6LB17wifMex.sQ7IUtaaNqorVCR65IW+DoMq5.csY5tDg5G.IzWkot3mEmL.mJ7U9xSO4j0otcclpsm2aniPXO5U8P7SEi+t2atEV4umsXnOgPRH6E25mt+e97ud0Semc3mppLEpUvkUFPCHbLFegySJNbgySJFGNw0eFegyrWfvAgTg4I6mV3H2x5Qu3v42+s28We8hiyv4yFagy27GCW3.5EGN246K89u5Gd0XLbJe0JbdvUqvYyqVgyVWsJTu8Xa2AJ3NT6NfdWdEp28BDNVcu6XkVxl0at6XcI124QWsZit2EIYqmyNoVJHkyNWzvYqJqG98lzzVmZCO4PJ8eI87+hL
                      

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      ustkU JayJ 2 Replies Last reply Reply Quote 1
                      • ustkU
                        ustk @d.healey
                        last edited by

                        @d-healey Oh I haven't seen this one coming! :)

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

                        1 Reply Last reply Reply Quote 0
                        • JayJ
                          Jay @d.healey
                          last edited by Jay

                          @d-healey Thanks David, that did it, and like @ustk said I mixed things up. And in the snipped I provided it did work using doubleToString

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

                          28

                          Online

                          1.8k

                          Users

                          12.0k

                          Topics

                          104.6k

                          Posts