Copy Playlists or Regions with intact time position between projects

HI,
I need to copy playlists or edited regions from one project to another project. I would rather not turn them into audio exports so was hoping i could get the track contents (audio/midi files) intact.

Anyone have a good workflow to copy playlists or regions (with their correct time position) from one project to another?
I used this a while back and it worked but recently I have not been able to copy

I have used the lua scripts here but for some reason they will not work (even tried changing the tmp file location figuring there could be permissions issue). The python script in the below seems to corrupt the xml file in ardour 8.12.

Export / Import Regions Between Different Sessions / Projects

Any thoughts on how to copy playlists or regions from one project to another with correct time positions with either the above workflow or any other ideas?

Thank you.

2 Likes

O___O

I’ve been working on-and-off for literally weeks on making and debugging a standalone Lua script that will do just this.
-So, good timing! :+1:

I’ll post it in the coming days. So how soon do you need it? :grin:
(-Free for everyone of course.)

It only works for mono or stereo audio regions though…
(Midi is different, and requires a different approach…)
So is most of what you want to copy and paste just plain audio?..

I made it copy and paste original:

  • Positions
  • Lengths
  • Envelope
  • Region Gain
  • Fade lengths
  • you name it…

-All with basically ZERO redundant imports/embeds in the process. (-Which was a major annoyance with others’, previous attempts…)

Long story short, but I too, REALLY wanted this functionality for a project I’m working on…
So I just went ahead and began making it!

I’ll keep you posted.

-J

3 Likes

Ghosts,
Thank you and glad you are working on this.
Tremendous news.
Yes Audio is my focus as I have a lot of different sessions with lots of different edits that I would just like to import into larger sessions so having the parameters you are working on would really be great.

I am looking for it whenever possible.
Yes please let me know once you have a working lua.

Very appreciative.

1 Like

Hey I saw your other lua script impressive. If you want me to test out your lua script for copy playlists, let me know.

That other one (from early April) sucks. I suggest not using it.
-Why? Because with each region you paste it re-imports/re-embeds the used source. o_o

That was literally the #1 reason why I wanted to make another version. -To prevent that from happening.

Let me see what I can do…
Maybe you alone can be my beta-tester, haha.

I’ll polish-up some stuff tonight, and maybe send it your-way early so you can get going on your work. :+1: :question:

Alright, this should get you started:
AudioClipboard(BETAv1,0).lua

Just download and drop that .lua file into your “scripts” folder as described here (-check the “Managing Scripts” portion).

Now, I don’t know what your level of knowledge of Ardour is, but here’s more specificity: In the DAW, now go to Edit → Lua Scripts → Script Manager → click “Action 1” (or some other) → Add/Set → Refresh → Shortcut… -and find “Audio Clipboard (BETA v1,0)” in the drop-down menu → then click Add. ~You should now have a shortcut button in the top-right that will allow you to use it with easier-access! (~You could have also just clicked an empty shortcut button (top-right) and skipped a lot of these steps. :grin:)


Also, what version of Ardour are you using? 8.12.0? -Because I made it using that, so I can’t guarantee it’ll immediately work on anything earlier. For example in 8.4.0, Ardour apparently lacked one binding I was using. (I was able to just do without it though in like 30sec, which was :ok_hand:.)

But anyway, all other tests (on my macOS Mojave machine as well as in a Ubuntu Studio VM) seemed to work well! …I’m still working-out some bugs though, etc… -So if you encounter anything unusual, please let me know! -Feedback of any kind is definitely welcome and appreciated! :+1:

~Cheers!
-J

[PS: Go to “View Instructions, Etc.” to get a basic understanding how to use it. The rest should be pretty straight-forward, and hopefully not crash Ardour along the way… O____O]

1 Like

Ghosts.
I am extremely appreciative. I have been doing the template track import and tried a bunch of other scripts. Unfortunately, most times these other methods are just too time consuming to fill in the blanks or caused some xml errors. I just downloaded it and will try it today.

Yes, I am running Ardour 8.12 Linux Ubuntu Studio build. I will test it out on a session and get back to you.

Many thanks and speak soon.

1 Like

Yeah, well you can already erase the one you downloaded and download it again, haha.
(I just changed the link…)

