The metronome which the recorder uses for tracking passed beats.
The MIDI input which data gets recorded from.
How many beats to stop the clip recording after.
This also sets the duration of the clip that will be returned at the end of the recording.
The default value is 4. If this is set to null, then the recorder will only stop when explicitly told, and the returned clip's length will be however long the recorder ended up running for.
How many beats have passed since recording started.
This event fires when the clip recorder finishes.
Returns true if the clip recorder has finished recording.
The metronome which the recorder uses for tracking passed beats.
The newClip event dispatches a new clip object once recording has completed.
This example will create a ClipRecorder that records a 16 beat phrase. Once done, the phrase is automatically played back on loop:
const clipRecorder = new ClipRecorder(metronome, midiIn);
clipRecorer.beatCount = 16;
clipRecorder.newClip.add(evt => {
const clipPlayer = new ClipPlayer(evt.clip, metronome, midiOut);
clock.addChild(clipPlayer);
});
clock.addChild(clipRecorder);
Provides a way of identifying recorders so they can be easily retrieved later.
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 ClipRecorder(metronome, midiIn).withRef('recorder'));
The calling object.
The ref to set on the object.
Generated using TypeDoc
The ClipRecorder class subscribes to an IMidiIn and records incoming MIDI data into a clip.
Once the ClipRecorder has finished, a new clip is dispatched from the newClip event.