Controling session from command-line

Continuing the discussion from Web Surface for Shortcuts:

Hi Team, I too am looking at improving my workflow by using a Stream Deck to automate repetitive tasks.

For things like the following, I’m thinking lua would be the solution as I don’t think osc would allow it.

  • adding a new track based on a template
  • inserting a particular plugin on the selected track with predetermined presets

I’m familiar with lua scripting in Ardour by now, have used the embedded editor and made a few helper functions.
But if I want to interact with Ardour from another program, I guess I have to use the ardour6-lua command-line tool, right ?
However it doesn’t seem to behave like the built-in editor as if I type something as simple as Session:goto_start() I get an error :frowning:

Error: [string “Session:goto_start()”]:1: attempt to index a nil value (global ‘Session’)

Can you point me in the right direction to get started with the CLI tool ?

Thanks !

Well, reading a little more I’m strating to realize the the ardour6-lua is not intended to interact with a session that’s already running and was started the “normal” way …

I also found that OSC does have LuaAction/script-# actions that could be leveraged … that would at least enable support for 32 of such custom automations; I think I could live with that :sweat_smile:

It is a complete standalone version of Ardour, just without a GUI. Here’s a snipped to load a session and play it

#!/opt/Ardour-6.9.0/bin/ardour6-lua

if false then
  AudioEngine:set_backend("JACK", "", "")
elseif true then
  backend = AudioEngine:set_backend("ALSA", "", "")
  backend:set_buffer_size(256)
  backend:set_peridod_size(3)
  backend:set_device_name("HDA Intel PCH")
else
  AudioEngine:set_backend("None (Dummy)", "", "")
end

s = load_session (os.getenv("HOME").."/Documents/ArdourSessions/ReachingOut", "ReachingOut"
assert (s);
  
Session:goto_start()
Session:request_transport_speed (1.0, true, ARDOUR.TransportRequestSource.TRS_UI)
  
ARDOUR.LuaAPI.usleep (4 * 1000000) 
1 Like

Thanks Robin, that confirms my impression.
I’ll follow the OSC path :+1:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.