Hydra LFO

Control utilities for Hydra visual synthesizer


Project maintained by oscons Hosted on GitHub Pages — Theme by mattgraham

Hydra LFO » Functions » async «  source: src/components/async.js

async - Asynchronously execute a function

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.

Parameters

Returns

The unaltered input value.

Examples

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


Hydra LFO » Functions » async