From 91919cf09ed5b653742f93ae12c01315ce9c3c46 Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Mon, 23 Dec 2024 16:23:57 +0100 Subject: [PATCH 1/9] WIP, LoRes working again, not through GUI --- build.rs | 24 +- example.hires.json | 256 +++++ fixtures/ADJ_Vizi_Hex_Wash7.json | 8 +- fixtures/Varytec_HERO_340FX.json | 8 +- fixtures/{ => todo}/Cameo_Opus_S5.json | 0 fixtures/{ => todo}/GLP_Impression_X5.json | 0 .../SHEHDS_LED_Flat_PAR_12x3W_RGBW.json | 0 src/all_fixtures.json | 890 +----------------- src/artnet.rs | 26 +- src/model.rs | 9 +- src/project/fixture.rs | 16 +- src/project/scene.rs | 2 +- src/tether_interface.rs | 2 +- src/ui/macro_controls.rs | 75 +- 14 files changed, 364 insertions(+), 952 deletions(-) create mode 100644 example.hires.json rename fixtures/{ => todo}/Cameo_Opus_S5.json (100%) rename fixtures/{ => todo}/GLP_Impression_X5.json (100%) rename fixtures/{ => todo}/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json (100%) diff --git a/build.rs b/build.rs index 82e36fc..e6a80b7 100644 --- a/build.rs +++ b/build.rs @@ -17,18 +17,20 @@ fn main() { for (index, fixture_path) in entries.iter().enumerate() { println!("Fixture file: {:?}", fixture_path); - match fs::read_to_string(fixture_path) { - Ok(d) => { - entire_string.push_str(&d); - if index < (entries.len() - 1) { - entire_string.push(','); + if fixture_path.is_file() { + match fs::read_to_string(fixture_path) { + Ok(d) => { + entire_string.push_str(&d); + if index < (entries.len() - 1) { + entire_string.push(','); + } + } + Err(e) => { + panic!( + "Something went wrong reading the contents of the fixture file: {}", + e + ); } - } - Err(e) => { - panic!( - "Something went wrong reading the contents of the fixture file: {}", - e - ); } } } diff --git a/example.hires.json b/example.hires.json new file mode 100644 index 0000000..a1ccb7f --- /dev/null +++ b/example.hires.json @@ -0,0 +1,256 @@ +{ + "fixtures": [ + { + "label": "Hero Left", + "configName": "Varytec HERO 340FX", + "offsetChannels": 27, + "modeIndex": 0 + }, + { + "label": "Hero Right", + "configName": "Varytec HERO 340FX", + "offsetChannels": 70, + "modeIndex": 0 + }, + { + "label": "Hex Left", + "configName": "ADJ Vizi Hex Wash 7", + "offsetChannels": 43, + "modeIndex": 0 + }, + { + "label": "Hex Right", + "configName": "ADJ Vizi Hex Wash 7", + "offsetChannels": 0, + "modeIndex": 0 + } + ], + "scenes": [ + { + "label": "ambience", + "state": { + "Hero Left": { + "brightness": { + "ControlValue": 195 + }, + "colour": { + "ColourValue": [255, 0, 245, 255] + }, + "pan": { + "ControlValue": 50 + }, + "tilt": { + "ControlValue": 30 + }, + "zoom": { + "ControlValue": 255 + } + }, + "Hero Right": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [49, 81, 255, 255] + }, + "pan": { + "ControlValue": 155 + }, + "tilt": { + "ControlValue": 80 + }, + "zoom": { + "ControlValue": 123 + } + }, + "Hex Left": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [0, 104, 255, 255] + }, + "pan": { + "ControlValue": 105 + }, + "tilt": { + "ControlValue": 80 + }, + "zoom": { + "ControlValue": 255 + } + }, + "Hex Right": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [243, 0, 255, 255] + }, + "pan": { + "ControlValue": 60 + }, + "tilt": { + "ControlValue": 25 + }, + "zoom": { + "ControlValue": 255 + } + } + } + }, + { + "label": "speaker", + "state": { + "Hero Left": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [37, 0, 243, 255] + }, + "pan": { + "ControlValue": 67 + }, + "tilt": { + "ControlValue": 92 + }, + "zoom": { + "ControlValue": 255 + } + }, + "Hero Right": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [237, 255, 0, 255] + }, + "pan": { + "ControlValue": 15 + }, + "tilt": { + "ControlValue": 73 + }, + "zoom": { + "ControlValue": 255 + } + }, + "Hex Left": { + "brightness": { + "ControlValue": 15 + }, + "colour": { + "ColourValue": [244, 222, 159, 255] + }, + "pan": { + "ControlValue": 60 + }, + "tilt": { + "ControlValue": 75 + }, + "zoom": { + "ControlValue": 120 + } + }, + "Hex Right": { + "brightness": { + "ControlValue": 15 + }, + "colour": { + "ColourValue": [255, 237, 220, 255] + }, + "pan": { + "ControlValue": 30 + }, + "tilt": { + "ControlValue": 180 + }, + "zoom": { + "ControlValue": 108 + } + } + } + }, + { + "label": "white down", + "state": { + "Hero Left": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [0, 0, 0, 0] + }, + "pan": { + "ControlValue": 193 + }, + "tilt": { + "ControlValue": 117 + }, + "zoom": { + "ControlValue": 118 + } + }, + "Hero Right": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [0, 0, 0, 0] + }, + "pan": { + "ControlValue": 205 + }, + "tilt": { + "ControlValue": 127 + }, + "zoom": { + "ControlValue": 110 + } + }, + "Hex Left": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [0, 0, 0, 0] + }, + "pan": { + "ControlValue": 82 + }, + "tilt": { + "ControlValue": 117 + }, + "zoom": { + "ControlValue": 255 + } + }, + "Hex Right": { + "brightness": { + "ControlValue": 255 + }, + "colour": { + "ColourValue": [0, 0, 0, 0] + }, + "pan": { + "ControlValue": 165 + }, + "tilt": { + "ControlValue": 128 + }, + "zoom": { + "ControlValue": 255 + } + } + } + } + ], + "midiConfig": { + "controllerStart": 48, + "noteStart": 49 + }, + "artnetConfig": { + "Unicast": ["10.0.0.105", "10.0.0.99"] + } +} diff --git a/fixtures/ADJ_Vizi_Hex_Wash7.json b/fixtures/ADJ_Vizi_Hex_Wash7.json index 228756f..9b75748 100644 --- a/fixtures/ADJ_Vizi_Hex_Wash7.json +++ b/fixtures/ADJ_Vizi_Hex_Wash7.json @@ -344,25 +344,25 @@ { "control": { "label": "brightness", - "channels": [19] + "channels": [{ "LoRes": 19 }] } }, { "control": { "label": "pan", - "channels": [1] + "channels": [{ "LoRes": 1 }] } }, { "control": { "label": "tilt", - "channels": [3] + "channels": [{ "LoRes": 3 }] } }, { "control": { "label": "zoom", - "channels": [21] + "channels": [{ "LoRes": 21 }] } } ] diff --git a/fixtures/Varytec_HERO_340FX.json b/fixtures/Varytec_HERO_340FX.json index 0ff36b6..8def809 100644 --- a/fixtures/Varytec_HERO_340FX.json +++ b/fixtures/Varytec_HERO_340FX.json @@ -169,7 +169,7 @@ { "control": { "label": "brightness", - "channels": [6] + "channels": [{ "LoRes": 6 }] } }, { @@ -189,19 +189,19 @@ { "control": { "label": "pan", - "channels": [1] + "channels": [{ "LoRes": 1 }] } }, { "control": { "label": "tilt", - "channels": [3] + "channels": [{ "LoRes": 3 }] } }, { "control": { "label": "zoom", - "channels": [14] + "channels": [{ "LoRes": 14 }] } } ] diff --git a/fixtures/Cameo_Opus_S5.json b/fixtures/todo/Cameo_Opus_S5.json similarity index 100% rename from fixtures/Cameo_Opus_S5.json rename to fixtures/todo/Cameo_Opus_S5.json diff --git a/fixtures/GLP_Impression_X5.json b/fixtures/todo/GLP_Impression_X5.json similarity index 100% rename from fixtures/GLP_Impression_X5.json rename to fixtures/todo/GLP_Impression_X5.json diff --git a/fixtures/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json b/fixtures/todo/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json similarity index 100% rename from fixtures/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json rename to fixtures/todo/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json diff --git a/src/all_fixtures.json b/src/all_fixtures.json index 32e8318..8f3e7cb 100644 --- a/src/all_fixtures.json +++ b/src/all_fixtures.json @@ -1,792 +1,5 @@ [ { - "name": "Cameo Opus S5", - "reference": "https://www.cameolight.com/de/loesungen/dj-musiker/bewegtes-licht/moving-heads/25591/movo-beam-200#detail-description", - "modes": [ - { - "name": "27CH Mode Standard", - "mappings": [ - { - "channel": 1, - "label": "Pan" - }, - { - "channel": 2, - "label": "Pan fine" - }, - { - "channel": 3, - "label": "Tilt" - }, - { - "channel": 4, - "label": "Tilt fine" - }, - { - "channel": 5, - "label": "Dimmer", - "home": 0 - }, - { - "channel": 6, - "label": "Dimmer fine" - }, - { - "channel": 7, - "label": "Strobe Functions", - "notes": "Multifunctional Strobe", - "ranges": [ - { - "range": [0, 5], - "label": "Strobe open" - }, - { - "range": [6, 10], - "label": "Strobe closed" - }, - { - "range": [11, 33], - "label": "Pulse Random, slow -> fast" - }, - { - "range": [34, 56], - "label": "Ramp up Random, slow -> fast" - }, - { - "range": [57, 79], - "label": "Ramp down Random, slow -> fast" - }, - { - "range": [80, 102], - "label": "Random Strobe Effect, slow -> fast" - }, - { - "range": [103, 127], - "label": "Strobe Break Effect, 5s -> 1s", - "notes": "(Short burst with break)" - }, - { - "range": [128, 250], - "label": "Strobe slow -> fast <1Hz - 20Hz" - }, - { - "range": [251, 255], - "label": "Strobe open" - } - ] - }, - { - "channel": 8, - "label": "Cyan" - }, - { - "channel": 9, - "label": "Magenta" - }, - { - "channel": 10, - "label": "Yellow" - }, - { - "channel": 11, - "label": "CTO", - "notes": "Colour Temperature Orange" - }, - { - "channel": 17, - "label": "Zoom", - "notes": "Narrow to wide" - }, - { - "channel": 18, - "label": "Focus", - "notes": "0% to 100% " - } - ], - "macros": [ - { - "control": { - "label": "brightness", - "channels": [5] - } - }, - { - "colour": { - "label": "colour", - "channels": { - "subtractive": { - "cyan": [8], - "magenta": [9], - "yellow": [10], - "white": [11] - } - } - } - }, - { - "control": { - "label": "pan", - "channels": [1] - } - }, - { - "control": { - "label": "tilt", - "channels": [3] - } - }, - { - "control": { - "label": "zoom", - "channels": [17] - } - }, - { - "control": { - "label": "focus", - "channels": [18] - } - } - ] - } - ] -} -,{ - "name": "GLP Impression X5", - "reference": "https://www.glp.de/en/products/entertainment-lighting/moving-lights-led/impression-x5", - "modes": [ - { - "name": "Mode 1: Basic", - "mappings": [ - { - "channel": 1, - "label": "Pan coarse", - "notes": "Pan left -> right" - }, - { - "channel": 2, - "label": "Pan fine", - "notes": "Pan left -> right" - }, - { - "channel": 3, - "label": "Tilt coarse", - "notes": "Tilt back -> front" - }, - { - "channel": 4, - "label": "Tilt fine", - "notes": "Tilt back -> front" - }, - { - "channel": 5, - "label": "Intensity coarse", - "notes": "Intensity 0 -> 100%", - "home": 0 - }, - { - "channel": 6, - "label": "Intensity fine", - "notes": "Intensity 0 -> 100%" - }, - { - "channel": 7, - "label": "Shutter", - "home": 255, - "ranges": [ - { - "range": [0, 4], - "label": "Closed" - }, - { - "range": [5, 9], - "label": "the range 005 -> 009" - }, - { - "range": [10, 39], - "label": "Pulse slow -> fast" - }, - { - "range": [40, 69], - "label": "Pulse opening slow -> fast" - }, - { - "range": [70, 99], - "label": "Pulse closing slow -> fast" - }, - { - "range": [100, 129], - "label": "Double flash slow -> fast" - }, - { - "range": [130, 159], - "label": "Strobe random pixel slow -> fast" - }, - { - "range": [160, 199], - "label": "Strobe random all slow -> fast" - }, - { - "range": [200, 250], - "label": "Strobe sync all pixels slow -> fast" - }, - { - "range": [251, 255], - "label": "Open" - } - ] - }, - { - "channel": 8, - "label": "Zoom", - "notes": "Zoom narrow -> wide" - }, - { - "channel": 9, - "label": "Control/Settings", - "notes": "See manual page 40" - }, - { - "channel": 10, - "label": "Accessory 1", - "notes": "Effect parameter 1" - }, - { - "channel": 11, - "label": "Accessory 2", - "notes": "Effect parameter 2" - }, - { - "channel": 12, - "label": "Coarse RGB Red / RGBL Red / x", - "notes": "DMX.x = x * 255 / 0.8" - }, - { - "channel": 13, - "label": "Fine RGB Red / RGBL Red / x", - "notes": "DMX.x = x * 65535 / 0.8" - }, - { - "channel": 14, - "label": "Coarse RGB Green / RGBL Green / y", - "notes": "DMX.y = y* 255 / 0.8" - }, - { - "channel": 15, - "label": "Fine RGB Green / RGBL Green / y", - "notes": "DMX.y = y * 65535 / 0.8" - }, - { - "channel": 16, - "label": "Coarse RGB Blue / RGBL Blue", - "notes": "x;y not used" - }, - { - "channel": 17, - "label": "Fine RGB Blue / RGBL Blue", - "notes": "x;y not used" - }, - { - "channel": 18, - "label": "Coarse Lime", - "notes": "RGB, x;y not used" - }, - { - "channel": 19, - "label": "Fine Lime", - "notes": "RGB, x;y not used" - }, - { - "channel": 20, - "label": "Colour Wheel", - "notes": "for exact colors see Color wheel specifications on page 48)", - "ranges": [ - { - "range": [0, 9], - "label": "Open (selected white point)" - }, - { - "range": [10, 12], - "label": "Filter 004, Medium Bastard Amber" - }, - { - "range": [13, 15], - "label": "Filter 019, Fire" - }, - { - "range": [16, 18], - "label": "Filter 025, Sunset Red" - }, - { - "range": [19, 21], - "label": "Filter 026, Bright Red" - }, - { - "range": [22, 24], - "label": "Filter 036, Medium Pink" - }, - { - "range": [25, 27], - "label": "Filter 049, Medium Purple" - }, - { - "range": [28, 30], - "label": "Filter 058, Lavender" - }, - { - "range": [31, 33], - "label": "Filter 068, Sky Blue" - }, - { - "range": [34, 36], - "label": "Filter 088, Lime Green" - }, - { - "range": [37, 39], - "label": "Filter 089, Moss Green" - }, - { - "range": [40, 42], - "label": "Filter 090, Dark Yellow Green" - }, - { - "range": [43, 45], - "label": "Filter 102, Light Amber" - }, - { - "range": [46, 48], - "label": "Filter 103, Straw" - }, - { - "range": [49, 51], - "label": "Filter 106, Primary Red" - }, - { - "range": [52, 54], - "label": "Filter 111, Dark Pink" - }, - { - "range": [55, 57], - "label": "Filter 115, Peacock Blue" - }, - { - "range": [58, 60], - "label": "Filter 117, Steel Blue" - }, - { - "range": [61, 63], - "label": "Filter 118, Light Blue" - }, - { - "range": [64, 66], - "label": "Filter 121, Filter Green" - }, - { - "range": [67, 69], - "label": "Filter 122, Fern Green" - }, - { - "range": [70, 72], - "label": "Filter 124, Dark Green" - }, - { - "range": [73, 75], - "label": "Filter 126, Mauve" - }, - { - "range": [76, 78], - "label": "Filter 128, Bright Pink" - }, - { - "range": [79, 81], - "label": "Filter 131, Marine Blue" - }, - { - "range": [82, 84], - "label": "Filter 132, Medium Blue" - }, - { - "range": [85, 87], - "label": "Filter 134, Golden Amber" - }, - { - "range": [88, 90], - "label": "Filter 135, Deep Golden Amber" - }, - { - "range": [91, 93], - "label": "Filter 136, Pale Lavender" - }, - { - "range": [94, 96], - "label": "Filter 137, Special Lavender" - }, - { - "range": [97, 99], - "label": "Filter 138, Pale Green" - }, - { - "range": [100, 102], - "label": "Filter 140, Summer Blue" - }, - { - "range": [103, 105], - "label": "Filter 141, Bright Blue" - }, - { - "range": [106, 108], - "label": "Filter 143, Pale Navy Blue" - }, - { - "range": [109, 111], - "label": "Filter 147, Apricot" - }, - { - "range": [112, 114], - "label": "Filter 148, Bright Rose" - }, - { - "range": [115, 117], - "label": "Filter 152, Pale Gold" - }, - { - "range": [118, 120], - "label": "Filter 154, Pale Rose" - }, - { - "range": [121, 123], - "label": "Filter 157, Pink" - }, - { - "range": [124, 126], - "label": "Filter 162, Bastard Amber" - }, - { - "range": [127, 129], - "label": "Filter 164, Flame Red" - }, - { - "range": [130, 132], - "label": "Filter 165, Daylight Blue" - }, - { - "range": [133, 135], - "label": "Filter 169, Lilac Tint" - }, - { - "range": [136, 138], - "label": "Filter 170, Deep Lavender" - }, - { - "range": [139, 141], - "label": "Filter 172, Lagoon Blue" - }, - { - "range": [142, 144], - "label": "Filter 180, Dark Lavender" - }, - { - "range": [145, 147], - "label": "Filter 182, Light Red" - }, - { - "range": [148, 150], - "label": "Filter 194, Surprise Pink" - }, - { - "range": [151, 153], - "label": "Filter 197, Alice Blue" - }, - { - "range": [154, 156], - "label": "Filter 201, Full C.T. Blue" - }, - { - "range": [157, 159], - "label": "Filter 202, Half C.T. Blue" - }, - { - "range": [160, 162], - "label": "Filter 203, Quarter C.T. Blue" - }, - { - "range": [163, 165], - "label": "Filter 204, Full C.T. Orange" - }, - { - "range": [166, 168], - "label": "Filter 206, Quartet C.T. Orange" - }, - { - "range": [169, 171], - "label": "Filter 219, Fluorescent Green" - }, - { - "range": [172, 174], - "label": "Filter 247, Filter Minus Green" - }, - { - "range": [175, 177], - "label": "Filter 248, Half Minus Green" - }, - { - "range": [178, 180], - "label": "Filter 281, Three Quarter C.T. Blue" - }, - { - "range": [181, 183], - "label": "Filter 285, Three Quarter C.T. Orang" - }, - { - "range": [184, 186], - "label": "Filter 352, Glacier Blue" - }, - { - "range": [187, 189], - "label": "Filter 353, Lighter Blue" - }, - { - "range": [190, 192], - "label": "Filter 506, Madge" - }, - { - "range": [193, 195], - "label": "Filter 778, Millennium Gold" - }, - { - "range": [196, 198], - "label": "Filter 793, Vanity Fair" - }, - { - "range": [199, 201], - "label": "Filter 798, Chrysalis Pink" - }, - { - "range": [202, 204], - "label": "HSI scroll, stop at first color" - }, - { - "range": [205, 252], - "label": "HSI scroll slow -> fast" - }, - { - "range": [253, 255], - "label": "HSI scroll, stop at current color" - } - ] - }, - { - "channel": 21, - "label": "Colour Temperature Control", - "ranges": [ - { - "range": [0, 9], - "label": "Open" - }, - { - "range": [10, 255], - "label": "Fade through color temperatures", - "notes": "10,000K to 2,500K stepless interpolation" - } - ] - }, - { - "channel": 22, - "label": "CQC Saturation", - "notes": "Color Quality Control", - "ranges": [ - { - "range": [0, 9], - "label": "HQ (high quality), saturated color" - }, - { - "range": [10, 117], - "label": "Crossfade, saturated to unsaturated" - }, - { - "range": [118, 127], - "label": "HQ (high quality), unsaturated color" - }, - { - "range": [128, 137], - "label": "HO (high output), unsaturated color" - }, - { - "range": [138, 245], - "label": "Crossfade, unsaturated to saturated" - }, - { - "range": [246, 255], - "label": "HO (high output), saturated color" - } - ] - }, - { - "channel": 23, - "label": "M/G shift", - "ranges": [ - { - "range": [0, 9], - "label": "Off (no correction)" - }, - { - "range": [10, 10], - "label": "Full plus magenta +100%" - }, - { - "range": [11, 124], - "label": "Plus magenta +99% -> +1%" - }, - { - "range": [125, 140], - "label": "Neutral / no correction" - }, - { - "range": [141, 254], - "label": "Plus green +1% -> +99%" - }, - { - "range": [255, 255], - "label": "Full plus green +100%" - } - ] - }, - { - "channel": 24, - "label": "Tungsten simulation", - "ranges": [ - { - "range": [0, 9], - "label": "Off" - }, - { - "range": [10, 19], - "label": "Tungsten ACL 250W/28V" - }, - { - "range": [20, 29], - "label": "Tungsten Blinder 650W/120V" - }, - { - "range": [30, 39], - "label": "Tungsten 750W/80V" - }, - { - "range": [40, 49], - "label": "Tungsten 1000W/240V" - }, - { - "range": [50, 59], - "label": "Tungsten 1200W/240V" - }, - { - "range": [60, 69], - "label": "Tungsten 2000W/230V" - }, - { - "range": [70, 79], - "label": "Tungsten 2500W/230V" - }, - { - "range": [80, 89], - "label": "Tungsten 5000W/230V" - }, - { - "range": [90, 120], - "label": "No function (off)" - }, - { - "range": [121, 139], - "label": "Off" - }, - { - "range": [140, 149], - "label": "FX Tungsten ACL 250W/28V" - }, - { - "range": [150, 159], - "label": "FX Tungsten Blinder 650W/120V" - }, - { - "range": [160, 169], - "label": "FX Tungsten 750W/80V" - }, - { - "range": [170, 179], - "label": "FX Tungsten 1000W/240V" - }, - { - "range": [180, 189], - "label": "FX Tungsten 1200W/240V" - }, - { - "range": [190, 199], - "label": "FX Tungsten 2000W/230V" - }, - { - "range": [200, 209], - "label": "FX Tungsten 2500W/230V" - }, - { - "range": [210, 219], - "label": "FX Tungsten 5000W/230V" - }, - { - "range": [220, 255], - "label": "No function (off)" - } - ] - } - ], - "macros": [ - { - "control": { - "label": "brightness", - "channels": [5] - } - }, - { - "colour": { - "label": "colour", - "channels": { - "additive": { - "red": [12], - "green": [14], - "blue": [16], - "white": [18] - } - } - } - }, - { - "control": { - "label": "pan", - "channels": [1] - } - }, - { - "control": { - "label": "tilt", - "channels": [3] - } - }, - { - "control": { - "label": "zoom", - "channels": [8] - } - }, - { - "control": { - "label": "shutter", - "channels": [7] - } - } - ] - } - ] -} -,{ "name": "ADJ Vizi Hex Wash 7", "reference": "http://adjmedia.s3-website-eu-west-1.amazonaws.com/manuals/ADJ%20Vizi%20Hex%20Wash7%20User%20Manual.pdf", "modes": [ @@ -1132,112 +345,25 @@ { "control": { "label": "brightness", - "channels": [19] + "channels": [{ "LoRes": 19 }] } }, { "control": { "label": "pan", - "channels": [1] + "channels": [{ "LoRes": 1 }] } }, { "control": { "label": "tilt", - "channels": [3] + "channels": [{ "LoRes": 3 }] } }, { "control": { "label": "zoom", - "channels": [21] - } - } - ] - } - ] -} -,{ - "name": "SHEHDS LED Flat PAR 12x3W RGBW", - "reference": "https://open-fixture-library.org/shehds/led-flat-par-12x3w-rgbw", - "modes": [ - { - "name": "8-channel mode", - "mappings": [ - { - "channel": 1, - "label": "Intensity dimmer", - "notes": "from dark (0) to bright (255)" - }, - { - "channel": 2, - "label": "Intensity red", - "notes": "from dark (0) to bright (255)" - }, - { - "channel": 3, - "label": "Intensity green", - "notes": "from dark (0) to bright (255)" - }, - { - "channel": 4, - "label": "Intensity blue", - "notes": "from dark (0) to bright (255)" - }, - { - "channel": 5, - "label": "Intensity white", - "notes": "from dark (0) to bright (255)" - }, - { - "channel": 6, - "label": "Strobe", - "notes": "from fast (0) to slow (255)" - }, - { - "channel": 7, - "label": "Intensity red", - "notes": "from dark (0) to bright (255)" - }, - { - "channel": 7, - "label": "Auto and sound programs", - "home": 0, - "ranges": [ - { - "range": [0, 250], - "label": "Auto modes" - }, - { - "range": [251, 255], - "label": "Sound modes" - } - ] - }, - { - "channel": 8, - "label": "Control speed for auto + sound programs", - "notes": "from slow (0) to fast (255)" - } - ], - "macros": [ - { - "control": { - "label": "brightness", - "channels": [1] - } - }, - { - "colour": { - "label": "colour", - "channels": { - "additive": { - "red": [2], - "green": [3], - "blue": [4], - "white": [5] - } - } + "channels": [{ "LoRes": 21 }] } } ] @@ -1415,7 +541,7 @@ { "control": { "label": "brightness", - "channels": [6] + "channels": [{ "LoRes": 6 }] } }, { @@ -1435,19 +561,19 @@ { "control": { "label": "pan", - "channels": [1] + "channels": [{ "LoRes": 1 }] } }, { "control": { "label": "tilt", - "channels": [3] + "channels": [{ "LoRes": 3 }] } }, { "control": { "label": "zoom", - "channels": [14] + "channels": [{ "LoRes": 14 }] } } ] diff --git a/src/artnet.rs b/src/artnet.rs index 6bc851e..827aa3e 100644 --- a/src/artnet.rs +++ b/src/artnet.rs @@ -9,7 +9,10 @@ use log::{debug, trace}; use rand::Rng; use crate::{ - project::fixture::{CMYChannels, ChannelList, FixtureInstance, FixtureMacro, RGBWChannels}, + project::fixture::{ + CMYChannels, ChannelList, ChannelWithResolution, FixtureInstance, FixtureMacro, + RGBWChannels, + }, settings::CHANNELS_PER_UNIVERSE, }; @@ -95,8 +98,25 @@ impl ArtNetInterface { match m { FixtureMacro::Control(control_macro) => { for c in &control_macro.channels { - self.channels[(*c - 1 + f.offset_channels) as usize] = - control_macro.current_value; + match c { + ChannelWithResolution::LoRes(single_channel) => { + let target_channel = + (*single_channel - 1 + f.offset_channels) as usize; + debug!( + "Apply LoRes value to single fixture macro (channel {}) => {}, value {}", + single_channel, + target_channel, + control_macro.current_value + ); + self.channels[target_channel] = + control_macro.current_value as u8; + } + ChannelWithResolution::HiRes((c1, c2)) => { + let [b1, b2] = control_macro.current_value.to_be_bytes(); + self.channels[(*c1 - 1 + f.offset_channels) as usize] = b1; + self.channels[(*c2 - 1 + f.offset_channels) as usize] = b2; + } + } } } FixtureMacro::Colour(colour_macro) => { diff --git a/src/model.rs b/src/model.rs index 22875bb..32691b2 100644 --- a/src/model.rs +++ b/src/model.rs @@ -218,8 +218,9 @@ impl Model { FixtureMacro::Control(control_macro) => { if let Some(animation) = &mut control_macro.animation { let (value, is_done) = animation.get_value_and_done(); - let dmx_value = (value * 255.0) as u8; - control_macro.current_value = dmx_value; + let int_value = (value * 255.0) as u16; + + control_macro.current_value = int_value; // NB: Check if done AFTER applying value if is_done { @@ -293,7 +294,7 @@ impl Model { FixtureMacro::Control(control_macro) => { let value = value * 2; debug!("Adjust {} to {}", &control_macro.label, value); - control_macro.current_value = value; + control_macro.current_value = value as u16; } FixtureMacro::Colour(colour_macro) => { let value = value * 2; @@ -319,7 +320,7 @@ impl Model { match m { FixtureMacro::Control(control_macro) => { if index == control_macro.global_index { - control_macro.current_value = (255.0 * position) as u8; + control_macro.current_value = (255.0 * position) as u16; } } FixtureMacro::Colour(_colour_macro) => { diff --git a/src/project/fixture.rs b/src/project/fixture.rs index 6d86559..aa5456b 100644 --- a/src/project/fixture.rs +++ b/src/project/fixture.rs @@ -84,12 +84,18 @@ pub struct Mapping { pub ranges: Option>, } +#[derive(Serialize, Deserialize, Clone)] +pub enum ChannelWithResolution { + LoRes(u16), + HiRes((u16, u16)), +} + #[derive(Serialize, Deserialize)] -pub struct ChannelMacro { +pub struct ValueMacro { pub label: String, - pub channels: Vec, + pub channels: Vec, #[serde(skip)] - pub current_value: u8, + pub current_value: u16, #[serde(skip)] pub animation: Option, #[serde(skip)] @@ -97,7 +103,7 @@ pub struct ChannelMacro { } // Cloning an Animation is tricky, and we don't need it anyway -impl Clone for ChannelMacro { +impl Clone for ValueMacro { fn clone(&self) -> Self { Self { label: self.label.clone(), @@ -160,7 +166,7 @@ impl Clone for ColourMacro { #[derive(Serialize, Deserialize, Clone)] #[serde(rename_all = "camelCase")] pub enum FixtureMacro { - Control(ChannelMacro), + Control(ValueMacro), Colour(ColourMacro), } diff --git a/src/project/scene.rs b/src/project/scene.rs index c707a8e..bc2e1ca 100644 --- a/src/project/scene.rs +++ b/src/project/scene.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug)] pub enum SceneValue { - ControlValue(u8), + ControlValue(u16), ColourValue(Color32), } diff --git a/src/tether_interface.rs b/src/tether_interface.rs index ab9f5c2..781bc7d 100644 --- a/src/tether_interface.rs +++ b/src/tether_interface.rs @@ -36,7 +36,7 @@ pub struct TetherKnobPayload { #[derive(Serialize, Deserialize, Debug)] pub enum RemoteMacroValue { - ControlValue(u8), + ControlValue(u16), ColourValue(Color32), } diff --git a/src/ui/macro_controls.rs b/src/ui/macro_controls.rs index 1126e4a..33ea2c2 100644 --- a/src/ui/macro_controls.rs +++ b/src/ui/macro_controls.rs @@ -57,44 +57,45 @@ pub fn render_macro_controls(model: &mut Model, ui: &mut Ui) { for m in current_mode.macros.iter_mut() { match m { FixtureMacro::Control(control_macro) => { - let remapped_channels: Vec = control_macro - .channels - .iter() - .map(|c| c + fixture.offset_channels) - .collect(); - let channel_list = format!( - "{:?} => {:?}", - &control_macro.channels, remapped_channels - ); - ui.label(&control_macro.label).on_hover_text(channel_list); - if ui - .add_enabled( - control_macro.animation.is_none(), - Slider::new( - &mut control_macro.current_value, - 0..=255, - ) - .step_by(1.0), - ) - .changed() - { - model.apply_macros = true; - any_changed = true; - }; - ui.small(control_macro.global_index.to_string()); + todo!("Need to handle lores and hires values"); + // let remapped_channels: Vec = control_macro + // .channels + // .iter() + // .map(|c| c + fixture.offset_channels) + // .collect(); + // let channel_list = format!( + // "{:?} => {:?}", + // &control_macro.channels, remapped_channels + // ); + // ui.label(&control_macro.label).on_hover_text(channel_list); + // if ui + // .add_enabled( + // control_macro.animation.is_none(), + // Slider::new( + // &mut control_macro.current_value, + // 0..=255, + // ) + // .step_by(1.0), + // ) + // .changed() + // { + // model.apply_macros = true; + // any_changed = true; + // }; + // ui.small(control_macro.global_index.to_string()); - if let Some(animation) = &mut control_macro.animation { - ui.label( - RichText::new(format!( - "{}%", - (animation.get_progress() * 100.) as u8 - )) - .color(Color32::GREEN) - .small(), - ); - } else { - ui.label(""); - } + // if let Some(animation) = &mut control_macro.animation { + // ui.label( + // RichText::new(format!( + // "{}%", + // (animation.get_progress() * 100.) as u8 + // )) + // .color(Color32::GREEN) + // .small(), + // ); + // } else { + // ui.label(""); + // } } FixtureMacro::Colour(colour_macro) => { ui.label(&colour_macro.label); From cf0058d6177a398eac19f37eb6c385de21ee5230 Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Mon, 23 Dec 2024 16:43:11 +0100 Subject: [PATCH 2/9] POC high res brightness control (remote, not UI) --- fixtures/ADJ_Vizi_Hex_Wash7.json | 2 +- src/all_fixtures.json | 2 +- src/artnet.rs | 12 ++++++++---- src/model.rs | 3 ++- src/tether_interface.rs | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/fixtures/ADJ_Vizi_Hex_Wash7.json b/fixtures/ADJ_Vizi_Hex_Wash7.json index 9b75748..3dce46b 100644 --- a/fixtures/ADJ_Vizi_Hex_Wash7.json +++ b/fixtures/ADJ_Vizi_Hex_Wash7.json @@ -344,7 +344,7 @@ { "control": { "label": "brightness", - "channels": [{ "LoRes": 19 }] + "channels": [{ "HiRes": [19, 20] }] } }, { diff --git a/src/all_fixtures.json b/src/all_fixtures.json index 8f3e7cb..489b220 100644 --- a/src/all_fixtures.json +++ b/src/all_fixtures.json @@ -345,7 +345,7 @@ { "control": { "label": "brightness", - "channels": [{ "LoRes": 19 }] + "channels": [{ "HiRes": [19, 20] }] } }, { diff --git a/src/artnet.rs b/src/artnet.rs index 827aa3e..07ea3bd 100644 --- a/src/artnet.rs +++ b/src/artnet.rs @@ -102,14 +102,18 @@ impl ArtNetInterface { ChannelWithResolution::LoRes(single_channel) => { let target_channel = (*single_channel - 1 + f.offset_channels) as usize; + let scaled_value = ((control_macro.current_value as f32 + / u16::MAX as f32) + * 255.0) + as u8; debug!( - "Apply LoRes value to single fixture macro (channel {}) => {}, value {}", + "Apply LoRes value to single fixture macro (channel {}) => {}, value {} => {}", single_channel, target_channel, - control_macro.current_value + control_macro.current_value, + scaled_value ); - self.channels[target_channel] = - control_macro.current_value as u8; + self.channels[target_channel] = scaled_value; } ChannelWithResolution::HiRes((c1, c2)) => { let [b1, b2] = control_macro.current_value.to_be_bytes(); diff --git a/src/model.rs b/src/model.rs index 32691b2..d3a2b61 100644 --- a/src/model.rs +++ b/src/model.rs @@ -379,7 +379,8 @@ impl Model { "No animation; immediately go to Control Macro value" ); control_macro.animation = None; // cancel first - control_macro.current_value = target_value; + control_macro.current_value = + (target_value * (u16::MAX as f64)) as u16; } } RemoteMacroValue::ColourValue(_) => { diff --git a/src/tether_interface.rs b/src/tether_interface.rs index 781bc7d..df44d34 100644 --- a/src/tether_interface.rs +++ b/src/tether_interface.rs @@ -36,7 +36,7 @@ pub struct TetherKnobPayload { #[derive(Serialize, Deserialize, Debug)] pub enum RemoteMacroValue { - ControlValue(u16), + ControlValue(f64), ColourValue(Color32), } From 7a6da9fc399b8a052174e3fed2dd31b0f792b826 Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Tue, 24 Dec 2024 11:37:49 +0100 Subject: [PATCH 3/9] working HiRes controls, all fixture definitions updated --- README.md | 3 +- example.hires.json | 2 +- fixtures/ADJ_Vizi_Hex_Wash7.json | 158 +-- fixtures/{todo => }/Cameo_Opus_S5.json | 12 +- fixtures/{todo => }/GLP_Impression_X5.json | 10 +- .../SHEHDS_LED_Flat_PAR_12x3W_RGBW.json | 2 +- fixtures/Varytec_HERO_340FX.json | 4 +- src/all_fixtures.json | 1036 +++++++++++++++-- src/artnet.rs | 3 + src/ui/macro_controls.rs | 57 +- 10 files changed, 1082 insertions(+), 205 deletions(-) rename fixtures/{todo => }/Cameo_Opus_S5.json (92%) rename fixtures/{todo => }/GLP_Impression_X5.json (98%) rename fixtures/{todo => }/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json (98%) diff --git a/README.md b/README.md index dca2435..e2a9e04 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,9 @@ If you have Tether Egui installed (`cargo install tether-egui`) then the easiest - [x] Allow the app to launch just fine without Tether - [x] If no ArtNet provided in Project (and no settings provided from CLI), then do NOT connect, but allow editing / manual connect - [x] Allow Tether settings to be saved with project as well +- [ ] Add amber Macros for some fixtures (and include these in scenes) - [ ] Keep project files sorted, e.g. by fixtures - [x] Allow the app to launch without any project file at all -- [ ] Add 16-bit control, at least for macros (single slider adjusts the two channels as split between first and second 8-bit digits) +- [x] Add 16-bit control, at least for macros (single slider adjusts the two channels as split between first and second 8-bit digits) - [ ] ArtNet on separate thread, with more precise timing; this might require some messaging back and forth and/or mutex - [ ] It should be possible to add Macros from "Advanced Mode" into the available macros for the fixtures (and therefore the scenes). This would be part of a fixture-editing UI? diff --git a/example.hires.json b/example.hires.json index a1ccb7f..6632dd1 100644 --- a/example.hires.json +++ b/example.hires.json @@ -251,6 +251,6 @@ "noteStart": 49 }, "artnetConfig": { - "Unicast": ["10.0.0.105", "10.0.0.99"] + "Unicast": ["127.0.0.1", "127.0.0.1"] } } diff --git a/fixtures/ADJ_Vizi_Hex_Wash7.json b/fixtures/ADJ_Vizi_Hex_Wash7.json index 3dce46b..169f930 100644 --- a/fixtures/ADJ_Vizi_Hex_Wash7.json +++ b/fixtures/ADJ_Vizi_Hex_Wash7.json @@ -7,322 +7,322 @@ "mappings": [ { "channel": 1, - "label": "PAN MOVEMENT 8bit", + "label": "Pan Movement 8 Bit", "notes": "(540° or 630°)" }, { "channel": 2, - "label": "PAN MOVEMENT FINE 16bit" + "label": "Pan Movement Fine 16 Bit" }, { "channel": 3, - "label": "TILT MOVEMENT 8bit", + "label": "Tilt Movement 8 Bit", "home": 128 }, { "channel": 4, - "label": "TILT MOVEMENT FINE 16bit" + "label": "Tilt Movement Fine 16 Bit" }, { "channel": 5, - "label": "RED CENTER LED", + "label": "Red Center LED", "notes": "0% - 100%" }, { "channel": 6, - "label": "GREEN CENTER LED", + "label": "Green Center LED", "notes": "0% - 100%" }, { "channel": 7, - "label": "BLUE CENTER LED", + "label": "Blue Center LED", "notes": "0% - 100%" }, { "channel": 8, - "label": "WHITE CENTER LED", + "label": "White Center LED", "notes": "0% - 100%" }, { "channel": 9, - "label": "AMBER CENTER LED", + "label": "Amber Center LED", "notes": "0% - 100%" }, { "channel": 10, - "label": "UV CENTER LED", + "label": "Uv Center LED", "notes": "0% - 100%" }, { "channel": 11, - "label": "RED OUTER LEDs", + "label": "Red Outer LEDs", "notes": "0% - 100%" }, { "channel": 12, - "label": "GREEN OUTER LEDs", + "label": "Green Outer LEDs", "notes": "0% - 100%" }, { "channel": 13, - "label": "BLUE OUTER LEDs", + "label": "Blue Outer LEDs", "notes": "0% - 100%" }, { "channel": 14, - "label": "WHITE OUTER LEDs", + "label": "White Outer LEDs", "notes": "0% - 100%" }, { "channel": 15, - "label": "AMBER OUTER LEDs", + "label": "Amber Outer LEDs", "notes": "0% - 100%" }, { "channel": 16, - "label": "UV OUTER LEDs", + "label": "Uv Outer LEDs", "notes": "0% - 100%" }, { "channel": 17, - "label": "COLOR MACROS" + "label": "Color Macros" }, { "channel": 18, - "label": "SHUTTER/STROBE", + "label": "Shutter/strobe", "home": 255, "ranges": [ { "range": [0, 31], - "label": "LED OFF" + "label": "LED Off" }, { "range": [32, 63], - "label": "LED ON" + "label": "LED On" }, { "range": [64, 95], - "label": "STROBING SPEED", + "label": "Strobing Speed", "notes": "SLOW - FAST" }, { "range": [96, 127], - "label": "LED ON" + "label": "LED On" }, { "range": [128, 159], - "label": "STROBE PULSE SPEED", + "label": "Strobe Pulse Speed", "notes": "SLOW - FAST" }, { "range": [160, 191], - "label": "LED ON" + "label": "LED On" }, { "range": [192, 223], - "label": "RANDOM STROBE SPEED", + "label": "Random Strobe Speed", "notes": "SLOW - FAST" }, { "range": [224, 255], - "label": "LED ON" + "label": "LED On" } ] }, { "channel": 19, - "label": "MASTER DIMMER", + "label": "Master Dimmer", "home": 0 }, { "channel": 20, - "label": "DIMMER FINE" + "label": "Dimmer Fine" }, { "channel": 21, - "label": "ZOOM", + "label": "Zoom", "notes": "7° - 58°" }, { "channel": 22, - "label": "AUTO PROGRAMS", + "label": "Auto Programs", "ranges": [ { "range": [0, 0], - "label": "OFF" + "label": "Off" }, { "range": [1, 20], - "label": "PROGRAM 1" + "label": "Program 1" }, { "range": [1, 20], - "label": "PROGRAM 2" + "label": "Program 2" }, { "range": [21, 40], - "label": "PROGRAM 3" + "label": "Program 3" }, { "range": [61, 80], - "label": "PROGRAM 4" + "label": "Program 4" }, { "range": [81, 100], - "label": "PROGRAM 5" + "label": "Program 5" }, { "range": [101, 120], - "label": "PROGRAM 6" + "label": "Program 6" }, { "range": [121, 140], - "label": "PROGRAM 7" + "label": "Program 7" }, { "range": [141, 160], - "label": "PROGRAM 8" + "label": "Program 8" }, { "range": [161, 180], - "label": "PROGRAM 9" + "label": "Program 9" }, { "range": [181, 200], - "label": "PROGRAM 10" + "label": "Program 10" }, { "range": [201, 220], - "label": "PROGRAM 11" + "label": "Program 11" }, { "range": [221, 240], - "label": "PROGRAM 12" + "label": "Program 12" }, { "range": [241, 250], - "label": "PROGRAM 13" + "label": "Program 13" }, { "range": [251, 255], - "label": "PROGRAM 14" + "label": "Program 14" } ] }, { "channel": 23, - "label": "PROGRAM SPEED", + "label": "Program Speed", "notes": "SLOW - FAST" }, { "channel": 24, - "label": "AUTO PROGRAM FADE", + "label": "Auto Program Fade", "ranges": [ { "range": [0, 0], - "label": "NORMAL" + "label": "Normal" }, { "range": [1, 255], - "label": "SLOW - FAST" + "label": "Slow Fast" } ] }, { "channel": 25, - "label": "DIMMER MODE", + "label": "Dimmer Mode", "ranges": [ { "range": [0, 20], - "label": "STANDARD" + "label": "Standard" }, { "range": [21, 40], - "label": "STAGE" + "label": "Stage" }, { "range": [41, 60], - "label": "TV" + "label": "Tv" }, { "range": [61, 80], - "label": "ARCHITECTRUAL" + "label": "Architectrual" }, { "range": [81, 100], - "label": "THEATRE" + "label": "Theatre" }, { "range": [100, 255], - "label": "DEFAULT DIMMER SETTING" + "label": "Default Dimmer Setting" } ] }, { "channel": 26, - "label": "PAN/TILT SPEED", + "label": "Pan/tilt Speed", "ranges": [ { "range": [0, 225], - "label": "FAST - SLOW" + "label": "Fast Slow" }, { "range": [226, 235], - "label": "BLACKOUT BY MOVEMENT" + "label": "Blackout By Movement" }, { "range": [236, 255], - "label": "NO FUNCTION" + "label": "No Function" } ] }, { "channel": 27, - "label": "AUTO PROGRAMS", + "label": "Auto Programs", "ranges": [ { "range": [0, 79], - "label": "NORMAL" + "label": "Normal" }, { "range": [80, 84], - "label": "ALL MOTOR RESET" + "label": "All Motor Reset" }, { "range": [85, 99], - "label": "NO FUNCTION" + "label": "No Function" }, { "range": [101, 119], - "label": "INTERNAL PROGRAM 1" + "label": "Internal Program 1" }, { "range": [120, 139], - "label": "INTERNAL PROGRAM 2" + "label": "Internal Program 2" }, { "range": [130, 159], - "label": "INTERNAL PROGRAM 3" + "label": "Internal Program 3" }, { "range": [160, 179], - "label": "INTERNAL PROGRAM 4" + "label": "Internal Program 4" }, { "range": [180, 199], - "label": "INTERNAL PROGRAM 5" + "label": "Internal Program 5" }, { "range": [200, 219], - "label": "INTERNAL PROGRAM 6" + "label": "Internal Program 6" }, { "range": [220, 239], - "label": "INTERNAL PROGRAM 7" + "label": "Internal Program 7" }, { "range": [240, 255], - "label": "NO FUNCTION" + "label": "No Function" } ] } @@ -330,7 +330,7 @@ "macros": [ { "colour": { - "label": "colour", + "label": "Colour", "channels": { "additive": { "red": [5, 11], @@ -343,25 +343,25 @@ }, { "control": { - "label": "brightness", + "label": "Brightness", "channels": [{ "HiRes": [19, 20] }] } }, { "control": { - "label": "pan", - "channels": [{ "LoRes": 1 }] + "label": "Pan", + "channels": [{ "HiRes": [1, 2] }] } }, { "control": { - "label": "tilt", - "channels": [{ "LoRes": 3 }] + "label": "Tilt", + "channels": [{ "HiRes": [3, 4] }] } }, { "control": { - "label": "zoom", + "label": "Zoom", "channels": [{ "LoRes": 21 }] } } diff --git a/fixtures/todo/Cameo_Opus_S5.json b/fixtures/Cameo_Opus_S5.json similarity index 92% rename from fixtures/todo/Cameo_Opus_S5.json rename to fixtures/Cameo_Opus_S5.json index 1e85283..336cfb0 100644 --- a/fixtures/todo/Cameo_Opus_S5.json +++ b/fixtures/Cameo_Opus_S5.json @@ -99,14 +99,14 @@ { "channel": 18, "label": "Focus", - "notes": "0% to 100% " + "notes": "0% to 100%" } ], "macros": [ { "control": { "label": "brightness", - "channels": [5] + "channels": [{ "HiRes": [5, 6] }] } }, { @@ -125,25 +125,25 @@ { "control": { "label": "pan", - "channels": [1] + "channels": [{ "HiRes": [1, 2] }] } }, { "control": { "label": "tilt", - "channels": [3] + "channels": [{ "HiRes": [3, 4] }] } }, { "control": { "label": "zoom", - "channels": [17] + "channels": [{ "LoRes": 17 }] } }, { "control": { "label": "focus", - "channels": [18] + "channels": [{ "LoRes": 18 }] } } ] diff --git a/fixtures/todo/GLP_Impression_X5.json b/fixtures/GLP_Impression_X5.json similarity index 98% rename from fixtures/todo/GLP_Impression_X5.json rename to fixtures/GLP_Impression_X5.json index da3039e..b73e08d 100644 --- a/fixtures/todo/GLP_Impression_X5.json +++ b/fixtures/GLP_Impression_X5.json @@ -589,7 +589,7 @@ { "control": { "label": "brightness", - "channels": [5] + "channels": [{ "HiRes": [5, 6] }] } }, { @@ -608,25 +608,25 @@ { "control": { "label": "pan", - "channels": [1] + "channels": [{ "HiRes": [1, 2] }] } }, { "control": { "label": "tilt", - "channels": [3] + "channels": [{ "HiRes": [3, 4] }] } }, { "control": { "label": "zoom", - "channels": [8] + "channels": [{ "LoRes": 8 }] } }, { "control": { "label": "shutter", - "channels": [7] + "channels": [{ "LoRes": 7 }] } } ] diff --git a/fixtures/todo/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json b/fixtures/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json similarity index 98% rename from fixtures/todo/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json rename to fixtures/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json index f7618ce..0f25362 100644 --- a/fixtures/todo/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json +++ b/fixtures/SHEHDS_LED_Flat_PAR_12x3W_RGBW.json @@ -65,7 +65,7 @@ { "control": { "label": "brightness", - "channels": [1] + "channels": [{ "LoRes": 1 }] } }, { diff --git a/fixtures/Varytec_HERO_340FX.json b/fixtures/Varytec_HERO_340FX.json index 8def809..34d3344 100644 --- a/fixtures/Varytec_HERO_340FX.json +++ b/fixtures/Varytec_HERO_340FX.json @@ -189,13 +189,13 @@ { "control": { "label": "pan", - "channels": [{ "LoRes": 1 }] + "channels": [{ "HiRes": [1, 2] }] } }, { "control": { "label": "tilt", - "channels": [{ "LoRes": 3 }] + "channels": [{ "HiRes": [3, 4] }] } }, { diff --git a/src/all_fixtures.json b/src/all_fixtures.json index 489b220..673fb4c 100644 --- a/src/all_fixtures.json +++ b/src/all_fixtures.json @@ -1,5 +1,792 @@ [ { + "name": "Cameo Opus S5", + "reference": "https://www.cameolight.com/de/loesungen/dj-musiker/bewegtes-licht/moving-heads/25591/movo-beam-200#detail-description", + "modes": [ + { + "name": "27CH Mode Standard", + "mappings": [ + { + "channel": 1, + "label": "Pan" + }, + { + "channel": 2, + "label": "Pan fine" + }, + { + "channel": 3, + "label": "Tilt" + }, + { + "channel": 4, + "label": "Tilt fine" + }, + { + "channel": 5, + "label": "Dimmer", + "home": 0 + }, + { + "channel": 6, + "label": "Dimmer fine" + }, + { + "channel": 7, + "label": "Strobe Functions", + "notes": "Multifunctional Strobe", + "ranges": [ + { + "range": [0, 5], + "label": "Strobe open" + }, + { + "range": [6, 10], + "label": "Strobe closed" + }, + { + "range": [11, 33], + "label": "Pulse Random, slow -> fast" + }, + { + "range": [34, 56], + "label": "Ramp up Random, slow -> fast" + }, + { + "range": [57, 79], + "label": "Ramp down Random, slow -> fast" + }, + { + "range": [80, 102], + "label": "Random Strobe Effect, slow -> fast" + }, + { + "range": [103, 127], + "label": "Strobe Break Effect, 5s -> 1s", + "notes": "(Short burst with break)" + }, + { + "range": [128, 250], + "label": "Strobe slow -> fast <1Hz - 20Hz" + }, + { + "range": [251, 255], + "label": "Strobe open" + } + ] + }, + { + "channel": 8, + "label": "Cyan" + }, + { + "channel": 9, + "label": "Magenta" + }, + { + "channel": 10, + "label": "Yellow" + }, + { + "channel": 11, + "label": "CTO", + "notes": "Colour Temperature Orange" + }, + { + "channel": 17, + "label": "Zoom", + "notes": "Narrow to wide" + }, + { + "channel": 18, + "label": "Focus", + "notes": "0% to 100%" + } + ], + "macros": [ + { + "control": { + "label": "brightness", + "channels": [{ "HiRes": [5, 6] }] + } + }, + { + "colour": { + "label": "colour", + "channels": { + "subtractive": { + "cyan": [8], + "magenta": [9], + "yellow": [10], + "white": [11] + } + } + } + }, + { + "control": { + "label": "pan", + "channels": [{ "HiRes": [1, 2] }] + } + }, + { + "control": { + "label": "tilt", + "channels": [{ "HiRes": [3, 4] }] + } + }, + { + "control": { + "label": "zoom", + "channels": [{ "LoRes": 17 }] + } + }, + { + "control": { + "label": "focus", + "channels": [{ "LoRes": 18 }] + } + } + ] + } + ] +} +,{ + "name": "GLP Impression X5", + "reference": "https://www.glp.de/en/products/entertainment-lighting/moving-lights-led/impression-x5", + "modes": [ + { + "name": "Mode 1: Basic", + "mappings": [ + { + "channel": 1, + "label": "Pan coarse", + "notes": "Pan left -> right" + }, + { + "channel": 2, + "label": "Pan fine", + "notes": "Pan left -> right" + }, + { + "channel": 3, + "label": "Tilt coarse", + "notes": "Tilt back -> front" + }, + { + "channel": 4, + "label": "Tilt fine", + "notes": "Tilt back -> front" + }, + { + "channel": 5, + "label": "Intensity coarse", + "notes": "Intensity 0 -> 100%", + "home": 0 + }, + { + "channel": 6, + "label": "Intensity fine", + "notes": "Intensity 0 -> 100%" + }, + { + "channel": 7, + "label": "Shutter", + "home": 255, + "ranges": [ + { + "range": [0, 4], + "label": "Closed" + }, + { + "range": [5, 9], + "label": "the range 005 -> 009" + }, + { + "range": [10, 39], + "label": "Pulse slow -> fast" + }, + { + "range": [40, 69], + "label": "Pulse opening slow -> fast" + }, + { + "range": [70, 99], + "label": "Pulse closing slow -> fast" + }, + { + "range": [100, 129], + "label": "Double flash slow -> fast" + }, + { + "range": [130, 159], + "label": "Strobe random pixel slow -> fast" + }, + { + "range": [160, 199], + "label": "Strobe random all slow -> fast" + }, + { + "range": [200, 250], + "label": "Strobe sync all pixels slow -> fast" + }, + { + "range": [251, 255], + "label": "Open" + } + ] + }, + { + "channel": 8, + "label": "Zoom", + "notes": "Zoom narrow -> wide" + }, + { + "channel": 9, + "label": "Control/Settings", + "notes": "See manual page 40" + }, + { + "channel": 10, + "label": "Accessory 1", + "notes": "Effect parameter 1" + }, + { + "channel": 11, + "label": "Accessory 2", + "notes": "Effect parameter 2" + }, + { + "channel": 12, + "label": "Coarse RGB Red / RGBL Red / x", + "notes": "DMX.x = x * 255 / 0.8" + }, + { + "channel": 13, + "label": "Fine RGB Red / RGBL Red / x", + "notes": "DMX.x = x * 65535 / 0.8" + }, + { + "channel": 14, + "label": "Coarse RGB Green / RGBL Green / y", + "notes": "DMX.y = y* 255 / 0.8" + }, + { + "channel": 15, + "label": "Fine RGB Green / RGBL Green / y", + "notes": "DMX.y = y * 65535 / 0.8" + }, + { + "channel": 16, + "label": "Coarse RGB Blue / RGBL Blue", + "notes": "x;y not used" + }, + { + "channel": 17, + "label": "Fine RGB Blue / RGBL Blue", + "notes": "x;y not used" + }, + { + "channel": 18, + "label": "Coarse Lime", + "notes": "RGB, x;y not used" + }, + { + "channel": 19, + "label": "Fine Lime", + "notes": "RGB, x;y not used" + }, + { + "channel": 20, + "label": "Colour Wheel", + "notes": "for exact colors see Color wheel specifications on page 48)", + "ranges": [ + { + "range": [0, 9], + "label": "Open (selected white point)" + }, + { + "range": [10, 12], + "label": "Filter 004, Medium Bastard Amber" + }, + { + "range": [13, 15], + "label": "Filter 019, Fire" + }, + { + "range": [16, 18], + "label": "Filter 025, Sunset Red" + }, + { + "range": [19, 21], + "label": "Filter 026, Bright Red" + }, + { + "range": [22, 24], + "label": "Filter 036, Medium Pink" + }, + { + "range": [25, 27], + "label": "Filter 049, Medium Purple" + }, + { + "range": [28, 30], + "label": "Filter 058, Lavender" + }, + { + "range": [31, 33], + "label": "Filter 068, Sky Blue" + }, + { + "range": [34, 36], + "label": "Filter 088, Lime Green" + }, + { + "range": [37, 39], + "label": "Filter 089, Moss Green" + }, + { + "range": [40, 42], + "label": "Filter 090, Dark Yellow Green" + }, + { + "range": [43, 45], + "label": "Filter 102, Light Amber" + }, + { + "range": [46, 48], + "label": "Filter 103, Straw" + }, + { + "range": [49, 51], + "label": "Filter 106, Primary Red" + }, + { + "range": [52, 54], + "label": "Filter 111, Dark Pink" + }, + { + "range": [55, 57], + "label": "Filter 115, Peacock Blue" + }, + { + "range": [58, 60], + "label": "Filter 117, Steel Blue" + }, + { + "range": [61, 63], + "label": "Filter 118, Light Blue" + }, + { + "range": [64, 66], + "label": "Filter 121, Filter Green" + }, + { + "range": [67, 69], + "label": "Filter 122, Fern Green" + }, + { + "range": [70, 72], + "label": "Filter 124, Dark Green" + }, + { + "range": [73, 75], + "label": "Filter 126, Mauve" + }, + { + "range": [76, 78], + "label": "Filter 128, Bright Pink" + }, + { + "range": [79, 81], + "label": "Filter 131, Marine Blue" + }, + { + "range": [82, 84], + "label": "Filter 132, Medium Blue" + }, + { + "range": [85, 87], + "label": "Filter 134, Golden Amber" + }, + { + "range": [88, 90], + "label": "Filter 135, Deep Golden Amber" + }, + { + "range": [91, 93], + "label": "Filter 136, Pale Lavender" + }, + { + "range": [94, 96], + "label": "Filter 137, Special Lavender" + }, + { + "range": [97, 99], + "label": "Filter 138, Pale Green" + }, + { + "range": [100, 102], + "label": "Filter 140, Summer Blue" + }, + { + "range": [103, 105], + "label": "Filter 141, Bright Blue" + }, + { + "range": [106, 108], + "label": "Filter 143, Pale Navy Blue" + }, + { + "range": [109, 111], + "label": "Filter 147, Apricot" + }, + { + "range": [112, 114], + "label": "Filter 148, Bright Rose" + }, + { + "range": [115, 117], + "label": "Filter 152, Pale Gold" + }, + { + "range": [118, 120], + "label": "Filter 154, Pale Rose" + }, + { + "range": [121, 123], + "label": "Filter 157, Pink" + }, + { + "range": [124, 126], + "label": "Filter 162, Bastard Amber" + }, + { + "range": [127, 129], + "label": "Filter 164, Flame Red" + }, + { + "range": [130, 132], + "label": "Filter 165, Daylight Blue" + }, + { + "range": [133, 135], + "label": "Filter 169, Lilac Tint" + }, + { + "range": [136, 138], + "label": "Filter 170, Deep Lavender" + }, + { + "range": [139, 141], + "label": "Filter 172, Lagoon Blue" + }, + { + "range": [142, 144], + "label": "Filter 180, Dark Lavender" + }, + { + "range": [145, 147], + "label": "Filter 182, Light Red" + }, + { + "range": [148, 150], + "label": "Filter 194, Surprise Pink" + }, + { + "range": [151, 153], + "label": "Filter 197, Alice Blue" + }, + { + "range": [154, 156], + "label": "Filter 201, Full C.T. Blue" + }, + { + "range": [157, 159], + "label": "Filter 202, Half C.T. Blue" + }, + { + "range": [160, 162], + "label": "Filter 203, Quarter C.T. Blue" + }, + { + "range": [163, 165], + "label": "Filter 204, Full C.T. Orange" + }, + { + "range": [166, 168], + "label": "Filter 206, Quartet C.T. Orange" + }, + { + "range": [169, 171], + "label": "Filter 219, Fluorescent Green" + }, + { + "range": [172, 174], + "label": "Filter 247, Filter Minus Green" + }, + { + "range": [175, 177], + "label": "Filter 248, Half Minus Green" + }, + { + "range": [178, 180], + "label": "Filter 281, Three Quarter C.T. Blue" + }, + { + "range": [181, 183], + "label": "Filter 285, Three Quarter C.T. Orang" + }, + { + "range": [184, 186], + "label": "Filter 352, Glacier Blue" + }, + { + "range": [187, 189], + "label": "Filter 353, Lighter Blue" + }, + { + "range": [190, 192], + "label": "Filter 506, Madge" + }, + { + "range": [193, 195], + "label": "Filter 778, Millennium Gold" + }, + { + "range": [196, 198], + "label": "Filter 793, Vanity Fair" + }, + { + "range": [199, 201], + "label": "Filter 798, Chrysalis Pink" + }, + { + "range": [202, 204], + "label": "HSI scroll, stop at first color" + }, + { + "range": [205, 252], + "label": "HSI scroll slow -> fast" + }, + { + "range": [253, 255], + "label": "HSI scroll, stop at current color" + } + ] + }, + { + "channel": 21, + "label": "Colour Temperature Control", + "ranges": [ + { + "range": [0, 9], + "label": "Open" + }, + { + "range": [10, 255], + "label": "Fade through color temperatures", + "notes": "10,000K to 2,500K stepless interpolation" + } + ] + }, + { + "channel": 22, + "label": "CQC Saturation", + "notes": "Color Quality Control", + "ranges": [ + { + "range": [0, 9], + "label": "HQ (high quality), saturated color" + }, + { + "range": [10, 117], + "label": "Crossfade, saturated to unsaturated" + }, + { + "range": [118, 127], + "label": "HQ (high quality), unsaturated color" + }, + { + "range": [128, 137], + "label": "HO (high output), unsaturated color" + }, + { + "range": [138, 245], + "label": "Crossfade, unsaturated to saturated" + }, + { + "range": [246, 255], + "label": "HO (high output), saturated color" + } + ] + }, + { + "channel": 23, + "label": "M/G shift", + "ranges": [ + { + "range": [0, 9], + "label": "Off (no correction)" + }, + { + "range": [10, 10], + "label": "Full plus magenta +100%" + }, + { + "range": [11, 124], + "label": "Plus magenta +99% -> +1%" + }, + { + "range": [125, 140], + "label": "Neutral / no correction" + }, + { + "range": [141, 254], + "label": "Plus green +1% -> +99%" + }, + { + "range": [255, 255], + "label": "Full plus green +100%" + } + ] + }, + { + "channel": 24, + "label": "Tungsten simulation", + "ranges": [ + { + "range": [0, 9], + "label": "Off" + }, + { + "range": [10, 19], + "label": "Tungsten ACL 250W/28V" + }, + { + "range": [20, 29], + "label": "Tungsten Blinder 650W/120V" + }, + { + "range": [30, 39], + "label": "Tungsten 750W/80V" + }, + { + "range": [40, 49], + "label": "Tungsten 1000W/240V" + }, + { + "range": [50, 59], + "label": "Tungsten 1200W/240V" + }, + { + "range": [60, 69], + "label": "Tungsten 2000W/230V" + }, + { + "range": [70, 79], + "label": "Tungsten 2500W/230V" + }, + { + "range": [80, 89], + "label": "Tungsten 5000W/230V" + }, + { + "range": [90, 120], + "label": "No function (off)" + }, + { + "range": [121, 139], + "label": "Off" + }, + { + "range": [140, 149], + "label": "FX Tungsten ACL 250W/28V" + }, + { + "range": [150, 159], + "label": "FX Tungsten Blinder 650W/120V" + }, + { + "range": [160, 169], + "label": "FX Tungsten 750W/80V" + }, + { + "range": [170, 179], + "label": "FX Tungsten 1000W/240V" + }, + { + "range": [180, 189], + "label": "FX Tungsten 1200W/240V" + }, + { + "range": [190, 199], + "label": "FX Tungsten 2000W/230V" + }, + { + "range": [200, 209], + "label": "FX Tungsten 2500W/230V" + }, + { + "range": [210, 219], + "label": "FX Tungsten 5000W/230V" + }, + { + "range": [220, 255], + "label": "No function (off)" + } + ] + } + ], + "macros": [ + { + "control": { + "label": "brightness", + "channels": [{ "HiRes": [5, 6] }] + } + }, + { + "colour": { + "label": "colour", + "channels": { + "additive": { + "red": [12], + "green": [14], + "blue": [16], + "white": [18] + } + } + } + }, + { + "control": { + "label": "pan", + "channels": [{ "HiRes": [1, 2] }] + } + }, + { + "control": { + "label": "tilt", + "channels": [{ "HiRes": [3, 4] }] + } + }, + { + "control": { + "label": "zoom", + "channels": [{ "LoRes": 8 }] + } + }, + { + "control": { + "label": "shutter", + "channels": [{ "LoRes": 7 }] + } + } + ] + } + ] +} +,{ "name": "ADJ Vizi Hex Wash 7", "reference": "http://adjmedia.s3-website-eu-west-1.amazonaws.com/manuals/ADJ%20Vizi%20Hex%20Wash7%20User%20Manual.pdf", "modes": [ @@ -8,322 +795,322 @@ "mappings": [ { "channel": 1, - "label": "PAN MOVEMENT 8bit", + "label": "Pan Movement 8 Bit", "notes": "(540° or 630°)" }, { "channel": 2, - "label": "PAN MOVEMENT FINE 16bit" + "label": "Pan Movement Fine 16 Bit" }, { "channel": 3, - "label": "TILT MOVEMENT 8bit", + "label": "Tilt Movement 8 Bit", "home": 128 }, { "channel": 4, - "label": "TILT MOVEMENT FINE 16bit" + "label": "Tilt Movement Fine 16 Bit" }, { "channel": 5, - "label": "RED CENTER LED", + "label": "Red Center LED", "notes": "0% - 100%" }, { "channel": 6, - "label": "GREEN CENTER LED", + "label": "Green Center LED", "notes": "0% - 100%" }, { "channel": 7, - "label": "BLUE CENTER LED", + "label": "Blue Center LED", "notes": "0% - 100%" }, { "channel": 8, - "label": "WHITE CENTER LED", + "label": "White Center LED", "notes": "0% - 100%" }, { "channel": 9, - "label": "AMBER CENTER LED", + "label": "Amber Center LED", "notes": "0% - 100%" }, { "channel": 10, - "label": "UV CENTER LED", + "label": "Uv Center LED", "notes": "0% - 100%" }, { "channel": 11, - "label": "RED OUTER LEDs", + "label": "Red Outer LEDs", "notes": "0% - 100%" }, { "channel": 12, - "label": "GREEN OUTER LEDs", + "label": "Green Outer LEDs", "notes": "0% - 100%" }, { "channel": 13, - "label": "BLUE OUTER LEDs", + "label": "Blue Outer LEDs", "notes": "0% - 100%" }, { "channel": 14, - "label": "WHITE OUTER LEDs", + "label": "White Outer LEDs", "notes": "0% - 100%" }, { "channel": 15, - "label": "AMBER OUTER LEDs", + "label": "Amber Outer LEDs", "notes": "0% - 100%" }, { "channel": 16, - "label": "UV OUTER LEDs", + "label": "Uv Outer LEDs", "notes": "0% - 100%" }, { "channel": 17, - "label": "COLOR MACROS" + "label": "Color Macros" }, { "channel": 18, - "label": "SHUTTER/STROBE", + "label": "Shutter/strobe", "home": 255, "ranges": [ { "range": [0, 31], - "label": "LED OFF" + "label": "LED Off" }, { "range": [32, 63], - "label": "LED ON" + "label": "LED On" }, { "range": [64, 95], - "label": "STROBING SPEED", + "label": "Strobing Speed", "notes": "SLOW - FAST" }, { "range": [96, 127], - "label": "LED ON" + "label": "LED On" }, { "range": [128, 159], - "label": "STROBE PULSE SPEED", + "label": "Strobe Pulse Speed", "notes": "SLOW - FAST" }, { "range": [160, 191], - "label": "LED ON" + "label": "LED On" }, { "range": [192, 223], - "label": "RANDOM STROBE SPEED", + "label": "Random Strobe Speed", "notes": "SLOW - FAST" }, { "range": [224, 255], - "label": "LED ON" + "label": "LED On" } ] }, { "channel": 19, - "label": "MASTER DIMMER", + "label": "Master Dimmer", "home": 0 }, { "channel": 20, - "label": "DIMMER FINE" + "label": "Dimmer Fine" }, { "channel": 21, - "label": "ZOOM", + "label": "Zoom", "notes": "7° - 58°" }, { "channel": 22, - "label": "AUTO PROGRAMS", + "label": "Auto Programs", "ranges": [ { "range": [0, 0], - "label": "OFF" + "label": "Off" }, { "range": [1, 20], - "label": "PROGRAM 1" + "label": "Program 1" }, { "range": [1, 20], - "label": "PROGRAM 2" + "label": "Program 2" }, { "range": [21, 40], - "label": "PROGRAM 3" + "label": "Program 3" }, { "range": [61, 80], - "label": "PROGRAM 4" + "label": "Program 4" }, { "range": [81, 100], - "label": "PROGRAM 5" + "label": "Program 5" }, { "range": [101, 120], - "label": "PROGRAM 6" + "label": "Program 6" }, { "range": [121, 140], - "label": "PROGRAM 7" + "label": "Program 7" }, { "range": [141, 160], - "label": "PROGRAM 8" + "label": "Program 8" }, { "range": [161, 180], - "label": "PROGRAM 9" + "label": "Program 9" }, { "range": [181, 200], - "label": "PROGRAM 10" + "label": "Program 10" }, { "range": [201, 220], - "label": "PROGRAM 11" + "label": "Program 11" }, { "range": [221, 240], - "label": "PROGRAM 12" + "label": "Program 12" }, { "range": [241, 250], - "label": "PROGRAM 13" + "label": "Program 13" }, { "range": [251, 255], - "label": "PROGRAM 14" + "label": "Program 14" } ] }, { "channel": 23, - "label": "PROGRAM SPEED", + "label": "Program Speed", "notes": "SLOW - FAST" }, { "channel": 24, - "label": "AUTO PROGRAM FADE", + "label": "Auto Program Fade", "ranges": [ { "range": [0, 0], - "label": "NORMAL" + "label": "Normal" }, { "range": [1, 255], - "label": "SLOW - FAST" + "label": "Slow Fast" } ] }, { "channel": 25, - "label": "DIMMER MODE", + "label": "Dimmer Mode", "ranges": [ { "range": [0, 20], - "label": "STANDARD" + "label": "Standard" }, { "range": [21, 40], - "label": "STAGE" + "label": "Stage" }, { "range": [41, 60], - "label": "TV" + "label": "Tv" }, { "range": [61, 80], - "label": "ARCHITECTRUAL" + "label": "Architectrual" }, { "range": [81, 100], - "label": "THEATRE" + "label": "Theatre" }, { "range": [100, 255], - "label": "DEFAULT DIMMER SETTING" + "label": "Default Dimmer Setting" } ] }, { "channel": 26, - "label": "PAN/TILT SPEED", + "label": "Pan/tilt Speed", "ranges": [ { "range": [0, 225], - "label": "FAST - SLOW" + "label": "Fast Slow" }, { "range": [226, 235], - "label": "BLACKOUT BY MOVEMENT" + "label": "Blackout By Movement" }, { "range": [236, 255], - "label": "NO FUNCTION" + "label": "No Function" } ] }, { "channel": 27, - "label": "AUTO PROGRAMS", + "label": "Auto Programs", "ranges": [ { "range": [0, 79], - "label": "NORMAL" + "label": "Normal" }, { "range": [80, 84], - "label": "ALL MOTOR RESET" + "label": "All Motor Reset" }, { "range": [85, 99], - "label": "NO FUNCTION" + "label": "No Function" }, { "range": [101, 119], - "label": "INTERNAL PROGRAM 1" + "label": "Internal Program 1" }, { "range": [120, 139], - "label": "INTERNAL PROGRAM 2" + "label": "Internal Program 2" }, { "range": [130, 159], - "label": "INTERNAL PROGRAM 3" + "label": "Internal Program 3" }, { "range": [160, 179], - "label": "INTERNAL PROGRAM 4" + "label": "Internal Program 4" }, { "range": [180, 199], - "label": "INTERNAL PROGRAM 5" + "label": "Internal Program 5" }, { "range": [200, 219], - "label": "INTERNAL PROGRAM 6" + "label": "Internal Program 6" }, { "range": [220, 239], - "label": "INTERNAL PROGRAM 7" + "label": "Internal Program 7" }, { "range": [240, 255], - "label": "NO FUNCTION" + "label": "No Function" } ] } @@ -331,7 +1118,7 @@ "macros": [ { "colour": { - "label": "colour", + "label": "Colour", "channels": { "additive": { "red": [5, 11], @@ -344,25 +1131,25 @@ }, { "control": { - "label": "brightness", + "label": "Brightness", "channels": [{ "HiRes": [19, 20] }] } }, { "control": { - "label": "pan", - "channels": [{ "LoRes": 1 }] + "label": "Pan", + "channels": [{ "HiRes": [1, 2] }] } }, { "control": { - "label": "tilt", - "channels": [{ "LoRes": 3 }] + "label": "Tilt", + "channels": [{ "HiRes": [3, 4] }] } }, { "control": { - "label": "zoom", + "label": "Zoom", "channels": [{ "LoRes": 21 }] } } @@ -370,6 +1157,93 @@ } ] } +,{ + "name": "SHEHDS LED Flat PAR 12x3W RGBW", + "reference": "https://open-fixture-library.org/shehds/led-flat-par-12x3w-rgbw", + "modes": [ + { + "name": "8-channel mode", + "mappings": [ + { + "channel": 1, + "label": "Intensity dimmer", + "notes": "from dark (0) to bright (255)" + }, + { + "channel": 2, + "label": "Intensity red", + "notes": "from dark (0) to bright (255)" + }, + { + "channel": 3, + "label": "Intensity green", + "notes": "from dark (0) to bright (255)" + }, + { + "channel": 4, + "label": "Intensity blue", + "notes": "from dark (0) to bright (255)" + }, + { + "channel": 5, + "label": "Intensity white", + "notes": "from dark (0) to bright (255)" + }, + { + "channel": 6, + "label": "Strobe", + "notes": "from fast (0) to slow (255)" + }, + { + "channel": 7, + "label": "Intensity red", + "notes": "from dark (0) to bright (255)" + }, + { + "channel": 7, + "label": "Auto and sound programs", + "home": 0, + "ranges": [ + { + "range": [0, 250], + "label": "Auto modes" + }, + { + "range": [251, 255], + "label": "Sound modes" + } + ] + }, + { + "channel": 8, + "label": "Control speed for auto + sound programs", + "notes": "from slow (0) to fast (255)" + } + ], + "macros": [ + { + "control": { + "label": "brightness", + "channels": [{ "LoRes": 1 }] + } + }, + { + "colour": { + "label": "colour", + "channels": { + "additive": { + "red": [2], + "green": [3], + "blue": [4], + "white": [5] + } + } + } + } + ] + } + ] +} ,{ "name": "Varytec HERO 340FX", "reference": "https://images.thomann.de/pics/atg/atgdata/document/manual/449224_c_449223_v2_en_online.pdf", @@ -561,13 +1435,13 @@ { "control": { "label": "pan", - "channels": [{ "LoRes": 1 }] + "channels": [{ "HiRes": [1, 2] }] } }, { "control": { "label": "tilt", - "channels": [{ "LoRes": 3 }] + "channels": [{ "HiRes": [3, 4] }] } }, { diff --git a/src/artnet.rs b/src/artnet.rs index 07ea3bd..8eec548 100644 --- a/src/artnet.rs +++ b/src/artnet.rs @@ -116,8 +116,11 @@ impl ArtNetInterface { self.channels[target_channel] = scaled_value; } ChannelWithResolution::HiRes((c1, c2)) => { + // Assume coarse+fine 16-bit values are "big endian" (be): let [b1, b2] = control_macro.current_value.to_be_bytes(); + // coarse channel: self.channels[(*c1 - 1 + f.offset_channels) as usize] = b1; + // fine channel: self.channels[(*c2 - 1 + f.offset_channels) as usize] = b2; } } diff --git a/src/ui/macro_controls.rs b/src/ui/macro_controls.rs index 33ea2c2..e4da5ab 100644 --- a/src/ui/macro_controls.rs +++ b/src/ui/macro_controls.rs @@ -57,7 +57,6 @@ pub fn render_macro_controls(model: &mut Model, ui: &mut Ui) { for m in current_mode.macros.iter_mut() { match m { FixtureMacro::Control(control_macro) => { - todo!("Need to handle lores and hires values"); // let remapped_channels: Vec = control_macro // .channels // .iter() @@ -67,35 +66,35 @@ pub fn render_macro_controls(model: &mut Model, ui: &mut Ui) { // "{:?} => {:?}", // &control_macro.channels, remapped_channels // ); - // ui.label(&control_macro.label).on_hover_text(channel_list); - // if ui - // .add_enabled( - // control_macro.animation.is_none(), - // Slider::new( - // &mut control_macro.current_value, - // 0..=255, - // ) - // .step_by(1.0), - // ) - // .changed() - // { - // model.apply_macros = true; - // any_changed = true; - // }; - // ui.small(control_macro.global_index.to_string()); + ui.label(&control_macro.label); + // .on_hover_text(channel_list); + if ui + .add_enabled( + control_macro.animation.is_none(), + Slider::new( + &mut control_macro.current_value, + 0..=u16::MAX, + ), + ) + .changed() + { + model.apply_macros = true; + any_changed = true; + }; + ui.small(control_macro.global_index.to_string()); - // if let Some(animation) = &mut control_macro.animation { - // ui.label( - // RichText::new(format!( - // "{}%", - // (animation.get_progress() * 100.) as u8 - // )) - // .color(Color32::GREEN) - // .small(), - // ); - // } else { - // ui.label(""); - // } + if let Some(animation) = &mut control_macro.animation { + ui.label( + RichText::new(format!( + "{}%", + (animation.get_progress() * 100.) as u8 + )) + .color(Color32::GREEN) + .small(), + ); + } else { + ui.label(""); + } } FixtureMacro::Colour(colour_macro) => { ui.label(&colour_macro.label); From e37cc3c6ac8fc8c921c02e7deb129c13779b63da Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Tue, 24 Dec 2024 11:42:36 +0100 Subject: [PATCH 4/9] HiRes is the definitive example now --- example.hires.json | 256 ------------------------------------------- example.project.json | 91 +++------------ 2 files changed, 14 insertions(+), 333 deletions(-) delete mode 100644 example.hires.json diff --git a/example.hires.json b/example.hires.json deleted file mode 100644 index 6632dd1..0000000 --- a/example.hires.json +++ /dev/null @@ -1,256 +0,0 @@ -{ - "fixtures": [ - { - "label": "Hero Left", - "configName": "Varytec HERO 340FX", - "offsetChannels": 27, - "modeIndex": 0 - }, - { - "label": "Hero Right", - "configName": "Varytec HERO 340FX", - "offsetChannels": 70, - "modeIndex": 0 - }, - { - "label": "Hex Left", - "configName": "ADJ Vizi Hex Wash 7", - "offsetChannels": 43, - "modeIndex": 0 - }, - { - "label": "Hex Right", - "configName": "ADJ Vizi Hex Wash 7", - "offsetChannels": 0, - "modeIndex": 0 - } - ], - "scenes": [ - { - "label": "ambience", - "state": { - "Hero Left": { - "brightness": { - "ControlValue": 195 - }, - "colour": { - "ColourValue": [255, 0, 245, 255] - }, - "pan": { - "ControlValue": 50 - }, - "tilt": { - "ControlValue": 30 - }, - "zoom": { - "ControlValue": 255 - } - }, - "Hero Right": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [49, 81, 255, 255] - }, - "pan": { - "ControlValue": 155 - }, - "tilt": { - "ControlValue": 80 - }, - "zoom": { - "ControlValue": 123 - } - }, - "Hex Left": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [0, 104, 255, 255] - }, - "pan": { - "ControlValue": 105 - }, - "tilt": { - "ControlValue": 80 - }, - "zoom": { - "ControlValue": 255 - } - }, - "Hex Right": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [243, 0, 255, 255] - }, - "pan": { - "ControlValue": 60 - }, - "tilt": { - "ControlValue": 25 - }, - "zoom": { - "ControlValue": 255 - } - } - } - }, - { - "label": "speaker", - "state": { - "Hero Left": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [37, 0, 243, 255] - }, - "pan": { - "ControlValue": 67 - }, - "tilt": { - "ControlValue": 92 - }, - "zoom": { - "ControlValue": 255 - } - }, - "Hero Right": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [237, 255, 0, 255] - }, - "pan": { - "ControlValue": 15 - }, - "tilt": { - "ControlValue": 73 - }, - "zoom": { - "ControlValue": 255 - } - }, - "Hex Left": { - "brightness": { - "ControlValue": 15 - }, - "colour": { - "ColourValue": [244, 222, 159, 255] - }, - "pan": { - "ControlValue": 60 - }, - "tilt": { - "ControlValue": 75 - }, - "zoom": { - "ControlValue": 120 - } - }, - "Hex Right": { - "brightness": { - "ControlValue": 15 - }, - "colour": { - "ColourValue": [255, 237, 220, 255] - }, - "pan": { - "ControlValue": 30 - }, - "tilt": { - "ControlValue": 180 - }, - "zoom": { - "ControlValue": 108 - } - } - } - }, - { - "label": "white down", - "state": { - "Hero Left": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [0, 0, 0, 0] - }, - "pan": { - "ControlValue": 193 - }, - "tilt": { - "ControlValue": 117 - }, - "zoom": { - "ControlValue": 118 - } - }, - "Hero Right": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [0, 0, 0, 0] - }, - "pan": { - "ControlValue": 205 - }, - "tilt": { - "ControlValue": 127 - }, - "zoom": { - "ControlValue": 110 - } - }, - "Hex Left": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [0, 0, 0, 0] - }, - "pan": { - "ControlValue": 82 - }, - "tilt": { - "ControlValue": 117 - }, - "zoom": { - "ControlValue": 255 - } - }, - "Hex Right": { - "brightness": { - "ControlValue": 255 - }, - "colour": { - "ColourValue": [0, 0, 0, 0] - }, - "pan": { - "ControlValue": 165 - }, - "tilt": { - "ControlValue": 128 - }, - "zoom": { - "ControlValue": 255 - } - } - } - } - ], - "midiConfig": { - "controllerStart": 48, - "noteStart": 49 - }, - "artnetConfig": { - "Unicast": ["127.0.0.1", "127.0.0.1"] - } -} diff --git a/example.project.json b/example.project.json index 51151bb..6632dd1 100644 --- a/example.project.json +++ b/example.project.json @@ -34,12 +34,7 @@ "ControlValue": 195 }, "colour": { - "ColourValue": [ - 255, - 0, - 245, - 255 - ] + "ColourValue": [255, 0, 245, 255] }, "pan": { "ControlValue": 50 @@ -56,12 +51,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 49, - 81, - 255, - 255 - ] + "ColourValue": [49, 81, 255, 255] }, "pan": { "ControlValue": 155 @@ -78,12 +68,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 0, - 104, - 255, - 255 - ] + "ColourValue": [0, 104, 255, 255] }, "pan": { "ControlValue": 105 @@ -100,12 +85,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 243, - 0, - 255, - 255 - ] + "ColourValue": [243, 0, 255, 255] }, "pan": { "ControlValue": 60 @@ -127,12 +107,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 37, - 0, - 243, - 255 - ] + "ColourValue": [37, 0, 243, 255] }, "pan": { "ControlValue": 67 @@ -149,12 +124,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 237, - 255, - 0, - 255 - ] + "ColourValue": [237, 255, 0, 255] }, "pan": { "ControlValue": 15 @@ -171,12 +141,7 @@ "ControlValue": 15 }, "colour": { - "ColourValue": [ - 244, - 222, - 159, - 255 - ] + "ColourValue": [244, 222, 159, 255] }, "pan": { "ControlValue": 60 @@ -193,12 +158,7 @@ "ControlValue": 15 }, "colour": { - "ColourValue": [ - 255, - 237, - 220, - 255 - ] + "ColourValue": [255, 237, 220, 255] }, "pan": { "ControlValue": 30 @@ -220,12 +180,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 0, - 0, - 0, - 0 - ] + "ColourValue": [0, 0, 0, 0] }, "pan": { "ControlValue": 193 @@ -242,12 +197,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 0, - 0, - 0, - 0 - ] + "ColourValue": [0, 0, 0, 0] }, "pan": { "ControlValue": 205 @@ -264,12 +214,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 0, - 0, - 0, - 0 - ] + "ColourValue": [0, 0, 0, 0] }, "pan": { "ControlValue": 82 @@ -286,12 +231,7 @@ "ControlValue": 255 }, "colour": { - "ColourValue": [ - 0, - 0, - 0, - 0 - ] + "ColourValue": [0, 0, 0, 0] }, "pan": { "ControlValue": 165 @@ -311,9 +251,6 @@ "noteStart": 49 }, "artnetConfig": { - "Unicast": [ - "127.0.0.1", - "127.0.0.1" - ] + "Unicast": ["127.0.0.1", "127.0.0.1"] } -} \ No newline at end of file +} From adfd2fd20e63f2de539d7c266d51a47a9ce8f70f Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Tue, 24 Dec 2024 11:51:16 +0100 Subject: [PATCH 5/9] MIDI values need to be converted for u16 macros, too --- src/model.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/model.rs b/src/model.rs index d3a2b61..4d42b07 100644 --- a/src/model.rs +++ b/src/model.rs @@ -292,9 +292,14 @@ impl Model { { Some(m) => match m { FixtureMacro::Control(control_macro) => { - let value = value * 2; - debug!("Adjust {} to {}", &control_macro.label, value); - control_macro.current_value = value as u16; + // MIDI uses 7-bit, i.e. 0-127 + let converted_value: u16 = + ((value as f32 / 127.0) * u16::MAX as f32) as u16; + debug!( + "Adjust {} to {}", + &control_macro.label, converted_value + ); + control_macro.current_value = converted_value; } FixtureMacro::Colour(colour_macro) => { let value = value * 2; @@ -320,7 +325,8 @@ impl Model { match m { FixtureMacro::Control(control_macro) => { if index == control_macro.global_index { - control_macro.current_value = (255.0 * position) as u16; + control_macro.current_value = + (u16::MAX as f32 * position) as u16; } } FixtureMacro::Colour(_colour_macro) => { From 2f8db64172863b0424d63fe2bdabacf845a640bc Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Tue, 24 Dec 2024 11:52:35 +0100 Subject: [PATCH 6/9] more readable conversion --- src/model.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/model.rs b/src/model.rs index 4d42b07..ff4183a 100644 --- a/src/model.rs +++ b/src/model.rs @@ -293,8 +293,9 @@ impl Model { Some(m) => match m { FixtureMacro::Control(control_macro) => { // MIDI uses 7-bit, i.e. 0-127 + let percentage = value as f32 / 127.0; let converted_value: u16 = - ((value as f32 / 127.0) * u16::MAX as f32) as u16; + (percentage * u16::MAX as f32) as u16; debug!( "Adjust {} to {}", &control_macro.label, converted_value From 08eb9083f7830b975a274bcaf0f2678726351aa4 Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Tue, 24 Dec 2024 11:57:23 +0100 Subject: [PATCH 7/9] Animations only need to be f32 --- src/model.rs | 8 ++++---- src/tether_interface.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/model.rs b/src/model.rs index ff4183a..da369bc 100644 --- a/src/model.rs +++ b/src/model.rs @@ -218,7 +218,7 @@ impl Model { FixtureMacro::Control(control_macro) => { if let Some(animation) = &mut control_macro.animation { let (value, is_done) = animation.get_value_and_done(); - let int_value = (value * 255.0) as u16; + let int_value = (value * u16::MAX as f32) as u16; control_macro.current_value = int_value; @@ -365,8 +365,8 @@ impl Model { if let Some(ms) = msg.ms { let duration = Duration::from_millis(ms); let start_value = - control_macro.current_value as f32 / 255.0; - let end_value = target_value as f32 / 255.0; + control_macro.current_value as f32 / u16::MAX as f32; + let end_value = target_value as f32 / u16::MAX as f32; control_macro.animation = Some(Animation::new( duration, @@ -387,7 +387,7 @@ impl Model { ); control_macro.animation = None; // cancel first control_macro.current_value = - (target_value * (u16::MAX as f64)) as u16; + (target_value * (u16::MAX as f32)) as u16; } } RemoteMacroValue::ColourValue(_) => { diff --git a/src/tether_interface.rs b/src/tether_interface.rs index df44d34..65a457b 100644 --- a/src/tether_interface.rs +++ b/src/tether_interface.rs @@ -36,7 +36,7 @@ pub struct TetherKnobPayload { #[derive(Serialize, Deserialize, Debug)] pub enum RemoteMacroValue { - ControlValue(f64), + ControlValue(f32), ColourValue(Color32), } From 8b829abb5c97b58e67dc681ce8531baf33778473 Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Tue, 24 Dec 2024 12:01:15 +0100 Subject: [PATCH 8/9] remove unused hover label --- src/ui/macro_controls.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/ui/macro_controls.rs b/src/ui/macro_controls.rs index e4da5ab..196f5b4 100644 --- a/src/ui/macro_controls.rs +++ b/src/ui/macro_controls.rs @@ -57,17 +57,7 @@ pub fn render_macro_controls(model: &mut Model, ui: &mut Ui) { for m in current_mode.macros.iter_mut() { match m { FixtureMacro::Control(control_macro) => { - // let remapped_channels: Vec = control_macro - // .channels - // .iter() - // .map(|c| c + fixture.offset_channels) - // .collect(); - // let channel_list = format!( - // "{:?} => {:?}", - // &control_macro.channels, remapped_channels - // ); ui.label(&control_macro.label); - // .on_hover_text(channel_list); if ui .add_enabled( control_macro.animation.is_none(), From 6def472e2c906108b5d10d57483fa661eeb66191 Mon Sep 17 00:00:00 2001 From: Stephen Buchanan Date: Tue, 24 Dec 2024 12:03:14 +0100 Subject: [PATCH 9/9] v0.8 supports 16-bit macro controls --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b160be4..7c4c4c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3102,7 +3102,7 @@ dependencies = [ [[package]] name = "tether-artnet-controller" -version = "0.7.4" +version = "0.8.0" dependencies = [ "anyhow", "artnet_protocol", diff --git a/Cargo.toml b/Cargo.toml index 87335b8..792c3b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tether-artnet-controller" -version = "0.7.4" +version = "0.8.0" edition = "2021" repository = "https://github.com/RandomStudio/tether-artnet-controller" homepage = "https://github.com/RandomStudio/tether-artnet-controller"