Ge Wangfixed typo780f7bf4 years agoHistory
39 lines · 911 B · Text
RawDownload
// name: interpolate.ck// desc: using vec3 as a non-linear, slewing interpolator//       this is quite useful to making a percentage progress//       towards a goal, in an amount proportional to the slew//       and some delta time // connectSinOsc foo => dac; // the interpolatorvec3 i;// the interpolation rate10::ms => dur irate;// set initial .value, .goal, .slewi.set( 440, 440, .05 * (second/irate) ); // spork interpolate functionspork ~ interpolate( irate ); // main shred sets the goalwhile( true ){    // set interpolator goal    i.update( Math.random2f(200,1000) );    // every so often    500::ms => now;} // function to drive interpolator(s) concurrentlyfun void interpolate( dur delta ){    while( true )    {        // interpolate (can also get new value via .value)        i.interp( delta ) => foo.freq;        // advance time by rate        delta => now;    }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t