Automation - things to improve

Thanks for the code, I’ll check it the next days. I downloaded the lua stuff today and started reading.

Indeed I think it’s better to keep Renoise basic and offer the possibility to write (or let write :wink: ) your own tools instead of packing everything into Renoise.

It is not possible to put everything under the hood of Renoise. It would be real madness. I think that taktik is doing things very well, not exceeding the limits. There is a whole world of possibilities with the API available and LUA. Most people who use Renoise and do not know how to program with this code are missing many things.
However, far from what some claim, Renoise can still improve a lot, in many details…

Thanks, just tested it and it works. :clown_face: I’ll start with simpler things first.

If you only need to change all of the automation playmodes and do nothing else with the song, then I would definitely recommend trying a simpler approach instead.

Consider the following:

-- Function to do something awesome to all the automation in the song.
local function change_automation_playmode(mode)

  -- For each pattern in the song...
  for pat_idx, pat in ipairs(renoise.song().patterns) do

    -- For each pattern track...
    for trk_idx, pat_trk in ipairs(pat.tracks) do

      -- For each automation in the pattern track...
      for auto_idx, auto in ipairs(pat_trk.automation) do

        -- Do the awesome thing!
        auto.playmode = mode

      end
    end
  end
end
1 Like

Thank you for this!

Just to clarify … The function that I have built takes 4.00 ms in a basic test, while the @dblue function takes 1.00 ms in the same test. It is considerably faster. Here we have two ways of doing the same (iterate), and logically the fastest is always better. The dblue function is much more direct.

It will surely make a difference when there are many more patterns, tracks and devices to automate.

It is very good to have the 2 functions in the same thread to be able to compare. In this way, it is a pleasure to do programming.

@dblue. What envelope do you use in the text to make the code appear colored?
In the forums, couldn’t a button for this be added? Or am I missing something? I thought Preformated Text would do the job.

Is there something like [lua] code [/lua] or something like that?

For sure. When you have a moderate amount of devices or plugins loaded in the song — plugins that may have hundreds of parameters — the performance impact becomes quite obvious.

Calling find_automation() over and over and over again, hundreds or thousands of times each loop… it gets very heavy very quickly :slight_smile:

[code] blablabla [/code]

:joy: Ok, It seems so obvious! Does this envelope somehow detect the type of code to return the format?