Skip to main content

Overview

The RemapOnDemand generator conditionally copies data from source channels to destination channels only when a toggle channel exceeds a threshold. This allows for dynamic channel routing controlled by a DMX value.

Properties

ToggleChannel
DMXChannel
default:"0"
required
The DMX channel used to control whether remapping occurs.
RemapFromChannelStart
DMXChannel
default:"0"
required
First source channel to read from.
RemapToChannelStart
DMXChannel
default:"0"
required
First destination channel to write to.
RemapChannelLength
EquationNumber
default:"0"
required
Number of channels to remap.
ActivationThreshold
EquationNumber
default:"127"
Minimum value of toggle channel to activate remapping (0-255).

Implementation

From ~/workspace/source/Assets/Plugin/Generators/GeneratorRemapOnDemand.cs:15-26:
public void GenerateDMX(ref List<byte> dmxData)
{
    //ensure capacity
    dmxData.EnsureCapacity(RemapToChannelStart + (int)RemapChannelLength);
    dmxData.EnsureCapacity(RemapFromChannelStart + (int)RemapChannelLength);
    dmxData.EnsureCapacity(ToggleChannel + 1);
    
    if (dmxData[ToggleChannel] > ActivationThreshold)
    {
        dmxData.WriteToListAtPosition(dmxData.GetRange(RemapFromChannelStart, RemapChannelLength), RemapToChannelStart);
    }
}

Configuration Example

generators:
  # Remap channels 1-16 to 513-528 when channel 100 > 127
  - !RemapOnDemand
    ToggleChannel: 100
    RemapFromChannelStart: 0
    RemapToChannelStart: 512
    RemapChannelLength: 16
    ActivationThreshold: 127
  
  # Trigger remap with full brightness toggle
  - !RemapOnDemand
    ToggleChannel: 1.1
    RemapFromChannelStart: 2.1
    RemapToChannelStart: 3.1
    RemapChannelLength: 64
    ActivationThreshold: 200

Use Cases

Duplicate fixture control to a backup universe only when a master switch is enabled:
- !RemapOnDemand
  ToggleChannel: 500  # Master switch
  RemapFromChannelStart: 1.1
  RemapToChannelStart: 2.1
  RemapChannelLength: 512
  ActivationThreshold: 127
Route different source scenes to output based on a selector channel:
# Scene A active when channel 1 < 85
- !RemapOnDemand
  ToggleChannel: 1
  RemapFromChannelStart: 100
  RemapToChannelStart: 1.1
  RemapChannelLength: 32
  ActivationThreshold: 0

# Scene B active when channel 1 >= 85
- !RemapOnDemand
  ToggleChannel: 1
  RemapFromChannelStart: 200
  RemapToChannelStart: 1.1
  RemapChannelLength: 32
  ActivationThreshold: 85
Override normal programming with emergency lighting when triggered:
- !RemapOnDemand
  ToggleChannel: 511  # Emergency trigger
  RemapFromChannelStart: 1000  # Pre-programmed emergency scene
  RemapToChannelStart: 0
  RemapChannelLength: 512
  ActivationThreshold: 250

Differences from Remap Generator

Remap

  • Always active - copies data every frame
  • Simpler configuration
  • No conditional logic
  • Good for static routing

RemapOnDemand

  • Conditionally active - controlled by toggle channel
  • More flexible
  • Allows dynamic routing
  • Good for switchable scenes
Use multiple RemapOnDemand generators with different threshold ranges on the same toggle channel to create a multi-position selector switch.

Build docs developers (and LLMs) love