mirror of
https://github.com/nucular/sfxrlua.git
synced 2024-12-24 18:44:20 +00:00
Subtract a bit from the base frequency to match the pitch of the original, Fixes #6
This commit is contained in:
parent
d8b03912c0
commit
69015be97e
3
sfxr.lua
3
sfxr.lua
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user