Produces values according to rough spring physics.
import { continuously } from"https://unpkg.com/ixfx/dist/flow.js" import { spring } from"https://unpkg.com/ixfx/dist/modulation.js"
consts = spring();
continuously(() => { constresult = s.next(); if (result.done) returnfalse; // Exit loop constvalue = result.value; // Value is mostly within 0..1 range but will exceed these limits }, 10).start();
Produces values according to rough spring physics.
Parameters to the spring can be provided.
If you don't want to use a generator: springValue.
Note that the generated value can exceed 0..1 range. This is by design, since a spring can 'overshoot'. See Data.Normalise for functions to normalise.