Wholesale change automation from points to linear

So I’ve recorded some multi parameter automation for a whole track in one take, but as it defaulted to Points, I would like to change all the recorded automation to Linear. As far as I can tell, it is not possible to change this all in one go, as multiple patterns can’t be selected. I have 6 parameters and as you can probably imagine, that’s a lot of faff to change to Linear.

Is there a simple way to do this (without re-recording it), or does it need to be done with a tool?

cheers

does it need to be done with a tool?

Can be achieved with a bit of scripting.

I prepared this snippet for you, which can be run through the scripting console:

Click to view contents

– Set all envelopes in song to the specified PLAYMODE
– (applies to the selected automation parameter…)

do

–renoise.PatternTrackAutomation.PLAYMODE_POINTS
–renoise.PatternTrackAutomation.PLAYMODE_LINEAR
–renoise.PatternTrackAutomation.PLAYMODE_CUBIC
local playmode = renoise.PatternTrackAutomation.PLAYMODE_LINEAR
local rns = renoise.song()
local prm = rns.selected_automation_parameter
if not prm then
print(“No parameter selected”)
return
end

local trk_idx = rns.selected_track_index
for seq_idx,patt_idx in ipairs(rns.sequencer.pattern_sequence) do
local patt = rns.patterns[patt_idx]
local ptrk = patt:track(trk_idx)
local pauto = ptrk:find_automation(prm)
if pauto then
pauto.playmode = playmode
end
end
end

It’s simple enough:

1.Enable scripting tools

  1. Open the terminal (Tools > Scripting Terminal & Editor)

  2. Create a new document (File > New)

  3. Paste the code above

  4. Click “Execute”

Ah nice, thanks for this.

I suspected a bit of scripting would put this right, especially after I was perusing the api docs last night. I keep meaning to make a tool, so perhaps this looks like a nice candidate :slight_smile:

cheers

I tried to get this working in 3.1.1 by pasting the code to the script editor and executing while having an automation parameter selected but it stays in Points mode. Is there some other step that needs to be done not explained in the instructions?

oops wrong topic

script

Doesn’t that need formatting a bit better?

--renoise.PatternTrackAutomation.PLAYMODE_POINTS
--renoise.PatternTrackAutomation.PLAYMODE_LINEAR
--renoise.PatternTrackAutomation.PLAYMODE_CUBIC

local playmode = renoise.PatternTrackAutomation.PLAYMODE_LINEAR
local rns = renoise.song()
local prm = rns.selected_automation_parameter
if not prm then
  print("No parameter selected")
  return
end

local trk_idx = rns.selected_track_index
for seq_idx,patt_idx in ipairs(rns.sequencer.pattern_sequence) do
  local patt = rns.patterns[patt_idx]
  local ptrk = patt:track(trk_idx)
  local pauto = ptrk:find_automation(prm)
  if pauto then
    pauto.playmode = playmode
  end
end

Thanks. I tried with that script but still no effect. Wonder if I’m doing something wrong… So basically as shown in the screenshot, when I click “Execute”, should it immediately change the parameter selected in the lower left corner from points to linear?

What exactly do you have in your file?

P.S. Seems to work here. It changes the ‘points’ in a selected automation to linear. So at the moment all I can say is that there isn’t a big syntax error (or not an obvious one) in that snippet that danoise wrote.

script

This is what I have there now, and in this situation I click “Execute” but nothing happens.

I don’t know much anything about the scripting so I probably just do something wrong…

I assumed that the lines with – are for commenting so I left them out

Yes the ‘–’ are for lua commenting (danoise put them in probably for reference.)

Could you copy and paste that what you have in AutomationtoLinear.lua file into that file called TestPad.lua? Make sure there is only comments (other than what you are pasting of course) in the TestPad.lua file. Then try executing from TestPad.lua.

Thank you so much, it works now! I think the problem was that I had placed the original .lua file under “User Scripts/Tools”. When I placed it under “User Scripts” and not under “Tools”, it started working

1 Like

Correct :slight_smile:

Now just to learn how to make a tool out of that with a working keyboard shortcut :smiley:

You’ll be fine jugger. @Raul I believe is good with tools and creating keyboard shortcuts :slight_smile:

I made a tool for this; well it changes all automation in a track to one of a kind.

I can clean it up and upload it, as it may be a good starting point for you?

Boonier that would be great, thanks! I basically always use linear over point automation so the more the tool changes at one go the better :slight_smile:

com.boonier.AutomationType.xrnx (7.4 KB)

ok, it’s a bit rough, but have a go with this :slight_smile:

It works really well! Thanks again

you’re welcome m8