Class: Instrument

Highcharts. Instrument

new Instrument(options)

The Instrument class. Instrument objects represent an instrument capable of playing a certain pitch for a specified duration.

Parameters:
Name Type Description
options Highcharts.InstrumentOptionsObject

Options for the instrument instance.

Requires:
  • module:modules/sonification
Try it

Requires

  • module:modules/sonification

Methods

copy( [options])

Return a copy of an instrument. Only one instrument instance can play at a time, so use this to get a new copy of the instrument that can play alongside it. The new instrument copy will receive a new ID unless one is supplied in options.

Parameters:
Name Type Argument Description
options Highcharts.InstrumentOptionsObject <optional>

Options to merge in for the copy.

Returns:
Highcharts.Instrument .

A new Instrument instance with the same options.

mute()

Mute an instrument that is playing. If the instrument is not currently playing, this function does nothing.

play(options)

Play the instrument according to options.

Parameters:
Name Type Description
options Highcharts.InstrumentPlayOptionsObject

Options for the playback of the instrument.

Try it

stop(immediately, onStopped, callbackData)

Stop the instrument playing.

Parameters:
Name Type Description
immediately boolean

Whether to do the stop immediately or fade out.

onStopped function

Callback function to be called when the stop is completed.

callbackData *

Data to send to the onEnd callback functions.