mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-26 23:18:20 +01:00
Second round of Lua script API updates
This commit is contained in:
parent
1abf6a77d6
commit
76c0f42ecb
23 changed files with 76 additions and 112 deletions
|
|
@ -1,8 +1,8 @@
|
|||
ardour { ["type"] = "Snippet", name = "Fader Automation" }
|
||||
|
||||
function factory () return function ()
|
||||
local playhead = Session:transport_sample ()
|
||||
local samplerate = Session:nominal_sample_rate ()
|
||||
local playhead = Temporal.timepos_t (Session:transport_sample ())
|
||||
local samplerate = Temporal.timecnt_t (Session:nominal_sample_rate ())
|
||||
|
||||
-- get selected tracks
|
||||
rl = Editor:get_selection ().tracks:routelist ()
|
||||
|
|
@ -32,7 +32,7 @@ function factory () return function ()
|
|||
for i=0,50 do
|
||||
-- use a sqrt fade-out (the shape is recognizable, and otherwise
|
||||
-- not be possible to achieve with existing ardour fade shapes)
|
||||
al:add (playhead + i * samplerate / 50,
|
||||
al:add (playhead + samplerate:scale (Temporal.ratio (i, 50)),
|
||||
g * (1 - math.sqrt (i / 50)),
|
||||
false, true)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue