new SonificationInstrument(audioContext, outputNode, options)
The SonificationInstrument class. This class represents an instrument with mapping capabilities. The instrument wraps a SynthPatch object, and extends it with functionality such as panning, tremolo, and global low/highpass filters.
Parameters:
Name | Type | Description |
---|---|---|
audioContext |
AudioContext | The AudioContext to use. |
outputNode |
AudioNode | The destination node to connect to. |
options |
Highcharts.SonificationInstrumentOptionsObject | Configuration for the instrument. |
Requires:
- module:modules/sonification
Try it
Requires
- module:modules/sonification
Methods
-
cancel()
-
Cancel currently playing sounds and any scheduled actions.
-
destroy()
-
Stop instrument and destroy it, cleaning up used resources.
-
musicalNoteToFrequency(note)
-
Convert a note value to a frequency.
Parameters:
Name Type Description note
string | number Note to convert. Can be a string 'c0' to 'b8' or a number of semitones from c0.
Returns:
number .The converted frequency
-
scheduleEventAtTime(time, params)
-
Schedule an instrument event at a given time offset, whether it is playing a note or changing the parameters of the instrument.
Parameters:
Name Type Description time
number Time is given in seconds, where 0 is now.
params
Highcharts.SonificationInstrumentScheduledEventOptionsObject Parameters for the instrument event.
-
setMasterVolume(volume)
-
Set the overall volume.
Parameters:
Name Type Description volume
number The volume to set, from 0 to 1.
-
silenceAtTime(time)
-
Schedule silencing the instrument at a given time offset.
Parameters:
Name Type Description time
number Time is given in seconds, where 0 is now.