Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/develop/nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A node implements the following (overloaded) functions:

* **addLight** will show where the moving head will be on the stage. In general only an array of a few lights e.g. 4 moving heads in a row. A moving head effect will then iterate over 4 lights where each light might do something different (e.g. implement a wave of moving head movement)
* You need to define **channelsPerLight** in the layout node setup() - (it is default 3 to support normal LEDs). Currently MoonLight only supports identical moving heads with the same channels. The first light starts at DMX 0 (+1), the second at DMX channelsPerLight (+1) the third on DMX 2*channelsPerLight (+1) and so on. (+1): DMX typically starts at address 1 while MoonLight internal starts with 0... 🚧. We are working on a solution to support different lights e.g a mix of 15 channel lights and 32 channel lights etc. You could set channelsPerLight to a higher number as the real lights channels, e.g. 32 so each lights DMX address starts at a multiple of 32.
* **Layout**: The layout node also defines which functionality / channels the light support by defining **offsets**. Currently the following offsets are supported: offsetRGB, offsetWhite, offsetBrightness, offsetPan, offsetTilt, offsetZoom, offsetRotate, offsetGobo, offsetRGB1, offsetRGB2, offsetRGB3, offsetBrightness2 and need to be set in the setup() function.
* **Layout**: The layout node also defines which functionality / channels the light support by defining **offsets**. Currently the following offsets are supported: offsetRGBW, offsetRed, offsetGreen, offsetBlue, offsetWhite, offsetBrightness, offsetPan, offsetTilt, offsetZoom, offsetRotate, offsetGobo, offsetRGBW1, offsetRGBW2, offsetRGBW3, offsetBrightness2 and need to be set in the setup() function.
* The distinction between physical and virtual layer for moving heads is not useful if you have only 2-4 moving heads. However this is a standard MoonLight feature. It might become useful if you have like 8 (identical) moving heads, 4 left and 4 right of the stage, then you can add a mirror modifier and the virtual layer will only control 4 lights, which then will be mapped to 8 physical lights. In theory you can also have a cube of like 512 moving heads and then exotic modifiers like pinwheel could be used to really go crazy. Let us know when you have one of these setups 🚨
* Moving heads will be controlled using the [ArtNed Node](https://moonmodules.org/MoonLight/moonlight/nodes/#art-net/). addPin is not needed for moving heads, although you might want to attach LEDs for a visual view of what is send to Art-Net.
* Effect nodes **set light**: Currently setRGB, setWhite, setBrightness, setPan, setTilt, setZoom, setRotate, setGobo, setRGB1, setRGB2, setRGB3, setBrightness2 is supported. In the background MoonLight calculates which channel need to be filled with values using the offsets (using the setLight function).
Expand Down
22 changes: 11 additions & 11 deletions interface/src/routes/moonbase/monitor/Monitor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
};

const handleMonitor = (data: Uint8Array) => {
const headerPrimeNumber = 41;
const headerPrimeNumber = 47;
if (data.length == headerPrimeNumber)
//see ModuleLightsControl.h:243
handleHeader(data);
Expand All @@ -52,7 +52,7 @@

let nrOfLights: number;
let channelsPerLight: number;
let offsetRGB: number;
let offsetRGBW: number;
let offsetWhite: number;
let isPositions: boolean = false;
let lightPreset: number;
Expand All @@ -76,10 +76,10 @@

nrOfLights = view.getUint32(12, true);
nrOfChannels = view.getUint32(16, true);
lightPreset = view.getUint8(20);
channelsPerLight = view.getUint8(21);
offsetRGB = view.getUint8(26);
offsetWhite = view.getUint8(28);
lightPreset = view.getUint8(21);
channelsPerLight = view.getUint8(26);
offsetRGBW = view.getUint8(27);
offsetWhite = view.getUint8(31);

//rebuild scene
createScene(el);
Expand All @@ -101,7 +101,7 @@
depth,
nrOfLights,
channelsPerLight,
offsetRGB,
offsetRGBW,
nrOfChannels
);
};
Expand Down Expand Up @@ -137,11 +137,11 @@
if (lightPreset != lightPreset_RGB2040 || Math.floor(index / groupSize) % 2 == 0) {
// Math.floor: RGB2040 Skip the empty channels
// && index < width * height * depth
const r = channels[index + offsetRGB + 0] / 255;
const g = channels[index + offsetRGB + 1] / 255;
const b = channels[index + offsetRGB + 2] / 255;
const r = channels[index + offsetRGBW + 0] / 255;
const g = channels[index + offsetRGBW + 1] / 255;
const b = channels[index + offsetRGBW + 2] / 255;
let w = 0;
if (offsetWhite != 255) w = channels[index + offsetRGB + 3] / 255; //add white channel if present
if (offsetWhite != 255) w = channels[index + offsetRGBW + 3] / 255; //add white channel if present
const a = 1.0; // Full opacity
colors.push(r + w, g + w, b + w, a);
}
Expand Down
Loading