Skip to content

Live Scripts module

image

MoonLight is based on nodes (see Effects and Drivers) where each node can run precompiled layouts, effects or modifiers but alternatively, each node can also run a live script, uploaded on the esp32 file system (.sc files). Currently this only works on esp32-S3 boards as normal esp32 boards do not have enough memory to flash MoonLight with the Live Scripts option.

This module shows all running live scripts

  • Scrips: Running Live scripts (🚧)
  • Press the edit button to stop start or kill a script (current bug: double click the button)

How to run a live script

Step 1: Select Moonbase / File Manager from the menu and select a location to store live scripts. Create a folder if needed (press the second + button):

image

Step 2: Go to this folder and create a file (press the first + button). Give the file a name ending with .sc and enter the code. See github livescripts for example scripts (E_.sc files are effects L_.sc files are layouts). Alternatively you can also upload a live script with by pressing the Upload File button. Press save:

image

Step 3: Select MoonLight / Effects or MoonLight / Drivers from the menu. Create a new effect node (🔥) by pressing the + button or update an existing effect node (🔥) by pressing the ✐-button. Open the drop down and scroll to the bottom where live script files are shown

image

Step 4: Select the script, the script will be compiled (takes a second or so) and executed. You can see the effect controls on the bottom of the screen (speed and branches in this example), change them to customise the effect:

image

Step 5: Live scripts can be edited in the node press the ✐-button of a live script node and press the v next to Edit and the same edit window as in Step 2 opens. Do your edits and press save. The script recompiles and will restart the effect. (Alternatively if a script is running and you edit a file in the file manager, the script will also recompile and rerun). For a list of functions currently supported, see live script functions. This list is dynamic and will increase overtime, send a ping if you would like function(s) to be added.

image

Step 6: An overview of running live scripts can be found in MoonLight / LiveScripts

examples

PanTilt script

  • Sends a beatsin to Pan and Tilt which can be sent to Moving Heads (add a Moving head layout node to configure the MHs)
  • Controls: BPM, Middle Pan and Tilt, Range and invert
  • Usage: Add this effect if moving heads are configured. RGB effects can be added separately e.g. wave to light up the moving heads in wave patterns
  • See E_PanTilt
  • Run script see How to run a live script