g200kg / webaudio-tinysynth

Light-weight GM mapped WebAudio-JavaScript Synthesizer Engine / MIDI Player
Apache License 2.0
229 stars 22 forks source link

Problem with the sound #22

Open gashello opened 3 years ago

gashello commented 3 years ago

Hello! I really like your lib, but I'm struggling with a problem and still can't figure out how to solve it Sometimes I hear some scratchy sound... Can you watch my bug-report video and give me some feedback, please ) video

I've been sent to you by JZZ author: https://github.com/jazz-soft/JZZ/discussions/52

g200kg commented 3 years ago

Hello, I watched the video of your problem.

I think it's a touch event handling issue that the keys aren't released when you press multiple keys.

If you're writing touch event handling yourself, you'll need to investigate what happens when End-of-Touch. Or if you're using the https://github.com/jazz-soft/JZZ-input-Kbd library, Jazz-soft may need to investigate.

The next sound distortion problem is related to the above-mentioned key-holding problem, so if it can be solved, I think this problem will be solved naturally.

Since it is not possible to detect that the key has been released, the sound sources will accumulate excessively, and the sound will begin to distort when the signal amplitude limit is exceeded. Or sound glitches occur when the sound source accumulates too much and the load on the CPU rises.