What is a “script”?

A “Script” is a text that follows a specific format, and operates like a small program inside the main Mixbus program. This text (or “script”) can be typed inside Mixbus, and immediately used by Mixbus, rather than first being “compiled” as part of Mixbus’s source code.

Mixbus can have an “unlimited” number of scripts provided by Harrison, or developed by the user.

We expect the number of provided scripts to grow quickly, as our users develop new scripting ideas.

Mixbus uses “Lua” for its internal scripting language.

What is Lua?

Lua is a simplified programming language that is specifically designed for programs like Mixbus to use internally.

Here is a very simple example of a Lua command:

Session:set_transport_speed (1.0)

This command would cause Mixbus to start the transport at speed 1.0. ( i.e. 100% or “Play”)

There is some additional text at the top of the script file that defines the script’s name and other details to Mixbus.

How do I use Lua scripts?

Several example Lua scripts are provided for your use. There are 3 common ways to initiate a script.

Lua scripts initiated directly from the “Scripting” window:

In Window->Scripting you can view a text editor where Lua scripts may be viewed, edited, and executed. You may type Lua text directly into the text editor, and then initiate the script by clicking ‘Run’ in the bottom-left corner.

In the bottom-right corner, you’ll find a menu which provides a selection of available scripts. Some of the available Action scripts are ready-to-use. Another set of scripts, called “snippets” are provided as starting points for your own Lua scripts. For example there are “snippets” that advance through each of the session’s tracks.

The most common usage of scripts is to recall an existing script, and change it slightly for your immediate needs.

For example: the “rename tracks” script will remove the text “track” from all of your tracks. But perhaps you need to remove the word “session_song_” from all of your track names. In that case, you will load the “rename tracks” script, but modify the text that it is removing or replacing.

You may “save” your scripts for later recall.

Lua scripts triggered as an “action” in the toolbar, or by keyboard shortcuts:

In Edit->Script Manager, you’ll find a dialog that allows you to assign scripts to action buttons, keyboard shortcuts, or session events:

In Preferences->Appearance->Toolbar, you can enable up to 8 action buttons, and assign a Lua script to each of the buttons. The script can even generate its own icon, as shown here for the “create Drum Tracks” script:

Right-click on an action button to assign an action to it. You may also assign a Lua script directly to a keyboard shortcut.

Lua scripts triggered by Session events:

Lua cripts can be triggered by events inside the session.

For example, a script can be triggered “when the transport is stopped”, or “when a marker is reached”.

The details of session-event scripts are currently beyond the scope of this manual.

Lua scripts as DSP Plugins:

A Lua script can be loaded as a DSP plugin. Users will find the provided Lua DSP plugins in the plugin manager, with type “Lua”.

Developing DSP plugin scripts is beyond the scope of this manual.

Developing your own Lua scripts:

Lua Scripting is developed by the Ardour open-source community, with Harrison’s funding and support. Developing your own Lua scripts is beyond the scope of this manual, but you can find regularly-updated details on this page.


Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment