kinda similar to the existing double function in the reflection lib, there could be a function that increases or decreases the duration by a set amount, like:
--- changes the duration of the current loop
function reflection:mult(mul)
local copy = deep_copy(self.event)
local event_new = {}
for i = 1, self.endpoint do
event_new[math.ceil(i*mul)] = copy[i]
end
self.event = event_new
self.endpoint = math.ceil(self.endpoint * mul)
end
for reference, here's a copy of the existing double function:
--- doubles the current loop
function reflection:double()
local copy = deep_copy(self.event)
for i = 1, self.endpoint do
self.event[self.endpoint + i] = copy[i]
end
self.endpoint = self.endpoint * 2
end
i'd be happy to submit a pull request if there's agreement this would be useful in the lib.
edit: one issue with the suggested approach would be if the length were decreased, data from the original reflection could get munged and lost, so maybe more thought would need to go into the enhancement. a better approach could be to keep a copy of the original event table and always perform the mult on this table and not simply replace it with a new table. (note: a similar approach is used for overdubbing with the event_prev table.)
kinda similar to the existing
doublefunction in thereflectionlib, there could be a function that increases or decreases the duration by a set amount, like:for reference, here's a copy of the existing
doublefunction:i'd be happy to submit a pull request if there's agreement this would be useful in the lib.
edit: one issue with the suggested approach would be if the length were decreased, data from the original reflection could get munged and lost, so maybe more thought would need to go into the enhancement. a better approach could be to keep a copy of the original event table and always perform the
multon this table and not simply replace it with a new table. (note: a similar approach is used for overdubbing with theevent_prevtable.)