ardour
ardour copied to clipboard
add fade_in_length() and fade_out_length() methods to audioregion
Hi. This has been discussed with Robin on IRC, this PR adds fade_in_length() and fade_out_length() methods to audioregion.
The goal is to give access to theses values from a Lua script.
I also give a script that makes a new playlist in selected tracks with only audible regions. That means it cuts or removes regions if they are below other ones (except during their fade of course). The new playlist is named track_name.MAIN because I attempt to do another script to copy selected regions to the track_name.MAIN playlist. The idea came making music, with many takes on a guitar track playlist, and always have to move many regions to get a silence at a moment. This script allows to have a very clean playlist easier to edit with exactly the same audible contents.
The script has no undo method because I didn't find any way to remove a playlist. Cheers.
mmmh, all things considered I probably made a mistake. my fade_in_length() and fade_out_length() methods returns a double, then I use math.floor() Lua method in my script to convert it in int. Length here is a number of samples, so the C++ method should directly return an integer, don't you think ?
yes, these methods should return samplecnt_t not double
Ok that is done. I don't know your politic about embedded Lua scripts, this script copies current playlist of selected tracks, renames the new playlists to track_name.MAIN, and clean their contents to only audible regions. This way another script can easily copy selected regions to playlist named track_name.MAIN. I want to try this workflow.
Maybe you will prefer that the script only clear the playlist of selected regions, and this action could be undo.
I was going to rebase + merge this, but there's a merge conflict even after fixing the rebase conflict. If you don't mind fixing that up against master, I'll be happy to merge it.
conflict fixed !
Any plans to polish this up for use in 7.0?