Archive: Interpolation scheme


14th October 2003 05:05 UTC

Interpolation scheme
I discovered a nice interpolation scheme. It allows you to switch between one of N targets smoothly.

First, the interpolation values:
i1=1;i2=0;i3=0;i4=0;

We're starting with the first shape, i1 = 1, the rest is 0.

The result from 4 sources v1-v4 is:
v = v1*i1 + v2*i2 + v3*i3 + v4*i4;

To modify the interpolation values, we define a shape to morph towards. For example on beat:
tgt=rand(4);

We can then evaluate per frame:
i1=i1*.9+equal(tgt,0)*.1;
i2=i2*.9+equal(tgt,1)*.1;
i3=i3*.9+equal(tgt,2)*.1;
i4=i4*.9+equal(tgt,3)*.1;

The interpolation values i1-i4 change to reflect a new intermediate position, but always sum to 1. The result v will always be in the range between the highest and lowest v1-v4 value.

The attached spreadsheet shows an example situation where it targets different values.

This method of defininig i1-i4 is fast and extendable...


14th October 2003 06:33 UTC

like my morpher, just logarithmic instead of linear...
and a lot faster :(


14th October 2003 07:01 UTC

Looks nice. Now for a good example...


14th October 2003 08:43 UTC

UnConeD's is half logarithmic, half linear. In that the linear coefficient is logarithmic :igor:


14th October 2003 09:21 UTC

argh.. zev.. dont confuse me so when im drunk...

That was the prolly the most confusing sentance ive ever encountered. XS

I like the idea tho ucd.

A while ago i was trying to come up with some smooth targetting ideas. I cant seem to find the final product tho.. but it was really only an extended linear targetting plot. Much much simpler than yours.


14th October 2003 19:24 UTC

you should include a preset to show us what it does exactly....


15th October 2003 14:29 UTC

yeah an example preset would be nice especially for people like us who are weak at maths :rolleyes:


15th October 2003 21:26 UTC

I have used interpolation like that to make a variable in the frame section smoothly change to a value from the beat section.


Frame:
v1=v1*0.9+v1c*0.1;

Beat:
v1c=rand(100)/100;


But I never saw that used in the way you did, to morph between different codes.

15th October 2003 22:54 UTC

skupers: isn't that a onbeat code from one of the ssc examples... bouncing vertical scope or something to the tune of that?


15th October 2003 22:56 UTC

Lol I use that old trick all the time skupers... I just realized that if you use 4 of them, always target 1 with one value and 0 with the rest, that it would always stay 1 summed.


15th October 2003 23:12 UTC

so can you post an example preset that uses this?