Modulation
The Modulation package contains functions and sub-modules for modulating values. That is, for some input value, to shift it in some way. It is a useful technique for adding temporality. These functions can be combined in interesting ways for rich behaviour.
For example, you might use an oscillator to produce a gentle up-and-down wave, and then apply some jitter for a bit of randomness. Or maybe you trigger an envelope which produces values over time. This value could then be used to interpolate from one colour to another.
Module | Description |
---|---|
Easings | Transition between 0..1 non-linearly |
Envelopes | Shape a value over time |
Forces | Simulate natural forces |
Interpolation | Interpolate between values |
Jitter | Jitter a value |
Oscillators | Waveforms |
Springs | Springs |
Importing
Section titled “Importing”// Whole moduleimport * as Modulation from "@ixfx/modulation"
// Single functionimport { jitter } from "@ixfx/modulation"
// One of several modulesimport { Modulation, Flow, Data } from "@ixfx"
// And within your HTML's <HEAD> </HEAD> block:<script type="importmap">{ "imports": { "@ixfx":"/ixfx/index.js", "@ixfx/": "/ixfx/" } }</script>
// Whole moduleimport * as Modulation from "@ixfx/modulation.js"
// Single functionimport { jitter } from "@ixfx/modulation.js"
// One of several modulesimport { Modulation, Flow, Data } from "@ixfx/bundle.js"
// Single module from the bundleimport { Modulation } from "https://unpkg.com/@ixfx/bundle"
// Single moduleimport * as Modulation from "https://unpkg.com/@ixfx/modulation/bundle"
// One of several modulesimport { Modulation, Flow, Data } from "https://unpkg.com/@ixfx/bundle"