summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-11-17 14:51:33 +0100
committerRobin Gareus <robin@gareus.org>2019-11-17 14:52:22 +0100
commit81d8f0faa7ba174d3c40b1576409336471bb6540 (patch)
tree2d56ab47d323189e9afc74c3d7a512ec232b2d87 /scripts
parent8e8249b595e34a8d4c7c715b91b9ccf95569d010 (diff)
Tweak LFO script
* thin automation to prevent too dense events * add icon (cosine wave)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lfo_automation.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/lfo_automation.lua b/scripts/lfo_automation.lua
index 7907ae0748..80aed210b1 100644
--- a/scripts/lfo_automation.lua
+++ b/scripts/lfo_automation.lua
@@ -160,6 +160,9 @@ function factory (unused_params)
end
end
+ -- remove dense events
+ al:thin (20) -- threashold of area below curve
+
-- TODO: display the modified automation lane in the time line in order to make the change visible!
-- Save undo
@@ -171,3 +174,16 @@ function factory (unused_params)
collectgarbage()
end
end
+
+function icon (params) return function (ctx, width, height, fg)
+ local wh = math.min (width, height) * .5
+ local x0 = math.ceil (wh * .2)
+ local x1 = math.floor (wh * 1.8)
+ ctx:set_line_width (1)
+ ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
+ ctx:move_to (x0, wh * 1.5)
+ for x = x0, x1 do
+ ctx:line_to (x, wh + math.cos (3 * math.pi * (x-x0) / (x1-x0)) * wh * .5)
+ end
+ ctx:stroke ()
+end end