yet more functions implemented

This commit is contained in:
jill 2020-12-31 02:08:31 +03:00
parent 9f52a90d90
commit 7dfb27a121
Signed by: oat
GPG key ID: DD83A9617A252385

View file

@ -39,10 +39,11 @@
+ beatobj:wiggle0([perc], mod) + beatobj:wiggle0([perc], mod)
-beatobj:sharponoff([perc], mod) -- onoff(), but the ease is aligned with the start -beatobj:sharponoff([perc], mod) -- onoff(), but the ease is aligned with the start
- beatobj:sharpwiggle0([perc], mod) - beatobj:sharpwiggle0([perc], mod)
-beatobj:kick([perc], mod) -- does a createReverse() version of the mod, for making kicks +beatobj:kick([perc], mod) -- does a createReverse() version of the mod, for making kicks
- beatobj:reverse([perc], mod) + beatobj:reverse([perc], mod)
-beatobk:velocitymap([perc], mod) -- kick(), but without aligning the ease at 0 +beatobk:velocitymap([perc], mod) -- kick(), but without aligning the ease at 0
-beatobj:temp([perc], mod) -- does a createTemp() version of the mod +beatobk:velocitymapwiggle([perc], mod) -- velocitymap(), but it inverts each time
/beatobj:temp([perc], mod) -- does a createTemp() version of the mod
+beatobj:addm([perc], mod) -- adds a mod value every beat, useful for offsets +beatobj:addm([perc], mod) -- adds a mod value every beat, useful for offsets
-- perc: mod percentage, defaults to 100 -- perc: mod percentage, defaults to 100
-- mod: mod name -- mod: mod name
@ -263,12 +264,85 @@
ease {v[1], len, bounceease, perc, mod} ease {v[1], len, bounceease, perc, mod}
end end
return self
end,
kick = function(self, perc, mod)
if mod == nil then mod = perc; perc = 100 end
local function out(a)
return 1 - ((self._ease(a * 0.5 + 0.5) - 0.5) / 0.5)
end
for _,v in ipairs(self._beats) do
local len = self._length
ease {v[1], len, out, perc, mod}
end
return self
end,
velocitymap = function(self, perc, mod)
if mod == nil then mod = perc; perc = 100 end
local function map(a)
if a < 0.5 then
return self._ease(a / 0.5)
else
return 1 - self._ease(a / 0.5 - 1)
end
end
for _,v in ipairs(self._beats) do
local len = self._length
ease {v[1] - len / (1 / self._align), len, map, perc, mod}
end
return self
end,
velocitymapwiggle = function(self, perc, mod)
if mod == nil then mod = perc; perc = 100 end
local function map(a)
if a < 0.5 then
return self._ease(a / 0.5)
else
return 1 - self._ease(a / 0.5 - 1)
end
end
for i,v in ipairs(self._beats) do
local len = self._length
local off = i%2*2-1
ease {v[1] - len / (1 / self._align), len, map, perc * off, mod}
end
return self
end,
temp = function(self, perc, mod)
if mod == nil then mod = perc; perc = 100 end
local function temp(a)
if a == 1 then return self._ease(0) end
return self._ease(a)
end
for i,v in ipairs(self._beats) do
local len = self._length
ease {v[1] - len / (1 / self._align), len, temp, perc, mod}
end
return self return self
end end
} }
-- aliases -- aliases
beatobjTemplate.wiggle0 = beatobjTemplate.onoff beatobjTemplate.wiggle0 = beatobjTemplate.onoff
beatobjTemplate.reverse = beatobjTemplate.kick
function c2l(start, ending, trunc) function c2l(start, ending, trunc)
local self = copyTable(beatobjTemplate) local self = copyTable(beatobjTemplate)