hi there!
i’m attempting to make some kind of automation of the loop points in the sampler.
so far, i’ve gotten this:
quit = false
multiplier = renoise.song().instruments[1].samples[1].sample_buffer.number_of_frames
function amount() return renoise.song().tracks[1].devices[2].parameters[4].value end
while quit == false do
if [buttonpressed] then quit=true end -- havent made the gui yet ![:)](https://files.renoise.com/forum/emoticons/default/smile.gif)
if amount() >= 0.0001 then
renoise.song().instruments[1].samples[1].loop_end = amount() * multiplier
else
renoise.song().instruments[1].samples[1].loop_end = 1
end
end
this grabs the value of an amplification slider of an lfo (which is itself controlled by another lfo, workaround for a free automatable slider ),
mutliplies it by an multiplier defined by the samples length, so it wont get out of bounds, and feeds it into the loop end point position.
now, this script doesnt work, its obvious.
The problem is here, that if i have a script running it just goes through - hardcore mode.
now if i had the possibility to tell it, do it one time, then return to whatever the host was doing, and then, maybe after 10ms, return to the loop,
it could work, as its not hogging the cpu.
i know this could be done by “coroutine.yield()” and “coroutine.resume()”, but the problem is, i only know how to get to another lua “thread” and then back again.
that doesnt help much. i would have to return to the host, and then somehow, trigger a resume from it.
another approach i tried was creating a dialog with a slider, linked to the looppoint. but i havent got a clue on how to link this slider to something else to automate it (lfo or so)
anybody got an idea, or suggestion on how to achieve this? or is it even impossible to do so?
or maybe a completely different approach?
thanks ahead