Skip to content

Animations module

Functional

  • On: lights on or off
  • Brightness: brightness of the LEDs when on
  • driverOn: sends LED output to ESP32 gpio pins.
    • Switch off to see the effect framerate in System Status/Metrics
    • Switch on to see the effect framerate throttled by a LED driver in System Status/Metrics (800KHz, 256 leds, 24 bits is 130 fps theoretically - 120 practically)
  • Pin: Currently only 2 and 16 supported
  • Nodes: One or more processes, can be fixture definitions, mappings, effects, projections. Currently all nodes are effects.
    • Nodes can have arguments
  • Scrips: Running Live scripts (WIP)
  • If a script file is updated (here or in the File Manager) and the file is part of an active node, it will rerun

Screenshot 2025-03-29 at 14 12 01

Scripts

Example scripts can be found in Live scripts - WIP

They represent current state of Live Script processing and will be extended as more functionality will be added.

Technical

  • See Modules
  • Upon changing a pin, FastLED.addLeds will rerun
  • Uses ESPLiveScripts, see compileAndRun. compileAndRun is started when in Nodes a file.sc animation is choosen
    • To do: kill running scripts, e.g. when changing effects
  • To do: use Nodes arguments as arguments to scripts or hardcoded effects

Mapping model (to do)

  • Multiple Nodes can be created (1)
    • Each node can have properties (compare controls in WLED / StarLight)
    • Each node can run precompile code or Live scripts (with or without loop)
    • Each node has a type:
      • Fixture definition: tell where each pixture is in a 1D/2D/3D physical coordinate space (based on StarLight)
      • Fixture mapping: change the fixture to a 1D/2D/3D virtual coordinate space
        • A fixture mapping is for a specific fixture dimension and effect dimension
        • e.g. if the fixture is a globe, you can map that to 2D using mercator projection mapping
        • if the fixture is 200x200 you can map it to 50x50
        • if the fixture is 2D, a 1D effect can be shown as a circle or a bar (as WLED expand1D)
      • Effect: run an effect in a virtual coordinate space
        • or in the physical space if you want to run at highest performance, e.g. a random effect doesn't need to go through mappings ✅
      • Modifier: Mirror, rotate, etc, multiple projections allowed (projection in StarLight)
      • Driver show: show the result on Leds (using FastLED, hpwit drivers), ArtNet, DDP, ...
  • Future situation: Nodes and noodles (2)
    • Replace the nodes table (1) by a graphical view (2)
  • MappingTable (3)
    • Array of arrays. Outer array is virtual pixels, inner array is physical pixels.
    • Implemented efficiently using the StarLight PhysMap struct
    • e.g. [[],[0],[1,2],[3,4,5],[6,7,8,9]]
      • first virtual pixel is not mapped to a physical pixel
      • second virtual pixel is mapped to physical pixel 0
      • third virtual pixel is mapped to physical pixels 1 and 2
      • and so on
    • CRGB leds[NUM_LEDS] are physical pixels (as in FASTLED)
    • Virtual pixels can be 1D, 2D or 3D. Physical pixels also, in any combination
      • Using x + y * sizeX + z * sizeX * sizeY
    • Each effect Node has it's own MappingTable and gets updated if fixture, mapping or dimensions change
    • set/getPixelColor functions used in effects using the MappingTable
    • Nodes manipulate the MappingTable and/or interfere in the effects loop
  • Presets/playlist: change (part of) the nodes model

✅: Done

Server

ModuleAnimations.h

UI

Generated by Module.svelte