Annoying Midi Lag

The audio sounds fine at first but when many keys are being played at the same time, the notes become very delayed and do not play exactly when the midi signal is sent. They all get delayed and played together after about .5 of a second (I’m playing on a midi keyboard and chrome 83.0.4103.116). For instance, sites like work perfectly for me, but this site has substantial lag. It’s especially obvious when you deliberately spam as many notes as possible-- at first it seems normal, then nothing plays and then everything at once happens after I’ve stopped inputting. Hopefully you fix this as it’s impossible for me to actually use this site unless playing feels crisp.

Note: When lag occurs through midi, the visual notes are also delayed.
Note 2: Also, I tried playing through asdfghjkl and the audio is actually fine and not laggy, but the visuals are laggy like the midi looks. strange.

Thanks @nixon4ever for the thorough report on this. That is super annoying and is actually something I can recreate.

This is all related to CPU usage and something I’ve spent a lot of time trying to reduce – you’ll see this mentioned in other threads.

I’m working on adding the recording feature right now and it looks like one of the changes has resulted in a regression for general performance.

I’ll ping you when I have the change up and hopefully you can test it for me.

Thanks for your patience and taking the time to write this up, I’m listening.

@nixon4ever can you check out the performance now and tell me what you think? I made a changelog release for this and some other changes.