Interactive lua programming on emacs/vim

Is there a way to interactively program lua for ardour?
For instance, open a lua shell from an editor or the CLI and I can issue LUA commands for the
currently interactive GUI session?
That would help me a lot to develop scripts interactively and not have to run the script every time.

2 Likes

I think in Edit? Or one of the main menus there’s the scripting window. You can select one of the scripts so it opens in the editor above. You can run scripts with the run button. When you edit the script externally, you can change anything in the scripting windows text editor so the revert button is enabled, which just reloads the file with your external changes. Then you can press run again.

Best way I found, but it’s not good, unfortunately. I’m interested in a better solution, too :innocent:

1 Like

Typing “emacs lua” at a search engine gives

Emacs has a major mode called lua-mode specifically for editing Lua code, which supports features like automatic code indentation and sending code to a Lua interpreter. You can install lua-mode via package managers like MELPA or el-get.

I am unsure you can do it but I would like to have this too.
I think there are some OSC and MCP protocols that you could call from Emacs-LISP but not really some direct Lua interpretation.
Perhaps some OSC/MCP API could be added to interpret a full Lua string and return the result?

yes there is a lua-mode, but that only gives you in this case syntax highlighting and other goodies, no way to attach a lua process to ardour interactively

having a OSC/MCP API that can call the eval lua function would be amazing of course, I thought
about patching ardour so that the lua process gets exposed to the outside world, idk if that would be difficult but maybe I can give it a go.
I also thought to wrap OSC and all that in emacs lisp but AFAIK the OSC API is quite limited,
I don’t know if I can do solely through OSC calls for instance, get the list of tracks, properties, create new tracks, patch them, group them, ungroup them etc… I think that’s not possible but I might be wrong