Can a device be moved from [2] to #devices (last)?

i’m trying to make it so that i move a device with the display_name “Mono” from [2] to #devices (last), but without wrecking the dsp chain order. should i just give up?

Well, that’s clearly a huge disadvantage of the design of the Renoise API, if you use numeric indices for everything… But that’s another topic.

But you really should study the Renoise API docs a bit more. Please read here. The following method is listed, which will preserve the device settings:

renoise.song().tracks:swap_devices_at(device_index1, device_index2)

With this method, you should be able to do all moving operations, in a quite inconvenient way of course… You swap #2 with #3, then #3 with #4, and so on… Also keep in mind, that you might have to update memorized indices of other devices in the chain, after your movement is complete.

I guess swapping will or at least should also preserve any automation on the device, but I actually cannot remember if this is done or not.

It shouldn’t be too hard to swap them in a loop to until the end like @ffx said or you can get a bit dirty and insert a dummy device at the target position, swap and get rid of it. :smiley:

local t = renoise.song().selected_track
t:insert_device_at("Audio/Effects/Native/Doofer", #t.devices)
t:swap_devices_at(2, #t.devices)
t:delete_device_at(2)
2 Likes

What a nice workaround! Thanks for sharing.

i like your solution the most. i think i’ll use a Gainer, and then delete it. that way it should be minimal enough to work.
will add it to the TODO list since i kinda got sick of trying to do this yesterday.

Cheers! I’d guess an empty Doofer is the most lightweight but I might be wrong and the difference probably doesn’t matter much.

1 Like

got it working pretty nicely. i ended up using a Gainer.
thanks for explaining!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.