Skip to content

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 input
const j = jitter({ absolute: 0.1 });
// Use jitterer with different input values
j(0); // 0.0..0.1
j(0.5); // 0.4..0.6
j(1); // 0.9..1.0

Relative jittering:

import { jitter } from 'https://unpkg.com/ixfx/dist/modulation.js';
// Jitter by 10% of the input value
const j = jitter({ relative: 0.1 });
// Use jitterer with different input values
j(0); // Always 0
j(0.5); // 0.45..0.55
j(1); // 0.9..1.0. Will often be 1 because value is clamped