Optional
callback: ToneEventCallback<ValueType>The callback to invoke with the event.
Optional
values: ValueType[]The values to arpeggiate over.
Optional
pattern: PatternNameThe name of the pattern
Optional
options: Partial<PatternOptions<ValueType>>The callback to be invoked at a regular interval
Optional
value: ValueTypeReadonly
contextThe context belonging to the node.
Set this debug flag to log all events that happen in this class.
Readonly
nameStatic
versionThe version number semver
The number of seconds of 1 processing block (128 samples)
console.log(Tone.Destination.blockTime);
Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.
The current index of the pattern.
The number of iterations of the loop. The default value is Infinity
(loop forever).
Muting the Loop means that no callbacks are invoked.
The pattern type.
The playback rate of the loop. The normal playback rate is 1 (no change).
A playbackRate
of 2 would be twice as fast.
The probably of the callback being invoked.
The progress of the loop as a value between 0-1. 0, when the loop is stopped or done iterating.
The duration in seconds of one sample.
The state of the Loop, either started or stopped.
Get the object's attributes.
const osc = new Tone.Oscillator();
console.log(osc.get());
Set multiple properties at once with an object.
const filter = new Tone.Filter().toDestination();
// set values using an object
filter.set({
frequency: "C6",
type: "highpass"
});
const player = new Tone.Player("https://tonejs.github.io/audio/berklee/Analogsynth_octaves_highmid.mp3").connect(filter);
player.autostart = true;
Convert the incoming time to seconds. This is calculated against the current TransportClass bpm
const gain = new Tone.Gain();
setInterval(() => console.log(gain.toSeconds("4n")), 100);
// ramp the tempo to 60 bpm over 30 seconds
Tone.getTransport().bpm.rampTo(60, 30);
Static
get
Pattern arpeggiates between the given notes in a number of patterns.
Example