How to let renoise breathe

Hello,
How do I ensure that Renoise can rest between long calculations, restore the gui, etc.?
is there anything in the API? Any interruptions?
Or will lua coroutines help?

local result = 3
while result ~= 0.0001 do
      -- here comes renoise rest function
      result = loooong_run()
end

thanks

Look into the standard tools pack, I think “com.renoise.ExampleToolSlicedProcess.xrnx” contains an example of how to do background processing, look into “process_slicer.lua”

1 Like

Thanks.

Nice solution,
but how should I wait for the end of the process ?
Maybe i’m overworked but this is a Catch-22 for me right now.
I need wait for result.

local process = ProcessSlicer(long_calc)
process:start()
-- here wait for result from long_calc
-- don't leave until result is known
while process:running() do
    -- Catch-22 here
end

I think there is no way to yield a thread waiting for such a thing to finish. How you would want to solve it probably depends on how you built your program. If it is a tool that gets triggered somehow to do a job, maybe it would be a good idea to split the processing, into prepare (what gets triggered by ui or key combo), and that starts the slicer, then when your sliced function has finished, it could just call the code that is needed to finish the job after the calculations. No expert on this, maybe someone else knows more about it.

anyway thanks for pointing me in the right direction

1 Like