2019-02-26 12:04:06 -05:00
|
|
|
ardour { ["type"] = "Snippet", name = "Thin Fader Automation" }
|
|
|
|
|
|
|
|
-- --TODO--
|
|
|
|
-- For a fully fledged EditorAction this script should
|
2021-10-30 16:27:10 -04:00
|
|
|
-- offer a dropdown to select automation of all parameters
|
2019-02-26 12:04:06 -05:00
|
|
|
-- (not just the fader)
|
|
|
|
-- see scripts/midi_cc_to_automation.lua and
|
|
|
|
-- scripts/mixer_settings_store.lua
|
|
|
|
-- Thinning Area should also be a numeric-entry or slider
|
|
|
|
|
|
|
|
function factory () return function ()
|
|
|
|
-- get selected tracks
|
|
|
|
rl = Editor:get_selection ().tracks:routelist ()
|
|
|
|
|
|
|
|
-- prepare undo operation
|
|
|
|
Session:begin_reversible_command ("Thin Automation")
|
|
|
|
local add_undo = false -- keep track if something has changed
|
|
|
|
|
|
|
|
-- iterate over selected tracks
|
|
|
|
for r in rl:iter () do
|
|
|
|
|
|
|
|
-- get the Fader (aka "amp") control
|
|
|
|
local ac = r:amp ():gain_control () -- ARDOUR:AutomationControl
|
|
|
|
local al = ac:alist () -- ARDOUR:AutomationList
|
|
|
|
|
|
|
|
-- get state for undo
|
|
|
|
local before = al:get_state ()
|
|
|
|
|
|
|
|
-- remove dense events
|
Fix various typos
Found via `codespell -q 3 -S *.po,./share/patchfiles,./libs -L ba,buss,busses,doubleclick,hsi,ontop,ro,seh,siz,sord,sur,te,trough,ue`
Follow-up to 364f2f078
2022-04-07 09:09:04 -04:00
|
|
|
al:thin (50) -- threshold of area below curve
|
2019-02-26 12:04:06 -05:00
|
|
|
|
|
|
|
-- save undo
|
|
|
|
local after = al:get_state ()
|
|
|
|
Session:add_command (al:memento_command (before, after))
|
|
|
|
add_undo = true
|
|
|
|
|
|
|
|
::out::
|
|
|
|
end
|
|
|
|
|
|
|
|
-- all done, commit the combined Undo Operation
|
|
|
|
if add_undo then
|
Fix various typos
Found via `codespell -q 3 -S *.po,./share/patchfiles,./libs -L ba,buss,busses,doubleclick,hsi,ontop,ro,seh,siz,sord,sur,te,trough,ue`
Follow-up to 364f2f078
2022-04-07 09:09:04 -04:00
|
|
|
-- the 'nil' Command here means to use the collected diffs added above
|
2019-02-26 12:04:06 -05:00
|
|
|
Session:commit_reversible_command (nil)
|
|
|
|
else
|
|
|
|
Session:abort_reversible_command ()
|
|
|
|
end
|
|
|
|
end end
|