nucular / sfxrlua

A port of the sfxr sound effect synthesizer to Lua
http://nucular.github.io/sfxrlua/
MIT License
97 stars 11 forks source link

Fix sound (issues #1, #2, #3, #4) #12

Closed jorio closed 10 years ago

jorio commented 10 years ago

I combed through the code, compared with the reference implementation, and corrected some small mistakes. I believe sfxrlua now sounds pretty much identical to vanilla sfxr, except for the volume level. You can test this with my other patch to read binary sfxr files.

jorio commented 10 years ago

By the way, I came across this in reset():

-- subtract 0.017 to match the pitch of the original
fperiod = 100 / ((self.frequency.start - 0.017)^2 + 0.001)

That 0.017 actually seemed to have an adverse effect. Since I couldn't find out how you came up with this number, I removed it; it seems to work fine without it, and the pitch doesn't sound like it's different from the original.

nucular commented 10 years ago

Thanks for your help! The 0.017 is a result of plain experimentation.