I've been trying to figure out how to observe the player's current time but without luck. I tried the immediate(), now(), and some other time-related API from the documentation.
https://tonejs.github.io/docs/14.7.77/Player.html
And also I tried several properties from the BaseContext. No luck so far.
Basically, I want to build a music player and display the current time played just like a regular music player. This should be possible for any audio library.
Going through some of the github issue posts for tonejs for this, it appears adding this functionality will bring a lot of performance issues.
However, if you are simply wanting to get the amount of time the tone has been playing I don't see why you couldn't just save the start time in a variable and then subtract?
Save the
startTimewhen you call the start method for the tone, then every render update the current time withdisplayTime. It is given in milliseconds, that you could then convert toomm:ss.