How do I load and play an Ardour session from the command line? (headless)

(Ardour Fa3cv) #1

I want to type something like:

“ardour5 -headless suchandsuch_session.ardour”

And have it load the session, all plugins, all soundfont files, and play it back, either without a GUI at all (preferred) or with the GUI, but autoplaying.

Possible? Google revealed some effort towards this ( but my system (Ubuntu (vanilla) 18.04) with Ardour 5 has nothing Ardour-related for “headless” and the latest github is Ardour 6 (alpha) right?

In any case, what’s the status of headless playback?

(Paul Davis) #2

“headless Ardour” is called “hardour” and is not something we distribute.

You would need to build it yourself from source. It will be installed either… you run it via:

cd headless
./hardev /path/to/session/folder

It will not autoplay. You need a control surface (you can use oscsend to deliver commands) to drive it.

(Robin Gareus) #3

Not headless, but auto-playback on load could be triggered using a Lua Script:

Save the following to ~/.config/ardour5/scripts/play_on_load.lua and load the script in Edit > Lua Scripts > Script-manager > Action Hook (in 5.12 this needs to be done per session)

ardour {
  ["type"]    = "EditorHook",
  name        = "Rewind and Roll on Load",
  author      = "Ardour Lua Task Force"

function signals ()
  return LuaSignal.Set():add ({[LuaSignal.SetSession] = true})

function factory () return function (signal, ...)
    Session:request_locate(0, true)
end end

(Robin Gareus) #4

There is a commandline interface, too (but also not distributed with default builds).

cd gtk2_ardour; ./arlua

That does however need a bit of setup – see bottom of on how to start the engine, load a session and play it. Another script that may be useful for inspiration is