HISE Logo Forum
    • Categories
    • Register
    • Login

    lookup tables

    Scheduled Pinned Locked Moved ScriptNode
    9 Posts 2 Posters 78 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...

        ulrikU 1 Reply Last reply Reply Quote 1
        • 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...

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

            @ustk said in lookup tables:

            @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

            It's 2 arrays with 15 values in each and 2 other arrays with 5 values in each, so not so big
            So I'll test with slider packs then

            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)

            So it's not possible to do the operations in script node?

            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 Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

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

              @ustk said in lookup tables:

              @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...

              I need all calculated values at once

              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 said in lookup tables:

                I need all calculated values at once

                Here's your biggest problem. In script node you'll be able to get them one by one depending on the index value of a slider pack, not re-write an entire slider pack as output of the two. (Unless I'm not aware or smart enough to find a workaround)

                Is the weighting knob changing at a modulation rate or just from a user UI knob? If it's the second then you might consider doing the computation in the UI script and just set one slider pack data connected to your network. Otherwise -> third party node, maybe...

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

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

                  @ulrik and what about this?
                  you can use two pack8_writer

                  zrg.gif

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

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

                    @ustk Yes that's a nice way, however I would like to have everything inside script node, because I will make a hardcoded fx and use it in a FX slot, and it would make a lot of scripting to connect it to slider packs as well as all other knobs in the UI when inserted.
                    But if that is the best way I will go that path...

                    I will think some more on this and decide later.
                    Thank you for feedback, it's much appreciated!

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

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

                      @ulrik The solution I've posted above is entirely inside scriptnode. However a pack_writer is limited to 8 sliders... Can you go with two of them?

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

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

                      23

                      Online

                      2.0k

                      Users

                      12.8k

                      Topics

                      111.3k

                      Posts