Skip to content

Introduction

RT scripting lets you insert custom Lua processors into the audio engine’s signal chain. Each processor intercepts the MIDI-like events flowing toward the sample engine, transforms them in any way you need, and passes the result downstream — all in hard real-time, sample-accurately synchronized with audio playback.

The signal flow through a layer looks like this:

MIDI input
┌─────────────────────┐
│ Script Processor 1 │ ← your Lua code
└─────────────────────┘
┌─────────────────────┐
│ Script Processor 2 │ ← your Lua code
└─────────────────────┘
┌─────────────────────┐
│ Sample Reader │ ← PCM / sample playback
└─────────────────────┘
Audio output

Script processors live between the MIDI input and the first real audio processor (currently always a sample reader). You can stack as many as you need, in any order you choose.

Each script processor is meant to do one thing. A harmonizer script adds interval voices. A legato script detects overlapping notes and adjusts them. A hi-hat choker silences open hi-hat voices when a closed one arrives. A sustain pedal script holds notes after key release.

Keeping scripts focused makes them reusable, testable, and easy to reason about. Complex behaviour emerges from chaining simple processors, not from writing one large script that does everything.

RT scripts are written in Lua. Each script processor has its own isolated Lua environment — global variables in one script are invisible to all others.