Skip to content

Commit 19c5b8a

Browse files
authored
Matrix improvements (#368)
* Support matrix insert pixel key ordering methods - Update schema, model, tests and docs * Update fixtures to new repeatFor syntax * Migrate old fixtures which didn't use matrices * Matrix UI improvements: - Fix pixelGroup highlighting - Fix pixel sizing - Fix mobile issues - Add front view hint
1 parent 59646c1 commit 19c5b8a

23 files changed

+616
-1004
lines changed

docs/fixture-format.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Then, either use the resolved channel keys directly in a mode's channel list, or
192192
"Strobe",
193193
{
194194
"insert": "matrixChannels", // static value for matrix channels
195-
"repeatFor": "eachPixel", // or "eachPixelGroup", or an array of pixel (group) keys
195+
"repeatFor": "eachPixelXYZ", // see below
196196
"channelOrder": "perPixel", // or "perChannel"
197197
"templateChannels": [
198198
"Red $pixelKey",
@@ -204,6 +204,15 @@ Then, either use the resolved channel keys directly in a mode's channel list, or
204204
}
205205
```
206206

207+
`repeatFor` defines in which order and for which pixels / pixel groups the template channels shall be repeated. Possible values are:
208+
209+
* An array of pixel (group) keys in the proper order
210+
* `"eachPixelABC"`: Gets computed into an alphanumerically sorted list of all pixelKeys
211+
* `"eachPixelXYZ"` / `"eachPixelZYX"` / ...: Gets computed into a list of all pixelKeys, sorted by position, depending on the used `X`/`Y`/`Z` combination.
212+
- For example, `XYZ` orders the pixels like reading a book (latin script): First left-to-right (`X`, letter by letter), then top-to-bottom (`Y`, line by line), then front-to-back (`Z`, page by page). For a 3-dimensional 2×2×2 matrix, this results in `["(1, 1, 1)", "(2, 1, 1)", "(1, 2, 1)", "(2, 2, 1)", "(1, 1, 2)", "(2, 1, 2)", "(1, 2, 2)", "(2, 2, 2)]"`.
213+
* `"eachPixelGroup"`: Gets computed into an array of all pixel group keys, ordered by appearance in the JSON file.
214+
- For the above [matrix structure](#matrix-structure) example, this results in `["Inner ring", "Middle ring", "Outer ring"]`.
215+
207216

208217

209218
### RDM (Remote Device Management) data

fixtures/american-dj/galaxian-3d.json

Lines changed: 57 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -27,99 +27,14 @@
2727
"type": "Fixed"
2828
}
2929
},
30-
"availableChannels": {
31-
"Red Laser": {
32-
"type": "Effect",
33-
"capabilities": [
34-
{
35-
"range": [0, 7],
36-
"name": "Off"
37-
},
38-
{
39-
"range": [8, 15],
40-
"name": "On"
41-
},
42-
{
43-
"range": [16, 239],
44-
"name": "Strobe Slow->Fast"
45-
},
46-
{
47-
"range": [240, 247],
48-
"name": "Sound Active"
49-
},
50-
{
51-
"range": [248, 255],
52-
"name": "On"
53-
}
54-
]
55-
},
56-
"Green Laser": {
57-
"type": "Effect",
58-
"capabilities": [
59-
{
60-
"range": [0, 7],
61-
"name": "Off"
62-
},
63-
{
64-
"range": [8, 15],
65-
"name": "On"
66-
},
67-
{
68-
"range": [16, 239],
69-
"name": "Strobe Slow->Fast"
70-
},
71-
{
72-
"range": [240, 247],
73-
"name": "Sound Active"
74-
},
75-
{
76-
"range": [248, 255],
77-
"name": "On"
78-
}
79-
]
80-
},
81-
"Laser Rotation 1": {
82-
"type": "Speed",
83-
"capabilities": [
84-
{
85-
"range": [0, 127],
86-
"name": "Location"
87-
},
88-
{
89-
"range": [128, 189],
90-
"name": "Counter-Clockwise Fast -> Slow"
91-
},
92-
{
93-
"range": [190, 193],
94-
"name": "No Rotation"
95-
},
96-
{
97-
"range": [194, 255],
98-
"name": "Clockiwse Slow-> Fast"
99-
}
30+
"matrix": {
31+
"pixelKeys": [
32+
[
33+
["Red", "Green"]
10034
]
101-
},
102-
"Laser Rotation 2": {
103-
"type": "Speed",
104-
"capabilities": [
105-
{
106-
"range": [0, 127],
107-
"name": "Location"
108-
},
109-
{
110-
"range": [128, 189],
111-
"name": "Counter-Clockwise Fast -> Slow"
112-
},
113-
{
114-
"range": [190, 193],
115-
"name": "No Rotation"
116-
},
117-
{
118-
"range": [194, 255],
119-
"name": "Clockiwse Slow-> Fast"
120-
}
121-
]
122-
},
35+
]
36+
},
37+
"availableChannels": {
12338
"Macros": {
12439
"type": "Effect",
12540
"capabilities": [
@@ -194,15 +109,63 @@
194109
]
195110
}
196111
},
112+
"templateChannels": {
113+
"$pixelKey Laser": {
114+
"type": "Effect",
115+
"capabilities": [
116+
{
117+
"range": [0, 7],
118+
"name": "Off"
119+
},
120+
{
121+
"range": [8, 15],
122+
"name": "On"
123+
},
124+
{
125+
"range": [16, 239],
126+
"name": "Strobe Slow->Fast"
127+
},
128+
{
129+
"range": [240, 247],
130+
"name": "Sound Active"
131+
},
132+
{
133+
"range": [248, 255],
134+
"name": "On"
135+
}
136+
]
137+
},
138+
"$pixelKey Laser Rotation": {
139+
"type": "Speed",
140+
"capabilities": [
141+
{
142+
"range": [0, 127],
143+
"name": "Location"
144+
},
145+
{
146+
"range": [128, 189],
147+
"name": "Counter-Clockwise Fast -> Slow"
148+
},
149+
{
150+
"range": [190, 193],
151+
"name": "No Rotation"
152+
},
153+
{
154+
"range": [194, 255],
155+
"name": "Clockiwse Slow-> Fast"
156+
}
157+
]
158+
}
159+
},
197160
"modes": [
198161
{
199162
"name": "5-channel",
200163
"shortName": "5ch",
201164
"channels": [
202165
"Red Laser",
203166
"Green Laser",
204-
"Laser Rotation 1",
205-
"Laser Rotation 2",
167+
"Red Laser Rotation",
168+
"Green Laser Rotation",
206169
"Macros"
207170
]
208171
}

fixtures/american-dj/revo-4-ir.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
"channels": [
305305
{
306306
"insert": "matrixChannels",
307-
"repeatFor": "eachPixel",
307+
"repeatFor": "eachPixelXYZ",
308308
"channelOrder": "perPixel",
309309
"templateChannels": [
310310
"Red $pixelKey",

fixtures/ayra/tdc-triple-burst.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
"channels": [
261261
{
262262
"insert": "matrixChannels",
263-
"repeatFor": "eachPixel",
263+
"repeatFor": "eachPixelXYZ",
264264
"channelOrder": "perPixel",
265265
"templateChannels": [
266266
"Red $pixelKey",
@@ -278,7 +278,7 @@
278278
"channels": [
279279
{
280280
"insert": "matrixChannels",
281-
"repeatFor": "eachPixel",
281+
"repeatFor": "eachPixelXYZ",
282282
"channelOrder": "perPixel",
283283
"templateChannels": [
284284
"Red $pixelKey",

fixtures/cameo/flash-matrix-250.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@
577577
"channels": [
578578
{
579579
"insert": "matrixChannels",
580-
"repeatFor": "eachPixel",
580+
"repeatFor": "eachPixelXYZ",
581581
"channelOrder": "perPixel",
582582
"templateChannels": [
583583
"Dimmer LED $pixelKey"
@@ -596,7 +596,7 @@
596596
"Program Speed / Sound Sensitivity",
597597
{
598598
"insert": "matrixChannels",
599-
"repeatFor": "eachPixel",
599+
"repeatFor": "eachPixelXYZ",
600600
"channelOrder": "perPixel",
601601
"templateChannels": [
602602
"Dimmer LED $pixelKey"

fixtures/cameo/hydrabeam-300-rgbw.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@
642642
"Master White",
643643
{
644644
"insert": "matrixChannels",
645-
"repeatFor": "eachPixel",
645+
"repeatFor": "eachPixelABC",
646646
"channelOrder": "perPixel",
647647
"templateChannels": [
648648
"Pan $pixelKey",
@@ -661,7 +661,7 @@
661661
"Strobe",
662662
{
663663
"insert": "matrixChannels",
664-
"repeatFor": "eachPixel",
664+
"repeatFor": "eachPixelABC",
665665
"channelOrder": "perPixel",
666666
"templateChannels": [
667667
"Pan $pixelKey",
@@ -686,7 +686,7 @@
686686
"channels": [
687687
{
688688
"insert": "matrixChannels",
689-
"repeatFor": "eachPixel",
689+
"repeatFor": "eachPixelABC",
690690
"channelOrder": "perPixel",
691691
"templateChannels": [
692692
"Pan $pixelKey",

fixtures/cameo/thunder-wash-600-w.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"Flash Duration",
221221
{
222222
"insert": "matrixChannels",
223-
"repeatFor": "eachPixel",
223+
"repeatFor": "eachPixelABC",
224224
"channelOrder": "perPixel",
225225
"templateChannels": [
226226
"LED$pixelKey Dimmer"

0 commit comments

Comments
 (0)