mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +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
|
|
@ -2,8 +2,8 @@ ardour { ["type"] = "Snippet", name = "Plugin automation" }
|
|||
|
||||
function factory () return function ()
|
||||
-- query playhead position and session sample-rate
|
||||
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 Track/Bus with RID 3
|
||||
local r = Session:get_remote_nth_route(3)
|
||||
|
|
@ -30,7 +30,7 @@ function factory () return function ()
|
|||
-- add new data points after the playhead 1 sec, min..max
|
||||
-- without guard-points, but with initial (..., false, true)
|
||||
for i=0,10 do
|
||||
cl:add (playhead + i * samplerate / 10,
|
||||
cl:add (playhead + samplerate:scale (Temporal.ratio (i, 10)),
|
||||
pd.lower + math.sqrt (i / 10) * (pd.upper - pd.lower),
|
||||
false, true)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue