Scripting in Falcon uses UVIScript, a domain-specific scripting language built on top of the Lua scripting language. Scripts in Falcon are essentially MIDI effects with advanced capabilities, with access to all of Falcon’s synthesis engine modules. Scripts can also define their own interface, so that you can interact with the script in realtime.
UVIScripts are saved as text documents with a ‘.lua’ extension, and loaded with Falcon’s Script Processor module. For general information on using the Script Processor module, see the Falcon User Manual at page 48 (Events) and page 216 (Event Processors).
To help demonstrate UVIScript, here is a simple example script for a pitch inverter (available in the Script Processor module as a factory preset, under Utilities > Invert Pitch):
CenterPitch = Knob(“Center Pitch”, 60, 0, 127, true)
local center = CenterPitch.value
local delta = e.note-center
local note = center - delta
if note>=0 and note<=127
then playNote(note, e.velocity)
Here is what this script looks like in Falcon’s script processor:
This script creates one knob, which sets the script’s center pitch value (line 1). When a Note On event occurs (line 2), the note’s pitch value is evaluated and modified relative to the center pitch value (lines 3-5), and then the note is played with its modified pitch value (lines 6-7). For example, if the center pitch is set to C3, when a C2 is triggered a C4 would be played instead.