Copy Device Chain Of Track


I would like to copy the complete device chain from one track to another with Lua. Somehow I can’t find a hint in the documentation.
Is it possible?

The reason is I want to clone a track including all it’s values and settings (track-notes in pattern and device chain).

Yes, something likes this would be nice to have in the API. I could also need this for my “Split into separate tracks” tool.


Pattern Editor -> right click menu -> Duplicate Track [CTRL+D] / Duplicate Track (incl. Patterns) [CTRL+Shift+D]

Thanks but the question was how to do this with lua ;)

idk lua that well, but perhaps you could make lua do the following:

  • write/save the device chain first
  • clone the track including patterns
  • load the newly made chain on it

in theory this works very well ^_^

i know not very helpful… but perhaps someone knows how to translate those steps into code, which was your question… ;x


ps, i have no idea if the lua api already supports loading of chains?

I want this function as well.

I have looked at beatslaughters mixer snapshots plugin and he seems to paste a device by inserting it (which there is a function for) and then setting all values with a loop. It would be cool if it was possible to insert xml data directly.

Make a library for this? Tedious work… :)

I’m not inserting any devices at all but work with existing devices only. Snapshots.lua contains all the necessary stuff to copy the values to another track and could be used in your projects. The file contains several classes managing lists working down in levels sort of: Snapshots (snapshot list) -> Snapshot (track list) -> Track (devices list) -> Device (parameter list). Any of those classes have own insert and restore functions, so in theory the snapshots tool is prepared to even restore single tracks and devices out of several snapshots already. Each class doesn’t depend on it’s parent, but it’s child. All you need to do is strip the file down a bit from unneccessary code, snapshots class isn’t needed to manage snapshots, notifiers and option stuff can be thrown out, ignored track and device classes too.