[SOLVED] Idea: Replacement For Duplicate Track

this comes from a very simple workflow issue:

  1. you’re playing sounds in a track with dsp efx. it sounds real nice. you already have other sounds playing on the track. playback is on.
  2. you want to make a copy of the track cos the dspchain is off the chain, and you really like your new riff thing.
  3. you reach for the CMD-D to duplicate the track.
  4. It duplicates the track.
    ------------------------///-------------------------------
    but while the track has been duplicated, the selected_track_index hasn’t changed to the new clone!

so you can’t just jam, stuff with a track, and then “select-duplicate” after “duplicate current track”.

a replacement which does allow for exactly that, would be real swell.

can’t you just move over to the new track you made?

nope, that’s two shortcuts - this could be only 1.

I don’t know what is the problem here, but i can perfectly script behavior to jump to the track that has been added to the pattern:

  
--[[============================================================================  
main.lua  
============================================================================]]--  
  
-- Reload the script whenever this file is saved.   
-- Additionally, execute the attached function.  
_AUTO_RELOAD_DEBUG = function()  
  
end  
  
-- Read from the manifest.xml file.  
class "RenoiseScriptingTool" (renoise.Document.DocumentNode)  
 function RenoiseScriptingTool:__init()   
 renoise.Document.DocumentNode.__init(self)   
 self:add_property("Name", "Untitled Tool")  
 self:add_property("Id", "Unknown Id")  
 end  
  
local manifest = RenoiseScriptingTool()  
local ok,err = manifest:load_from("manifest.xml")  
local tool_name = manifest:property("Name").value  
local tool_id = manifest:property("Id").value  
local tracktable={}  
  
--------------------------------------------------------------------------------  
-- Main functions  
--------------------------------------------------------------------------------  
  
local function testing()  
 local newtrack = -1  
 local i = -1  
  
 for i = 1, #renoise.song().tracks do  
 local match = false  
 for _ = 1, #tracktable do  
  
 if renoise.song().tracks[i].name == tracktable[_] then  
 match = true  
 break  
 end  
 end  
  
 if match == false then  
 newtrack = i  
 break  
 end  
 end  
 if newtrack ~= -1 then  
 renoise.song().selected_track_index = newtrack  
 end  
 tracktable={}  
 for _ = 1, #renoise.song().tracks do  
 tracktable[_] = renoise.song().tracks[_].name  
 end  
end  
  
-- This example function is called from the GUI below.  
-- It will return a random string. The GUI function displays   
-- that string in a dialog.  
local function set_track_notifier()  
 tracktable={}  
 for _ = 1, #renoise.song().tracks do  
 tracktable[_] = renoise.song().tracks[_].name  
 end  
 renoise.song().tracks_observable:add_notifier(testing)  
end  
  
  
--------------------------------------------------------------------------------  
-- Menu entries  
--------------------------------------------------------------------------------  
  
renoise.tool():add_menu_entry {  
 name = "Main Menu:Tools:"..tool_name.."...",  
 invoke = set_track_notifier   
}  
  

is there even a function for cloning a track? (pattern data isn’t cloned, just track dsps). Some sort of a copy?

Nopes, you all have to do this using the insert device function and then copy all parameter options from the source-device in the other track.
Afterwards you can use the :copyfrom() function to copy automation.

Well, see what happens with CMD-D in Mixer. You are in Track1, press CMD-D, You are in Track2, which is a duplicate/clone of Track1. With the same TrackDSP. that’s pretty neat.
I’ve taken to just doing duplication on the mixer view, since can’t figure out how to do the duplication in the pattern editor.

1 Like

Screenshot 2024-07-04 at 17.03.03

i don’t know how it’s possible but it seems that over the past 4 years, duplicate track on pattern editor has changed to duplicate + select the track.