Hey hey,
I'm simply trying to read/calculate an interpolated value. I want to "rescale" a 0-1 input to a succession of 1/25, 1/12.5 and 1. So I created a table:
iValueTab = ftgenonce(0, 0, 4, 2, .04, .08, 1, 1)
No I can scan through that with an index between 0 and .5. This is all rather unintuitive:
kIndex = line:k(0, p3, .5)
kValue = tablei:k(kIndex, iValueTab, 1)
I thought an index of at least 0-.75 would do the trick, but after index values of .5 the output is 1.
Is there a more intuitive/numerically meaningful way to solve this issue?
yeah interesting --- i tried it and i see your point.
i found two possible solutions.
the first avoids to reach 1, in normalized reading.
the second
- adds one value to the table, and
- multiplies the normalized index by the last raw index (here 2)
for me this second solution looks better.
but perhaps best is to put the three values in an array and write a UDO for linear interpolation?
best -
j
Hi Joachim,
thanks for your solutions. I think I'd prefer the first solution, but it's good to have the choice. Many thanks for investigating and chiming in!