Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.51k stars 983 forks source link

Cannot schedule player instances in transport (React) #1278

Open botoxparty opened 1 month ago

botoxparty commented 1 month ago

Hey,

I'm not sure why I can't get this to work, have spent hours on this and can't seem to get it to work correctly.

I'm creating a DAW and trying to get the basics of the transport setup. It is just not playing anything.

Here's a link to the codesandbox with a minimal example

botoxparty commented 1 month ago

So i have updated the example, it seems that the Transport is somehow linked to the time the page is loaded, and adds this amount of time to the scheduling.

e.g.

Page loads.

10 seconds later the user presses "Start"

The Transport schedule everything +10 seconds.

cordial commented 1 month ago

Tone.js requires a user interaction to start and the transport time will start at this point (which is different to the audio context time, which will start on page load).