News for hackers. Stuff that matters.
Re:Show HN: Scale Heaven – Browse and play any scale/chord, ... by re on Thursday October 03, 2019 @10:13PM (#21154235)
> Sometimes the audio lags out a lot. I know it's probably impossible to get low latency audio via Web Audio API

The Web Audio API lets you trade off how far in advance you schedule things -- so if you want to be able to react to events faster, you can use a smaller buffer, but if you want to ensure that things don't lag out, you can use a larger one. There's a good overview here: https://www.html5rocks.com/en/tutorials/audio/scheduling/

The only issue with the audio that I noticed is that when playing the progression with the metronome, the metronome timing seemed fairly uneven and also tended to come in slightly before the piano sound. I didn't notice any timing issues with the piano alone though -- are they scheduled using different mechanisms?

Re:Show HN: Scale Heaven – Browse and play any scale/chord, ... by seanitzel on Friday October 04, 2019 @06:36AM (#21156368)
I'll look into it, thank you.

And weird, they are scheduled using exactly the same mechanism.