ardour icon indicating copy to clipboard operation
ardour copied to clipboard

add fade_in_length() and fade_out_length() methods to audioregion

Open Houston4444 opened this issue 4 years ago • 6 comments

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.

Houston4444 avatar Jan 27 '21 11:01 Houston4444

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 ?

Houston4444 avatar Jan 30 '21 11:01 Houston4444

yes, these methods should return samplecnt_t not double

pauldavisthefirst avatar Jan 30 '21 20:01 pauldavisthefirst

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.

Houston4444 avatar Jan 31 '21 19:01 Houston4444

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.

pauldavisthefirst avatar May 07 '21 22:05 pauldavisthefirst

conflict fixed !

Houston4444 avatar May 08 '21 16:05 Houston4444

Any plans to polish this up for use in 7.0?

pauldavisthefirst avatar Aug 18 '22 16:08 pauldavisthefirst