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

Audio glitches when dragging mouse #4

Open
PeterNerlich opened this issue Mar 1, 2021 · 2 comments
Open

Audio glitches when dragging mouse #4

PeterNerlich opened this issue Mar 1, 2021 · 2 comments

Comments

@PeterNerlich
Copy link

I'm coming straight from the YT video and haven't even tried the program yet. Ignore this should it not apply any longer, though I'd be surprised if this is the case.

When dragging the mouse over different areas to see hear how the tone progressively changes small pops occur. I propose the theory that this is happening because when the location changes, the tone is sampled and played from the first iteration on, making the distance to the previous point (and thus the amplitude change imposed on the speakers) significantly larger than the previous and subsequent point pairs.

I propose to instead search ahead a few iterations on every location change and try to find a sufficiently close point to the would-be successor from the original series of points. Since we work with cyclic series and this is only intended for minute changes of a few pixels at worst, I suspect this might work out just fine. "sufficiently close" could be something like within half the distance between the last played sample and its would-be successor of the original series.

@jwosty
Copy link

jwosty commented Mar 2, 2021

A simpler solution could be to crossfade between the old point and the new point with a really small fade time; even a few milliseconds would do the trick. It would get rid of all those pops.

@PeterNerlich
Copy link
Author

Yes, that would work, too. Though I expect audio engineers or other people with trained ears to notice an irregularity through that when continually dragging the more to explore the changes. But there's a good chance that's just my unreflected perfectionism speaking 😁

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