Usage
Jitter amount can be absolute (meaning it is independent on the value-being-jittered) or relative (meaning the amount of jitter will depend on input value).
import { jitter } from 'https://unpkg.com/ixfx/dist/modulation.js';
// Jitter by 0.1, regardless of inputconst j = jitter({ absolute: 0.1 });
// Use jitterer with different input valuesj(0); // 0.0..0.1j(0.5); // 0.4..0.6j(1); // 0.9..1.0
Relative jittering:
import { jitter } from 'https://unpkg.com/ixfx/dist/modulation.js';
// Jitter by 10% of the input valueconst j = jitter({ relative: 0.1 });
// Use jitterer with different input valuesj(0); // Always 0j(0.5); // 0.45..0.55j(1); // 0.9..1.0. Will often be 1 because value is clamped