1

I'm using Tone.js to play some soundtrack and I'm strating the Transport at Angular component loading time:

constructor() {
    this.startTransport();
}

private startTransport() {
  Tone.Transport.stop();
  Tone.Transport.start(TRANSPORT_START_DELAY);
}

I observe the constructor is called twice. So I thought about making sure the Transport was stopped before starting it. Should I understand the Transport is to be started once only in the application life cycle ? Anyway, doing a stop before the start didn't help with my issue.

The issue, is that sometimes, when I try to play multiple soundtracks, one after the other, the logger doesn't show up.

track.measures.forEach((measure: Measure) => {
  Tone.Transport.schedule((time: any) => {
    console.log('New track / measure starting at: ' + time);
  }, measureCounter + 'm');
  measureCounter++;
});
Stephane
  • 11,836
  • 25
  • 112
  • 175

0 Answers0