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?
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
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
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?
--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?
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.
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