I realized I had one tiny but annoying bug that prevented someone from accurately copying and pasting out-of and into the same snapshot :expressionless: (-which of course is utterly pointless beyond merely testing the script’s capabilities, and perhaps to compare pastes to original regions, side-by-side, to be sure that they’re the same).

-Just FYI!
:v:

1 Like

I tested the first and had a problem.

Downloading again. Testing second now.

Thank you again and provide feedback shortly.

Screenshot_20250528_174405
Unfortunately getting
So i went into target project. Highlighted a few regions on one track and click Step 1 but got this 0 audio regions copied successfully as seen in shot. I tested this on other tracks too and get the same 0 audio regions copied.
AudioClipboard.tsv is in the tmp directory with 391B which I am guessing is low unless it is just a redirect.
Going to Step 2 also confirms this as it responds with “Nothing is copied”
I am using 8.12 Ardour, Ubuntu, 24.04. I am not sure if there could be a permissions issue or if it is DAW related.

Hmm.
Weird, and I’m sorry about that… : /

Yeah, 391B is exactly what an empty AudioClipboard looks like (-just with its ‘header’):

I cannot immediately think of why this would happen…
But I will try to solve it tomorrow!

Any more details/screenshots of the regions you’ve got selected/etc. are very helpful!

Thanks for your patience!
-J

1 Like

Thank you very much.
So I checked two theories:
Dont think it is Ubuntu protection issue or permission after doing research.

interesting enough, i just opened a brand new session and recorded a file to check the permissions issue. i ran script and the file appears to have copied successfully.

