-
Notifications
You must be signed in to change notification settings - Fork 983
Accurate Timing
Yotam Mann edited this page Oct 13, 2021
·
1 revision
Tone.js uses the Web Audio API for sample-accurate scheduling. If you are experience loose timing, double check that you are passing in the scheduled time the Transport provides into the event that you are scheduling:
Transport.schedule(() => {
player.start();
}, 0);
Transport.schedule((time) => {
player.start(time);
}, 0);
This is similarly true for all of the event classes like Part, Sequence, Loop, Pattern, etc.
new Part((time, event) => {
synth.triggerAttackRelease(event.note, event.duration);
}, events);
new Part((time, event) => {
synth.triggerAttackRelease(event.note, event.duration, time);
}, events);
footer