Instrument
constructor.
Path to the instrument directory.
Get the buffer for this pitch and velocity, if it exists.
Pitch of the note.
Velocity of the note.
Loads instrument configuration from an instrument.json
file in the base
URL directory. Does not load any of the samples.
Load samples necessary to play a set of pitch/velocity pairs. This must be called before any notes can be played.
Array of pitch/velocity pairs.
Play a note using one of the samples.
Pitch of the note.
Velocity of the note.
Time at which to start playing the note.
Length of the note in seconds.
Output AudioNode
.
Strike a note down using one of the samples. If you call this twice without calling playNoteUp() in between, it will implicitly release the note before striking it the second time.
Pitch of the note.
Velocity of the note.
Output AudioNode
.
Release a note using one of the samples. If you call this twice without calling playNoteDown() in between, it will not implicitly call playNoteDown() for you, and the second call will have no noticeable effect.
Pitch of the note.
Velocity of the note.
Output AudioNode
.
Generated using TypeDoc
Sampled instrument. Must be initialized and samples must be pre-loaded using the
loadSamples
method before any notes can be played.