From 69015be97e87661edb2fba3918679c491b23c33c Mon Sep 17 00:00:00 2001 From: nucular Date: Thu, 29 May 2014 16:05:17 +0200 Subject: [PATCH] Subtract a bit from the base frequency to match the pitch of the original, Fixes #6 --- sfxr.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sfxr.lua b/sfxr.lua index 924e287..300a6d2 100644 --- a/sfxr.lua +++ b/sfxr.lua @@ -168,7 +168,8 @@ function sfxr.Sound:generate(freq, bits) local chg_mod, chg_time, chg_limit 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) period = trunc(fperiod)