View Issue Details

IDCategoryLast Update
0008115bugs2020-05-28 22:13
Reporterdaniel.appeltAssigned To 
Status closedResolutionfixed 
PlatformSome Other LinuxOSSome Other LinuxOS Versionunknown
Product Version6.0-pre1 
Fixed in Version 
Summary0008115: Lua: adding an event to an automation list creates unwanted events
DescriptionEvery time that I try to add an event (using ARDOUR:AutomationList's add method in Lua) at time x to an automation list that already contains events later in time (> x), actually three events are created at time x:
  1) an event having the value provided to add (as expected)
  2) an event having the same value as the event following in the automation list
  3) an event having the same value as the event preceeding in the automation list (or the initial value of the automation list).

This behaviour is prevalent regardless of the value provided for parameters three and four of the add method (with_guards, with_initials).

The expected behaviour if false is provided for parameters three and four is that only a single event point is added.
Steps To ReproduceCreate a new MIDI track in Ardour using instrument "a-Fluid Synth".
Create a MIDI region. Add a duplicate of the MIDI region.
Add at least one processor automation event for the first parameter of a-Fluid Synth (Output Level) in the second region.

Select the first MIDI region, and run the Lua script attached to this report which will add a new event at the beginning of the first region having value -36.

In my expectation the following statement in the given script is supposed to produce only a single event point in the automation list:
al:add(region:position() - region:start(), -36, false, false)

Instead three event points are created as described above.
Tagsautomation, Lua



2020-05-15 14:57


automation_issue.lua (950 bytes)


2020-05-17 13:17

reporter   ~0024178

As it turns out the Lua method editor_add() of Evoral:ControlList leads to the desired result, i.e. no unwanted extranous event points.

Now, I see two things that should be looked into:

1.) The add() method seems to create guard points although with_guards was set to false.
2.) Documentation / explanation of editor_add() is missing in the Lua Bindings Class Reference in the Ardour manual.


2020-05-17 13:30

administrator   ~0024179

ControlList::add () is indeed intended to write automation in realtime. There is an explicit case: `/* if the transport is stopped, add guard points */` (and also various checks if there's ongoing write-pass).
So using editor_add() seems indeed appropriate for your case.

Documentation is created from doxygen (libs/evoral/evoral/ControlList.h) and sadly a lot of methods are not documented :(


2020-05-28 22:13

reporter   ~0024296 clarifies the documentation.

Issue History

Date Modified Username Field Change
2020-05-15 14:57 daniel.appelt New Issue
2020-05-15 14:57 daniel.appelt Tag Attached: automation
2020-05-15 14:57 daniel.appelt Tag Attached: Lua
2020-05-15 14:57 daniel.appelt File Added: automation_issue.lua
2020-05-17 13:17 daniel.appelt Note Added: 0024178
2020-05-17 13:30 x42 Note Added: 0024179
2020-05-28 22:13 daniel.appelt Status new => closed
2020-05-28 22:13 daniel.appelt Resolution open => fixed
2020-05-28 22:13 daniel.appelt Note Added: 0024296