# Ardour Scripting 101

Open Source Audio Meeting Cologne

Daniel Appelt / 2019-11-20

## What?

- Scripting allows to add functionality to Ardour’s core

- Scripts can hook into different parts of Ardour

- Some scripts are shipped by default

- Scripting language is Lua

- New Ardour releases include new features and scripts

- Supported since version 4.7.213

- Scripting console, Editor actions, Hooks / Signals, DSP processors, Session scripts

## Where?

## In the file system

- Users can add further scripts to their installation

- Linux: $HOME/.config/ardour5/scripts

## In the application

- Menu → Window → Scripting

- Menu → Edit → Scripted Actions (and Hooks)

- Menu → Session → Scripting

- Mixer-strip → context menu (right click) → New Lua Proc

## How?

- Ardour Scripting Documentation

- Ardour scripting examples

- Deep dive into code

- Supported signals

## Minimal code example

    ardour {
      ["type"]    = "EditorAction",
      name        = "Rewind",
    }

    function factory (unused_params)
      return function ()
        Session:goto_start()  -- rewind the transport
      end
    end

## Mastering Lua?

- Lua Cheatsheet

- Programming in Lua

- Lua Reference Manual

## Conclusion

- Scripting allows to add "missing" functionality

- Available Lua API is already huge

- Still, there are some missing parts and inconsistencies

- Sometimes you have to write ugly code to achieve simple things

- Selection hooks are missing, for example

- collectgarbage(), non-unified naming

## Extra

## (Ardour Lua) Plugin of the month