Instrument

Module containing all instrument-specific WebAudioAPI functionality.

Methods

async, static loadInstrument(audioContext, name, url_or_data) → {Promise.<Instrument>}

Loads an existing Instrument object capable of mapping audio data to musical output.

If the url_or_data parameter is set to null, a sine-wave oscillator will be used to generate all audio output.

Parameters:
Name Type Description
audioContext AudioContext

Reference to the global browser AudioContext

name string

Name of the instrument to load

url_or_data string | Array.<Uint8Array> | null

URL pointing to the instrument data to load, the instrument data itself, or null

Returns:
Promise.<Instrument> -

Newly loaded Instrument

See: