uvi-script
Musical event scripting with Lua
Engine

Topics

 Global Variables
 
 

Namespaces

namespace  System
 Global system variables.
 

Classes

class  Element
 Common Elements base class. More...
 
class  EventProcessor
 an Event processor. More...
 
class  ControlSignalSource
 a Modulation source More...
 
class  SignalConnection
 a Connection definition for a modulation More...
 
class  AuxEffect
 an Auxiliary Bus Container for multiple InsertEffect More...
 
class  InsertEffect
 an Insert FX Generic structure that defines an insert FX More...
 
class  BusRouter
 a BusRouter Structure that holds the aux send level as well as the pre/post flag More...
 
class  SampledReverb
 SampledReverb. More...
 
class  Synth
 The Master Element in the synthesis tree. More...
 
class  Part
 A Part. More...
 
class  Program
 A Patch that represents a monotimbral instrument. More...
 
class  Layer
 A layer of sounds. More...
 
class  Keygroup
 A range of keys and velocities. More...
 
class  Oscillator
 The Synthesis primitive. More...
 
class  SampleBasedOscillator
 A sample-based Oscillator. More...
 
class  SamplePlayer
 A sample player Oscillator. More...
 
class  SampleMappingOscillator
 A multi-zone sample dispatcher. More...
 

Functions

string getLocation (string location)
 
string getUserLocation (string productName, string vendorName)
 Per-product user folder, Documents/[vendorName]/[productName], for a sound bank to keep its user presets and data in, independently of the host product (Falcon, UVI Workstation...).
 
function findLayer (name)
 return the layer id given the layer display name.
 

Detailed Description

Synthesis engine structure and hierarchy access.

The Engine group provides access to the UVI synthesis engine's hierarchical structure, from the top-level Synth down through Parts, Programs, Layers, Keygroups, to individual Oscillators. You can navigate this hierarchy, query properties, and modify parameters to control synthesis in real-time.

Engine Hierarchy:

Key Classes:

Common Operations:

Note
Use the global variable this to access the current ScriptProcessor. this.parent is the element that hosts the processor, so the number of parent steps to the Program depends on where the script is inserted (Program, Layer, Part...). Use the Program global (and Layer, Part, Synth, see Global Variables) to reach a given level wherever the script sits.
See also
Elements & parameters, Async

Function Documentation

◆ findLayer()

function findLayer ( name )

return the layer id given the layer display name.

Parameters
namedisplayName of layer to find
Returns
layerId if the layer was found, nil otherwise usage:
function onNote(e)
local layer = findLayer("sustain")
e.layer = layer
local voiceId = postEvent(e)
end
function findLayer(name)
return the layer id given the layer display name.
Definition layer.lua:20
void onNote(table e)
event callback that will receive all incoming note-on events if defined.
function postEvent(e, delta)
send a script event back to the script engine event queue.
Definition api.lua:959

◆ getLocation()

string getLocation ( string location)
Returns
returns special locations like Home, Desktop, Documents and Music directories
print(getLocation("Home"))
print(getLocation("Documents"))
print(getLocation("Desktop"))
print(getLocation("Music"))
print(getLocation("ProgramPath"))
print(getLocation("OriginalProgramPath"))
print(getLocation("Script"))
print(getLocation("Temp"))
string getLocation(string location)

◆ getUserLocation()

string getUserLocation ( string productName,
string vendorName )

Per-product user folder, Documents/[vendorName]/[productName], for a sound bank to keep its user presets and data in, independently of the host product (Falcon, UVI Workstation...).

The folder is created if missing. Each name must be a single path component: an empty name, ".", ".." or a name containing / or \ raises an error. Engines that predate this function raise an error when calling it, so guard it with pcall when a script must also run there.

Parameters
productNameproduct folder name
vendorName(optional) vendor folder name, "UVI" if omitted
Returns
the absolute path of the folder
print(getUserLocation("My Instrument")) -- Documents/UVI/My Instrument
print(getUserLocation("My Instrument", "My Company")) -- Documents/My Company/My Instrument
local ok, root = pcall(getUserLocation, "My Instrument", "My Company")
if not ok then root = getLocation("Documents").."/My Company/My Instrument" end
string getUserLocation(string productName, string vendorName)
Per-product user folder, Documents/[vendorName]/[productName], for a sound bank to keep its user pres...