Trying to understand how in Tone.js a sequences' progress and state is checked i.e. how far through the sequence has occurred and whether the sequence is currently playing or stopped. This is so I can trigger an event on completion. Tone.sequence has both progress and state properties but each seem to always return zero. Here is what I have:
var synth = new Tone.FMSynth();
var notesarray = [{note: "B2", duration: "16n"}, {note: "B3", duration: "16n"}, {note: "A2", duration: "16n"}, {note: "G2", duration: "16n"}, {note: "B4", duration: "16n"}];
// Create a tone sequence
var seq = new Tone.Sequence((1, note) => {
// note, duration, time, velocity (this will control the volume)
synth.triggerAttackRelease(note.note, note.duration, 1, 0.10);
// *** Am I misunderstanding how these should be used? ***
console.log(seq.state);
console.log(seq.progress);
// subdivisions are given as subarrays
}, notesarray).start(0);
Sequence.progress returns a normalized value if the sequence is looped, if not it is 0. I found this in old docs of Release 11. The current docs doesn't say anything about it, but the behaviour is the same today.