(upload://145sFu01k0I4CpaBOH2PtOXEquS.png)

Then I realized that the track had Combined regions in Ardour which causes the lua script to fail and state 0 copies successful.

I retested this in a new session where i combined two regions and it appears that Combining Regions will trip up the lua script.

I will continue to experiment but this is indeed going to be a great tool.

1 Like

Ha… @_____@

This is both a relief, and funny.
After all this time working on this script, I had literally no idea about:

  1. Playlists. (-Even though you mentioned this word several times already, and I was literally told about it here.)

  2. Combined-regions. :warning:


Utilizing either just never really fit-in to my workflow I guess… goddam Ardour is complicated, haha…

Now, as for the former (Playlists), my script should handle regions from them just fine. What it won’t do, however, is generate the same playlist name in ‘Session B’ (-the session/snapshot you’re pasting into). It only copies selected regions. And thus if you have multiple playlists assigned to a track that you would like to transfer over, you would have to copy and paste one playlist, then go back into Session A and switch to the next playlist, select those regions and copy those, then paste those into Session B into a new playlist over there, and so on… Out of curiosity, how many playlists per track are you dealing with on average?..

As for Combined regions, yes, they are clearly an issue that I’m currently working to address. The goal here (for the code) should be to recognize when a region is of a combined/compound type, log that understanding, copy all the standard info. of the individual regions that make up the combined/compound region, then recombine those regions when you paste. This is 100% achievable IF I can probe combined regions for what regions they consist of.


In the meantime, as a workaround, you can always simply “Uncombine” combined ones like so:

And then copy them:

-And then after you paste them, simply select the ones you want to have combined, and re-combine them.

I will work on this…
-J


EDIT: Also, how many layers of compound regions are you typically dealing with?
Like, do any of your compound regions contain compound regions, and so on?

1 Like

you have done some great stuff. I am a little under the weather so have not tested on another session but definitely will be using this a lot.

Just a thought: Combining your brilliant script with “create track template” of the same track to import track settings and best regions. creating track template, then importing that track (script below) then running your script would move the entire track with plugins and their best regions into another project!

I am not sure how to call the “create track template” script but I import tracks a lot and tend to use the below script to setup a lot to setup sessions.

function factory () return function ()
Session:new_route_from_template (1, ARDOUR.PresentationInfo.max_order, “/home/music/.config/ardour8/route_templates/v7 13 Grand Piano 1.template”, “Piano_V”, ARDOUR.PlaylistDisposition.NewPlaylist);
Session:new_route_from_template (1, ARDOUR.PresentationInfo.max_order, “/home/music/.config/ardour8/route_templates/v7 14 Bass.template”, “Bass”, ARDOUR.PlaylistDisposition.NewPlaylist);
Session:new_route_from_template (1, ARDOUR.PresentationInfo.max_order, “/home/music/.config/ardour8/route_templates/v7 15 Guitar.template”, “Guitar”, ARDOUR.PlaylistDisposition.NewPlaylist);
Session:new_route_from_template (1, ARDOUR.PresentationInfo.max_order, “/home/music/.config/ardour8/route_templates/v7 16 vox_A 1 1.template”, “Vox”, ARDOUR.PlaylistDisposition.NewPlaylist);

end end

Yes, it would certainly be a really nice option in the initial drop-down menu to copy basically an entire track with all of its information (regions, plugins, automation, etc.), but this would require dramatic changes to the script (-which is already ~4000 lines of code (!) :face_with_spiral_eyes:), and unfortunately I don’t have much time right now to develop it further in this way… So, maybe with a later version I will consider adding such automatic handling/functionality! (Also, if I did, I might just want to restructure how everything works/flows in general, as there’s a lot I’ve learned in this coding process…)

Just an update:
Currently, I am in fact working on implementing combined-regions support, which is SUPER tricky as the bindings don’t allow direct viewing of the regions within combined ones (as far as I can tell).

In a nutshell (-boiling-down 4pgs worth of notes on this), the basic strategy will be:

During copying:
→ Warn the user, then temporarily uncombine the combined regions…
→ View, save, and keep track of their ‘child’ region data…
→ Revert the session state so nothing appears altered.


During Pasting:
→ Reconstruct child regions first, alter them, then combine them…
→ Then trim, position, add envelope, etc., to the ‘parent’ regions.

But here’s the REAL crazy bit:
-What if you have compound regions WITHIN compound regions? How many ‘layers’ of a potential ‘onion’ of compound regions can one reasonably keep track of with this method? :question:

Well, with my new logic I’m working-out, basically as many layers as anyone wants (…although I’ll probably cap-it-off at some arbitrary threshold (like 3-5 layers), assuming no one will ever reach that ‘depth’(!)).

Anyway, it’s all coming along well it seems… (-Although compound regions are a bitch, haha.)
I was hung-up on this for awhile, but managed to solve it, thankfully.

-Cheers, :wave:
-J

1 Like

Hey,
your work has really helped and it is certainly saved me immense time. Especially good when I have a mixing/production template with full routing and buses and looking to do import originally recorded tracks.
I am happy uncombining and did not realize that the full track import and the excessive lines of code.

I have been “saving the track template” in original session to get all plugins and settings, then creating a new track template and recalling the track template in big session and then using your script to import the regions. It does the trick so far which is really cool.

Also I have not always been fortunate with the print bindings under keyboard shortcuts but it may be my personal limitations. did you use use “Region”?

Cool!
I’m glad it’s working okay for you! :+1:
It’s (mostly) working fine for me, too!
(I have a huge project I’m combining as well, similar to how you’re doing it using track templates and such.)

I’m not really sure what you’re asking. :question:
Are you referring to that previous post I linked?
If so, like I said, don’t worry about it, as I already solved it. :grin: :+1:

As for the keyboard bindings, those are different than the Lua scripting bindings (-which you can view here, if you’re curious!).


:point_down: :warning:
Also, please note that there was an issue with recreating original layering in the “BETA v1.0” version I gave you. The script was only manifesting pasted regions based on their original position in time (-instead of layer positioning + time), which was a mistake. I have since fixed this.

So, if you have a lot of overlapping regions that need their exact layering preserved, let me know and I can send you a BETA v1.1 version with just that fix. :ok_hand:

(-I also fixed a crashing problem with Pre-Paste… If Pre-Paste ever crashes on you, let me know!)

-J

1 Like

yes definitely interested. please send me beta 1.1. the first project i am still working on but was pretty much the same session from the editor standpoint so i guess it was not really affected much but the next sessions will be a bit more complicated so probably best to have the beta 1.1

btw. i have not had any crashes besides the original issue with combine which i can easily overcome. i will use on more sessions. i was a bit under the weather so a bit slow recently. look forward to the new 1.1

1 Like

Well, I hope you’re feeling better soon!

Here it is: AudioClipboard(BETAv1,1).lua :+1:

→ Better crash-prevention during region clean-up after using do_import/do_embed during Pre-Paste.
→ Region layering now preserved.


And just to be extra clear about the latter (~if anyone’s interested), here’s an example of what I mean:


… O____O

I don’t know why preserving exact layering never occurred to me earlier…
-Just glad it’s taken care of! :grimacing: :+1:

:v:
-J

1 Like