Multiple players playing simultaneously
See original GitHub issueIt is currently not possible to have multiple players playing (or even paused) simultaneously because they are implemented using Tone.Transport
(see #403, #418). This leads to the following problems:
- To avoid a bad user experience (playback won’t start if a different player is already playing), one has to keep track of the currently playing player to stop it when needed (as in html-midi-player).
- A paused player still prevents other players from playing. For this reason I don’t use the pause feature at all, but then I can only seek when the player is playing. In any case, you can seek at most one player at a time, which is clumsy.
- It also prevents other code from using
Tone.Transport
.
@tambien suggested using Clock
instead of Transport
, but that would basically mean re-implementing a Transport
. So I think the best would be to just instantiate one Transport
for each player. Is something preventing that?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Simultaneous exhibition - Wikipedia
A simultaneous exhibition or simultaneous display is a board game exhibition (commonly chess or Go) in which one player plays multiple games at...
Read more >Is it possible to have multiple player instances play at the ...
Is it possible to have multiple player instances play at the same time. Yes, this is possible, provided there are enough bandwidth and...
Read more >12 Free Online Games You Can Play With Friends Anywhere
No sign-up necessary · A maximum of two players · Players play simultaneously · Play with friends online, but on the same PC ......
Read more >How to Play 2 to 4 Players on Same TV in MultiVersus (Split ...
Do you want to know how to play 2 to 4 players on the Same TV in MultiVersus for split screen or local...
Read more >How to Play Local Multiplayer in MultiVersus (2-4 Players)
Do you want to know how to play local multiplayer in Multiversus with 2 to 4 players on the same tv or monitor...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s not hard to imagine that there will be more than one player on the page, see e.g. my interpolation demo or the html-midi-player demo. I don’t need them playing simultaneously. But the user will try to fiddle with multiple players at the same time and expect some reasonable behavior (ideally the same as with the
audio
element). I’m OK with my workaround for the first issue (stop the current player before starting another one). For the second issue (seeking while stopped), the workaround would require adding an offset parameter tostart()
.By that I didn’t mean actually writing a new implementation of
Transport
. I just meant implementing the scheduling of notes directly usingClock
as @tambien suggested earlier, rather than usingTransport
(which also uses aClock
internally). I think it shouldn’t be too hard.I didn’t have that in mind, but that would be awesome too. In my application, I just disable the instrument checkboxes while playing (which is OK as a workaround, but can be a bit annoying).
I think I want to push back a little and understand why you need several players so i can give you a qorkaround – is it to turn on and off some instruments? in that case, we can just make some utility methods that concatenate these note sequences into the one “played” one. The complicated part here will be to dynamically add notes to it, but even switching the part that a player is using shouldn’t be thaaaat bad.
I’m not sure I understand why just stopping the Part is bad or won’t work. Reimplementing Transport/Part is almost definitely not what we want to do (whatever problems Tone has we will eventually have, only then we can’t look to @tambien to fix it 😅), so using whatever Tone is giving us is crucial imo