Product manual

RGB Script Fundamentals
Users can write their own RGB scripts to produce custom graphics projection with the RGB
Matrix function. The scripts' operation principle is to produce a number of RGB maps that each
represent one step in the graphics animation. The principle is basically the same as in movies:
the audience observes a moving picture, which in reality is only a sequentially-played stream of
static images that only produce an illusion of movement.
The scripts themselves are written in ECMAScript, which is also known as JavaScript. Note that
the language is case-sensitive and as a de-facto standard follows camel case rules, so make
sure you write everything correctly and pay special attention to the required API features.
Script files should be named after the script's name and must have a .js extension. Depending on
platform, the files should be placed either in the QLC+ system script directory or, preferably, the
user script directory:
Linux user dir: ~/.qlcplus/rgbscripts/
Linux system dir: /usr/share/qlcplus/rgbscripts/
OSX user dir: ~/Library/Application Support/QLC+/RGBScripts
OSX system dir: /Applications/QLC+.app/Contents/Resources/RGBScripts
Windows user dir: Not applicable
Windows system dir: C:\QLC+\RGBScripts
RGB Script API
Foundation
The scripts must be self-executing, i.e. when they are evaluated, the script itself is put inside an
anonymous function that executes itself and returns an object that contains the required API
functions:
(
function() { // Anonymous function starts here
var algo = new Object;
return algo; // Return the script object
} // Anonymous function ends here
)() // Anonymous function is executed here upon evaluation
Properties
However, a script with nothing more than an empty object does nothing, no matter how self-
executing it might be. You must also declare some properties for the returned object so that
QLC+ knows how to use the script and to show it to the user (you). So, you need to declare the
following properties for the returned script object:
apiVersion: The API version that the script follows. Currently '1' is correct number. 0 will
cause the script to be treated as invalid.
name: The name of your script. This name appears in the pattern selection box in the RGB
Matrix Editor
author: The name of the person who has written the script. You.
Page 39