Zene Studio
On this page

The Lua API

Scripting Zene Studio with Lua 5.4 — what the API covers and how it is versioned.

Applies to 0.3.0-alphaUpdated

Zene Studio embeds Lua 5.4 and exposes a versioned API to it. If you can express a rule in Lua, you can automate it inside the running application — without a socket, without a separate process.

Two ways to script

Lua APIControl socket
RunsInside the applicationFrom another process
Good forBehaviour tied to the session, custom devices, live rulesAutomation, agents, tooling
Discoverable fromThe consolecontrol.commands_list

Many things are more natural one way than the other. Use both.

What the API covers

  • project and track manipulation;
  • automation, including the automation modes you can set per parameter;
  • custom script devices — instruments and effects implemented in Lua;
  • access to the same underlying operations the GUI performs.

Script devices

A script device is a plugin whose implementation is Lua instead of C++. This is how you get a custom instrument or effect without leaving the project: the device is defined in your project, so it travels with it and your collaborators get it for free.

The device design has its own documented surface in the application repository, including how devices are packaged and where they are loaded from.

Versioning

The API is versioned, and it ships with a compatibility policy. That means:

  • an API version is declared;
  • changes within a version are additive;
  • breaking changes land in a new version, with a stated migration.

This is unusual for an alpha and it is deliberate — a scripting API that changes without warning is worse than no scripting API. See Compatibility policy.

Practical advice

  • Version-gate your scripts. Check the API version at load and fail loudly if it is not what you expect. Otherwise it fails mysteriously on the first missing field.
  • Keep scripts in your project where the versioning story is clear, or in version control with the project, so a project always comes with working scripts.
  • Learn the console first. It is the fastest feedback loop available.

See also

Help keep Zene Studio free

Developing Zene Studio costs money.

There is no paid tier and no advertising, so donations are what keep it going. If it is useful to you, please give what you can.