mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Fix off by one (Lua arrays are 1-based)
This commit is contained in:
parent
73165aae95
commit
5218c104f9
1 changed files with 3 additions and 3 deletions
|
|
@ -65,14 +65,14 @@ function dsp_run (ins, outs, n_samples)
|
|||
local a = shmem:to_float (0):array ()
|
||||
if s == 0 then
|
||||
-- the first plugin saves the peak
|
||||
a[0] = peak
|
||||
a[1] = peak
|
||||
ctrl[2] = -1
|
||||
else
|
||||
-- all later plugins display the difference to the first.
|
||||
if (a[0] == 0) then
|
||||
if (a[1] == 0) then
|
||||
ctrl[2] = 1
|
||||
else
|
||||
ctrl[2] = peak / a[0]
|
||||
ctrl[2] = peak / a[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue