![]() |
uvi-script
Musical event scripting with Lua
|
uvi-script is a powerful, real-time scripting environment for musical event processing, built on the Lua programming language. It enables you to create intelligent, algorithmic behaviors that respond to and generate musical events with sample-accurate timing.
Unlike traditional MIDI processing, uvi-script gives you complete control over the entire musical pipeline: you can intercept and transform incoming events, generate new musical material, manipulate individual voices, control synthesis parameters, and create custom user interfaces—all from within a single, unified scripting environment.
The language combines Lua's simplicity and expressiveness with a specialized API designed specifically for real-time audio and music production, making it possible to implement sophisticated musical behaviors that would be difficult or impossible with conventional MIDI tools.
A UVI script is a text file containing Lua code that defines how your instrument responds to and generates musical Events. Each script acts as a programmable event processor inserted into the audio engine's signal path.
Scripts operate through an event-driven model: you define callback functions (like onNote, onRelease, onController) that are automatically invoked when specific events occur. Inside these callbacks, you have complete freedom to decide what happens—forward events unchanged, transform them, generate additional events, manipulate playing voices, or control any synthesis parameter.
Think of scripts as programmable MIDI effects with deep engine integration. They combine the event-processing capabilities of MIDI effects with direct access to voice control, synthesis parameters, and the ability to create custom user interfaces. This integration enables musical behaviors that span the entire sound production chain, from note input to final synthesis.
Possibilities are endless and only limited to your imagination:
Performance Tools:
Generative Music:
Harmonic Tools:
Expression & Effects:
Tuning:
Engine Control:
User Interface:
New to scripting? Start with the comprehensive Building Your First Script to build your first vibrato script.
Once you understand the basics, explore the topic guides:
See Guides for the complete list.
The uvi-script API is organized into functional groups:
For quick-start code snippets, see API Quick Reference.
uvi-script is built on Lua 5.1, a lightweight and powerful scripting language. The Lua VM runs with real-time constraints to ensure sample-accurate timing and low-latency performance.
See the Lua Language Reference page for available libraries, memory management, and threading details.