-
Notifications
You must be signed in to change notification settings - Fork 173
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
Inconsistent Audio Output #678
Comments
This sounds like phase shenaningans (google phase cancellation), and the difference in audio when running the same cart would be because the phase of the channels aren't always consistent. The reason the differences happens is likely because rendering updates, meaning calls to I'm not an emulator developer, but here are some fixes I can think of and what I think their downsides are. The simplest fix for this particular case of variance would be to reset the phase to 0 every time a Another (albeit more difficult) fix would be to rewrite the audio engine's oscillators to go based on sample number for phase rather than having a separate Final solution is to make |
This is basically a natural product of combining two waves with the same frequency. It's pretty much what I'd expect from real 8-bit audio hardware (as someone with no real experience of it), so I don't think we should consider this a bug. The "parametric phase" idea is okay, except that it would necessarily introduce shorter periods at the start of a tone. Maybe that wouldn't matter, maybe it would, but it seems kinda weird. That said, I'm going to make a pull request soon that will probably change this behaviour to be much more consistent, at least when two tone()s are called in the same tick. |
On my machine WASM-4 produces inconsistent audio output.
Simple example cart:
About 1 in 3 times when loading (or reloading) this cart it plays completely different audio.
I can reproduce this issue in firefox and linux native. I have not tried other runtimes.
Audio Sample (linux native):
wasm4-audio-issue.mp4
I'm not sure what's going on here. Especially the middle note seems affected. Sometimes the distortion is subtle and sometimes it's very noticable, with a bit of randomness.
Pre-built Cart + HTML + Linux Binary:
binary.zip
WASM4 Version:
yesterday's master + my unrelated patches from #677 (history)
The text was updated successfully, but these errors were encountered: