mirror of
https://github.com/nucular/sfxrlua.git
synced 2024-12-05 11:34:21 +00:00
Don't reset volume at Sound.resetParameters(); Reset the parameters before Sound.randomize()
This commit is contained in:
parent
6a932ec970
commit
e674b0761c
7
sfxr.lua
7
sfxr.lua
@ -98,6 +98,9 @@ function sfxr.Sound:__init()
|
|||||||
self.phaserBuffer = {}
|
self.phaserBuffer = {}
|
||||||
self.noiseBuffer = {}
|
self.noiseBuffer = {}
|
||||||
|
|
||||||
|
self.volume.master = 0.5
|
||||||
|
self.volume.sound = 0.5
|
||||||
|
|
||||||
self:resetParameters()
|
self:resetParameters()
|
||||||
self:resetBuffers()
|
self:resetBuffers()
|
||||||
end
|
end
|
||||||
@ -108,9 +111,6 @@ function sfxr.Sound:resetParameters()
|
|||||||
self.waveType = sfxr.SQUARE
|
self.waveType = sfxr.SQUARE
|
||||||
self.superSamples = 8
|
self.superSamples = 8
|
||||||
|
|
||||||
self.volume.master = 0.5
|
|
||||||
self.volume.sound = 0.5
|
|
||||||
|
|
||||||
self.envelope.attack = 0.0
|
self.envelope.attack = 0.0
|
||||||
self.envelope.sustain = 0.3
|
self.envelope.sustain = 0.3
|
||||||
self.envelope.punch = 0.0
|
self.envelope.punch = 0.0
|
||||||
@ -458,6 +458,7 @@ end
|
|||||||
|
|
||||||
function sfxr.Sound:randomize(seed)
|
function sfxr.Sound:randomize(seed)
|
||||||
if seed then setseed(seed) end
|
if seed then setseed(seed) end
|
||||||
|
self:resetParameters()
|
||||||
self.repeatSpeed = random(1, 2)
|
self.repeatSpeed = random(1, 2)
|
||||||
|
|
||||||
if maybe() then
|
if maybe() then
|
||||||
|
Loading…
Reference in New Issue
Block a user