HISE Logo Forum
    • Categories
    • Register
    • Login

    getTableValue no longer working properly

    Scheduled Pinned Locked Moved Bug Reports
    5 Posts 2 Posters 341 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.
    • gorangroovesG
      gorangrooves
      last edited by

      An important function of my plugin is not working all of a sudden with the latest HISE. I have a table where you can set the curve to alter the value of a controller.

      onController()
      {
              if(Message.getControllerNumber() == 4)
              {
              Message.setControllerValue(Math.round(1.27 * (MyTable.getTableValue(Message.getControllerValue())*100)));
              }
      }
      

      This used to work seamlessly. Now I get either 0 or 127, depending if the controller is all the way up or down. I checked, and the controller is working perfectly. The script above is no longer working, and it seems that it is not getting the proper value from the table.

      Goran Rista
      https://gorangrooves.com

      Handy Drums and Handy Grooves
      https://library.gorangrooves.com

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @gorangrooves
        last edited by

        I think I've changed the range of the input of getTableValue() to be consistent with other functions so it expects a 0.0 - 1.0 input (instead of the 0...127).

        Does this help:

        onController()
        {
                if(Message.getControllerNumber() == 4)
                {
                Message.setControllerValue(Math.round(1.27 * (MyTable.getTableValue(Message.getControllerValue()/127.0)*100)));
                }
        }
        
        Christoph HartC 1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @Christoph Hart
          last edited by

          And for the love of god please change

          1.27 * 100
          

          to 127 :)

          gorangroovesG 1 Reply Last reply Reply Quote 2
          • gorangroovesG
            gorangrooves @Christoph Hart
            last edited by

            @Christoph-Hart Thanks so much! Yes, dividing the table result by 127.0 fixed the issue.
            I changed the silly "1.27 * 100" after I made the original post. That was actually simplified from the original script (which I didn't write), that had

            local scaler = 127 / 100;
            

            :beaming_face_with_smiling_eyes:

            Another unusual thing. If I write:

            onController()
            {
                    if(Message.getControllerNumber() == 4)
                    {
                    local tv = Message.setControllerValue(Math.round(1.27 * (MyTable.getTableValue(Message.getControllerValue()/127.0)*100)));
                    Console.print("table value: " + tv);
                    }
            }
            

            I get that the "table value: is undefined".

            Why is that? Shouldn't it print the value?

            Goran Rista
            https://gorangrooves.com

            Handy Drums and Handy Grooves
            https://library.gorangrooves.com

            gorangroovesG 1 Reply Last reply Reply Quote 0
            • gorangroovesG
              gorangrooves @gorangrooves
              last edited by

              @Christoph-Hart Nevermind the second part. I figured it out. 😉

              Goran Rista
              https://gorangrooves.com

              Handy Drums and Handy Grooves
              https://library.gorangrooves.com

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

              54

              Online

              1.7k

              Users

              11.7k

              Topics

              102.2k

              Posts