Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First note is clipped #24

Open
elikmiller opened this issue Jan 26, 2021 · 1 comment
Open

First note is clipped #24

elikmiller opened this issue Jan 26, 2021 · 1 comment

Comments

@elikmiller
Copy link

After starting the metronome, the first note is always clipped and generates a click.

It is easier to tell when the metronome is set to quarter notes or slowed to a low tempo.

@nmcgann
Copy link

nmcgann commented Jan 30, 2021

I appear to have fixed this by adding a short fixed delay (0.1 seconds) to nextNoteTime in the play() function. (immediately after nextNoteTime = audioContext.currentTime;) This worked in my Windows desktop browsers, I haven't tested on Mac/mobile.

My theory was that the initial start-up has extra variable time overhead and this was lost from the note duration, so delaying the start would allow for this overhead.

I'm not sure this is correct though, hopefully the original author will chip in with a correct solution and explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants