[solved] how to remove a effect via lua?

hi, i’d like to use lua scripting to remove an effect from a track.
how would i go about doing this, please?

Well, of course. “Delete” instead of “Remove”…

Hi Joule. Thanks much!
I did get it to work, at least somehow. (would be nicer if the line-input device was removed right when recording ends, instead of immediately when record-stop sign is said and pattern is still playing till the end.
not sure how to go about making line-in get removed then…

renoise.tool():add_keybinding {name="Global:Paketti:Record to Current Track+plus",   
invoke = function()   
local howmany = table.count(renoise.song().selected_track.devices)  
if howmany == 1 then   
loadnative("Audio/Effects/Native/#Line Input")  
if renoise.song().selected_track.devices[2].name=="#Line Input" then  
else return  

Not sure what you are trying to do.

Since your code is even more horrible than mine usually is, let me advice you that ‘#renoise.song().selected_track.devices’ is prettier to use than table.count. # returns the amount of elements in an array.

Questions I ask myself… Why check if there is only one device in the track? Why make a check on its name?

because if i access devices[2].name==this that, i get a error and a nil error from the terminal. that’s why i gotta check first if there’s nothing but the trackvolpan there. if there’ sjust 1 there, then i know the linein isn’t in there.