HISE Logo Forum
    • Categories
    • Register
    • Login

    lookup tables

    Scheduled Pinned Locked Moved ScriptNode
    3 Posts 2 Posters 15 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.
    • ulrikU
      ulrik
      last edited by

      If I have some values in 2 arrays like this

      tbl1 = [23, 300, 420, 570, 700];
      tbl2 = [60, 200, 620, 880, 1200];
      

      I also have a knob that has the range 0 -1.

      If I would like to send the values between tbl1[0] and tbl2[0] (23 -> 60) in the knobs callback, I would write:

      sendValue =  tbl1[0] + (tbl2[0] - tbl1[0]) * knob.getValue();
      

      I will always go from tbl1 to tbl2, or vice versa, using the same index
      How can I achieve this inside script node?
      Where do I store the arrays, etc....

      Hise Develop branch
      MacOs 15.3.1, Xcode 16.2
      http://musikboden.se

      ustkU 2 Replies Last reply Reply Quote 0
      • ustkU
        ustk @ulrik
        last edited by ustk

        @ulrik the question is: what's the size of your arrays?

        if not too big (max 128?) you should be able to use slider packs
        Above this, you might consider a third party node to which you send the data arrays with a cable, perform that simple operation in C++ (in the cable callback so you leave the process untouched)
        Then you output the result to a third cable that you grab in the network. for the last part, I haven't done such a thing but it should be possible

        Hise made me an F5 dude, browser just suffers...

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

          @ulrik A small precisions needed:

          • Do you need all resulting values at once or a unique value for a specific index?
          • And are the array values pre-defined or dynamic?

          That would change a bit how you want to handle it...

          Hise made me an F5 dude, browser just suffers...

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

          15

          Online

          2.0k

          Users

          12.8k

          Topics

          111.2k

          Posts