The clip to play.
The metronome which the player uses for tracking passed beats.
The IMidiOut which MIDI data generated from the clip gets sent to.
How many beats should have passed before the clip player stops. The default value is null, meaning the ClipPlayer never stops, and continually loops playback of the clip.
How many beats have passed since the clip player started.
Which channel to play the clip on. Valid values range from 0 - 15.
The default value is 0.
This event fires when the clip player finishes.
Returns true if the clip player has finished playing its clip.
The metronome which the player uses for tracking passed beats.
If set to true, then no events of any kind will be dispatched by the player. All existing notes will be stopped
If set to true, then no new bend events will be dispatched by the player
If set to true, then no control change events will be dispatched by the player
If set to true, then no new notes will be generated by the player, and all existing ones will be stopped
Allows attaching custom logic to modify each note produced by the clip player. The provided function should accept a note as its only parameter. For example:
clipPlayer.noteModifier = (note) => {
note.pitch += 12;
note.velocity = 40 + Math.floor(Math.random() * 40);
};
Provides a way of identifying a clip player so that it can be easily retrieved later.
If not running, then the player won't do anything with each update cycle. This allows a way to temporarily pause playback of the clip, without having to remove it from the clock.
By default this is set to true.
How many beats in the clip to play for every beat that passes in actual time. For example: 1.5 means the clip is played 1.5 times faster than it would normally.
Which beat of the clip to start playing from. This allows for a clip player to begin playing a clip from half-way through for example.
Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.
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 ClipPlayer facilitates the playing of a clip.
The ClipPlayer should be added to a clock to receive regular updates. It should hold a reference to a metronome for beat timings. It should hold a reference to a MIDI Out for it to send MIDI data to. And it should hold a reference to a clip, which it will play.