Generating automation-data programmatically

Hello dear Ardourians!

I was wondering if it is possible to generate the “automation” data for a track and feed/load it into the automation lane. For instance creating the automation data with help of a script (to what ever suitable data-format), and load it afterwards into the automation pseudo-track. Is this possible?

1 Like

You could either directly modify the .ardour session file while Ardour is not running, it is a XML text file and automation is just a a “time value” pair, one per line.

Alternatively you can use Ardour’s Lua scripting to directly create automation data inside Ardour. There are a couple of examples:

2 Likes

Great! As I don’t know Lua-scripting I will try first going with the XML-parsing/modifying.
I am looking at a ardour-session file of mine, and I see in it parts like:

<InverseFadeOut>
          <AutomationList automation-id="fadeout" id="6577" interpolation-style="Curved" time-domain="AudioTime" state="Off">
            <events>a0 1.0000000116860974e-07
a23520 0.095055952925701945
a35280 0.1423147961488434
a47040 0.18925124993221634
a58800 0.2357588969086416
a70560 0.28173247517396005
a82320 0.32706792846270311
a94080 0.37166246619609478
a105840 0.41541498203247024
a117600 0.45822645111753457
a129360 0.49999997297228316
a141120 0.54064083177629574
a152880 0.5800568864602571
a164640 0.61815892823618979
a176400 0.65486071464754436
a188160 0.69007902790898956
a194040 0.72373402244207363
a205800 0.75574956041960206
a217560 0.78605308246601313
a229320 0.81457594135313838
a241080 0.84125352362782713
a252840 0.86602539598220885
a264600 0.88883544215458044
a276360 0.90963199005079642
a288120 0.92836792879818764
a299880 0.94500081546684744
a311640 0.9594929712165241
a323400 0.97181156665131863
a335160 0.98192869618882905
a346920 0.98982144127527472
a358680 0.99547192230339399
a370440 0.99886733911550885
a376320 1
</events>
          </AutomationList>
        </InverseFadeOut>

Is this the correct element to modify? And how should I interpret the pairs within the <events> element? What is the aXXXXX part? (I suppose the float after it is the automation-parameter value?)
And by-the-way: before going any further I should ask: is automation also applicable to plugins? E.g. can I have a filter- or reverb-plugin controlled as an automation-lane? Because this is what I ultimately am trying to do.

Thank you for your help :slight_smile:

Yes, same thing as here with region fade. I suggest to start by adding a few points using the GUI to the plugin’s automation lane…

The position in time. Ardour supports two time-domains:

  • music-time: bar-beats
  • audio-time: minute, seconds (audio-samples at sample-rate)

a indicates audio time; by default in 1 / 282240000 per second (search the .ardour file for superclocks-per-second).

so a fade from zero to one over the time of 1 second starting at 00:00:00:00 would be

a0 0                                                                                                                                                                                           
a282240000 1
2 Likes

Thank you for your answer!
I suppose for creating an automation programmatically (needing to know where the signal onset is in a track, and many other finer decision-factors), it is not a real solution to modify the XML file? So learning Lua scripting seems unavoidable!? Or is there any way to get such information (e.g. signal-portions of a track) from the XML?

It is possible but I would say that trying to do so would indicate that you’d heading down the wrong path.

1 Like