tickModulator allows you to reset and check for completion.
Alternatively, use ticks which is a simple function that just returns a value.
Example: Tick-based modulator
import { tickModulator } from"https://unpkg.com/ixfx/dist/modulation.js"; constfn = (t) => { // 't' will be values 0..1 based on completion returnMath.random() * t; } constt = tickModulator(fn, 1000); // Will take 1000 ticks to complete t.compute(); // Each call to `compute` progresses the tick count t.reset(); // Reset to 0 t.isDone; // _True_ if finished
Creates an modulator based on ticks.
tickModulator
allows you to reset and check for completion. Alternatively, use ticks which is a simple function that just returns a value.Example: Tick-based modulator