Requires that a reference to the toneJS library be passed in as a parameter, for example:
import * as Tone from 'tone';
new ToneJSMidiOut(Tone);
The collection of channels that MIDI data can be sent out to. Each channel that's being used should hold a reference to a ToneJS instrument object.
This event fires when the clip player finishes.
Returns true if the clip player has finished playing its clip.
Provides a way of identifying a clip player so that it can be easily retrieved later.
A reference to the ToneJS library.
Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.
Adds a new note to ToneJSMidiOut's collection, returning the note that was added.
Note, if the ToneJSMidiOut has not set anything for the channel which the note is targetting, then no action will be performed.
If note.on == true
, then the ToneJS Instrument for the corresponding channel is immediately instructed to triggerAttack.
The note that was added
The note to add to the ToneJSMidiOut.
This method accepts an IMidiMessage object, which it converts to a MIDI byte array to send to the connected MIDI port.
The IMidiMessage object to be converted and sent out.
Sets up a target destination against a particular channel number, which MIDI messages with the corresponding number will be sent to.
Example:
const midiOut = new ToneJSMidiOut(Tone);
midiOut.setChannel(0, new Tone.Synth().toDestination());
The channel number to be set up. Valid values range from 0 to 15.
The ToneJS instrument object which will MIDI messages will ultimately end up affecting.
Calls the stop() method of all notes which have been added to the MidiOut that meet the passed in criteria.
Provides a way for setting the ref through a chained function call. For example:
clock.addChild(new ClipPlayer(clip, metronome, midiOut).withRef('player'));
The calling object.
The ref to set on the object.
Generated using TypeDoc
The ToneJSMidiOut implements the IMidiOut, and provides an integration with the ToneJS javascript library. This allows for MIDI data coming from shimi to control sound generation in the browser by ToneJS.