Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fader to input Trim
#1
A little handy script that takes the selected fader level and apply it to the input trim then reset the fader:
Code:
ardour {
    ["type"] = "EditorAction",
    name = "Fader to Input Trim",
    author = "YTG123",
    description = [[Set the input trim value from Selected Faders]]
}

function factory () return function ()
    local sel = Editor:get_selection()
    for t in sel.tracks:routelist():iter() do
       fader_value = t:gain_control():get_value()
       print(math.log(fader_value,10) * 20)
       local dB = ARDOUR.DSP.dB_to_coefficient(math.log(fader_value,10) * 20)
       t:trim_control():set_value(dB, PBD.GroupControlDisposition.NoGroup)
       t:gain_control():set_value(ARDOUR.DSP.dB_to_coefficient(math.log(1,10) * 20), PBD.GroupControlDisposition.NoGroup)
    end
end end

and this one is for all tracks:
Code:
ardour {
    ["type"] = "EditorAction",
    name = "All Faders to Input Trims",
    author = "YTG123",
    description = [[Set the input trim value from All Faders]]
}

function factory () return function ()
    local sel = Editor:get_selection()
    for t in Session:get_tracks():iter() do
       fader_value = t:gain_control():get_value()
       print(math.log(fader_value,10) * 20)
       local dB = ARDOUR.DSP.dB_to_coefficient(math.log(fader_value,10) * 20)
       t:trim_control():set_value(dB, PBD.GroupControlDisposition.NoGroup)
       t:gain_control():set_value(ARDOUR.DSP.dB_to_coefficient(math.log(1,10) * 20), PBD.GroupControlDisposition.NoGroup)
    end
end end
macbook pro 2015
version 10.14.6
Reply
#2
Nice! Congratulations to your son! He will have a bright future if he continues solving those kind of "life puzzles".

You are lucky eyal.
Reply
#3
(12-09-2019, 05:19 PM)GiRa Wrote: Nice! Congratulations to your son! He will have a bright future if he continues solving those kind of "life puzzles".

You are lucky eyal.

Yes, I am lucky.
Thanx
macbook pro 2015
version 10.14.6
Reply
#4
Smart kid
Macmini 8,1 | OS X 13.6.3 | 3 GHz i5 32G | Scarlett 18i20 | Mixbus 10 | PT_2024.3.1 .....  Macmini 9,1 | OS X 14.4.1 | M1 2020 | Mixbus 10 | Resolve 18.6.5
Reply
#5
As a newcomer to scripting, can someone help me out with getting this to work? I copied it and got it into the scripts menu so that it says Trims to Faders, but I'm not having any luck with the action actually being executed. Currently using Mixbus 5 regular, but will likely be upgrading to Mixbus 6 regular soon, if it makes any difference.
Reply
#6
(06-13-2020, 03:54 PM)atlasrecrd Wrote: As a newcomer to scripting, can someone help me out with getting this to work? I copied it and got it into the scripts menu so that it says Trims to Faders, but I'm not having any luck with the action actually being executed. Currently using Mixbus 5 regular, but will likely be upgrading to Mixbus 6 regular soon, if it makes any difference.

1 copy the script
2 open: windows/scripting
3 select all lines and delete them
4 paste the new script and hit the save button
5 open script manager choose action and add/set
you should now see it in the shortcut list - if not hit Refresh
macbook pro 2015
version 10.14.6
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)