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