Control utilities for Hydra visual synthesizer
Hydra LFO » Functions » async « source: src/components/async.js
async(f, r, d)
async({f, r, d})
The provided function is run with a frequency of r
per time unit. All parameters are based on the current time
and bpm
,
assuming time
is in beats. Timing is not guaranteed, so f
might drift
over time.
Internally async is implemented using setTimeout with all implications regarding execution context.
f
: Function to execute. Default is () => {}
r
: Run frequency of the function. A value of 0
or less will
result in the function being called only once. Default is 1
d
: Delay before first run. Default is 0
The unaltered input value.
const x = {v: 3};
shape(
L.async(() => x.v = ((x.v + 1 ) % 5) + 3)
.set(() => x.v)
).out(o0);
Other functions in Asynchronous functions:
Other categories:
Asynchronous functions - General Hydra LFO utility functions - Generator functions - Math related functions - Modifier functions - Time functions -
All functions reference on one page