Subtract a bit from the base frequency to match the pitch of the original, Fixes #6

This commit is contained in:
nucular 2014-05-29 16:05:17 +02:00
parent d8b03912c0
commit 69015be97e

View File

@ -168,7 +168,8 @@ function sfxr.Sound:generate(freq, bits)
local chg_mod, chg_time, chg_limit local chg_mod, chg_time, chg_limit
local function reset() local function reset()
fperiod = 100 / ((self.frequency.start - 0.025)^2 + 0.001) -- subtract 0.017 to match the pitch of the original
fperiod = 100 / ((self.frequency.start - 0.017)^2 + 0.001)
maxperiod = 100 / (self.frequency.min^2 + 0.001) maxperiod = 100 / (self.frequency.min^2 + 0.001)
period = trunc(fperiod) period = trunc(fperiod)