How to activate the automation of a parameter?
I use this function to copy the automation of the previous track in the selected track:
function clone_track( song, spi, sti, pta, max_pta )
song = renoise.song()
spi = song.selected_pattern_index
sti = song.selected_track_index
max_pta = #song.patterns[spi].tracks[sti].automation
for i = 1, max_pta do
--print("i", song.patterns[spi].tracks[sti - 1].automation[i] )
--song.patterns[spi].tracks[sti].automation[i] = song.patterns[spi].tracks[sti]:find_automation( i )
--print ( song.tracks[sti].devices[1].parameters[1].is_automatable )
--song.patterns[spi].tracks[sti]:create_automation(1)
--song.tracks[sti].devices[1].parameters[1].is_automatable = true
song.patterns[spi].tracks[sti].automation[i]:copy_from( song.patterns[spi].tracks[sti -1].automation[i] )
end
end
But before the line:
song.patterns[spi].tracks[sti].automation[i]:copy_from( song.patterns[spi].tracks[sti -1].automation[i] )
I need to enable the parameter for automation. If the parameter is not activated, this line not work!.
For example, in device 1, are three parameters: “Panning”, “Volume” “Width”.I need to check if the parameters of the previous track are active, to activate the same parameters of the selected track.
Something like that: song.tracks[sti].devices[1].parameters[1].enable orsong.tracks[sti].devices[1].parameters[1] = true ???Then would volume parameter activated, the curve would have an initial point, at least.
What is the exact code to activate a particular parameter?