jhohertz / jsSID

A javascript port of classic SID synthesizer emulations, with demonstration player: http://jhohertz.github.io/jsSID
Other
45 stars 12 forks source link

Audible clicking in resid emulation #7

Open ghost opened 4 years ago

ghost commented 4 years ago

Thanks again for the great work.

I've been experimenting and noticed that the resid emulation outputs a noticeable continuous clicking sound. It's most noticeable on 'best' quality. You can hear it in parts of tracks which are quiet or silent, like the start of Azmagutah_6581.sid. It doesn't seem to happen with the other emulators (FastSID, TinySID) and is slightly less noticeable on 'better' or 'good', but still present.

jhohertz commented 4 years ago

Hmmm. I'll try giving it a listen again. It seemed okay on my chrome desktop, but I wasn't listening w/ headphones. I know it's all terrible on the mobile browsers.

I also just want to be frank and say, if I get some time for some of the fun things again, I'll probably look at doing this instead via WebASM, and directly compiling the C sources.

I suspect if there is an issue, it is that there is a lot of places where the original code relied on certain C-isms like how a 32-bit integer rolls over if incremented, and so the javascript conversion has a ton of lame attempts to emulate such things. I have long suspected there is likely some missing (And there is one mode of reSID I have never exposed, because it clearly is doing something wrong in that regard).

It's my hope that a WebASM version of things would avoid most of those issues.

I actually have it mostly compiling, but I am unclear how one uses "libtool" in a WebASM context, and that is where the build is failing.

ghost commented 4 years ago

Thanks for the reply. I'm using a recent Chrome with headphones on my PC. I only noticed this clicking when I started using your code in my own project where there are long "silent" patches, then went back to your original demo again to see if it was there.

WebASM probably makes sense as you said, but I was impressed by your pure JS approach! It sounds very good. Looking forward to seeing your new work at any rate.

You probably know about WebSID which uses emscripten to build from C sources, but I haven't managed to build it yet!

ghost commented 4 years ago

A couple more observations in case they're useful: