Creates a wave modulator by name.
Defaults to 5-second sine wave.
import { wave } from '@ixfx/modulation.js';// Triangle wave that has a single cycle over two secondsconst m = wave({ secs: 2, shape: `triangle`});// Call m() to get current value of wave, eg in// an animation loopconst v = m(); Copy
import { wave } from '@ixfx/modulation.js';// Triangle wave that has a single cycle over two secondsconst m = wave({ secs: 2, shape: `triangle`});// Call m() to get current value of wave, eg in// an animation loopconst v = m();
import { wave } from '@ixfx/modulation.js';import { resolveFields } from '@ixfx/data.js';const state = { intensity: wave({secs: 2, shape: `sine` }), someOtherState: 10}const use = async () { const { intensity } = await resolveFields(state); // Do something with intensity value...} Copy
import { wave } from '@ixfx/modulation.js';import { resolveFields } from '@ixfx/data.js';const state = { intensity: wave({secs: 2, shape: `sine` }), someOtherState: 10}const use = async () { const { intensity } = await resolveFields(state); // Do something with intensity value...}
Creates a wave modulator by name.
Defaults to 5-second sine wave.