summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-17 11:19:15 +0100
committerRobin Gareus <robin@gareus.org>2017-02-17 11:19:15 +0100
commit64eb3bc7245e0a1d04fc1b281b7b28277adc498b (patch)
tree0d89540998ed1b66f0a33ef7d95d042e0a7bd4e8 /scripts
parentcded378e1756f985a920c44a2c04d7388c079959 (diff)
Refine faders-to-trim script
Diffstat (limited to 'scripts')
-rw-r--r--scripts/faders_to_trims.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/faders_to_trims.lua b/scripts/faders_to_trims.lua
index 2d0ed44cae..3fd62833f2 100644
--- a/scripts/faders_to_trims.lua
+++ b/scripts/faders_to_trims.lua
@@ -19,6 +19,16 @@ function factory (params)
for t in Session:get_tracks():iter() do
fader_value = t:gain_control():get_value()
+ if fader_value == 1 then
+ goto skip
+ end
+ if t:gain_control():automation_state() ~= ARDOUR.AutoState.Off then
+ goto skip
+ end
+
+ -- TODO: skip MIDI tracks without or with a post-fader synth
+ -- (fader is MIDI-velocity)
+
v = math.log(fader_value, 10)
trim_gain = 20*v
fader_pos = 0
@@ -53,6 +63,8 @@ function factory (params)
--zero the fader gain
t:gain_control():set_value(1, PBD.GroupControlDisposition.NoGroup)
+ ::skip::
+
end --foreach track
end --function