You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
please note that my example above would be non-destructive for mul values < 1. If clearing the entries when shortening a loop is required something like this would work (not claiming elegance here. just a proof of concept):
kinda similar to the existing
double
function in thereflection
lib, 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
double
function: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 theevent_prev
table.)The text was updated successfully, but these errors were encountered: