/
examples.clj
2291 lines (2100 loc) · 139 KB
/
examples.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(ns afterglow.examples
"Show some simple ways to use Afterglow, and hopefully inspire
exploration." {:author "James Elliott"}
(:require [afterglow.beyond :as beyond]
[afterglow.channels :as chan]
[afterglow.controllers :as ct]
[afterglow.controllers.tempo]
[afterglow.core :as core]
[afterglow.effects :as fx]
[afterglow.effects.channel :as chan-fx]
[afterglow.effects.color :as color-fx]
[afterglow.effects.cues :as cues]
[afterglow.effects.dimmer :refer [dimmer-effect master-set-level]]
[afterglow.effects.fun :as fun]
[afterglow.effects.movement :as move]
[afterglow.effects.oscillators :as oscillators]
[afterglow.effects.params :as params]
[afterglow.effects.show-variable :as var-fx]
[afterglow.fixtures]
[afterglow.fixtures.american-dj :as adj]
[afterglow.fixtures.blizzard :as blizzard]
[afterglow.fixtures.chauvet :as chauvet]
[afterglow.rhythm :as rhythm]
[afterglow.show :as show]
[afterglow.show-context :refer [*show* with-show set-default-show!]]
[afterglow.transform :as tf]
[amalloy.ring-buffer :refer [ring-buffer]]
[clojure.math.numeric-tower :as math]
[clojure.set :as set]
[clojure.string :as str]
[com.evocomputing.colors :as colors :refer [color-name create-color hue adjust-hue]]
[overtone.osc :as osc]
[taoensso.timbre :as timbre])
(:import [afterglow.effects Effect]
[javax.media.j3d Transform3D]
[javax.vecmath Point3d Vector3d]))
(defonce ^{:doc "Allows commands to be sent to the instance of
Pangolin Beyond running alongside this light show, in order to
affect laser cues."}
laser-show
#_(afterglow.beyond/beyond-server "172.16.1.255" 16062)
(afterglow.beyond/beyond-server "172.30.228.255" 16062))
(defonce ^{:doc "Holds the sample show if it has been created,
so it can be unregistered if it is being re-created."}
sample-show
(atom nil))
(defn patch-lighting-rig
"An example of how to patch a whole group of lights with a
parameterized location. We mount our lights on our lighting rig in
standard positions, so knowing the position of the rig and the
height to which it has been adjusted allows us to figure out where
all the lights are on it.
For the moment the orientation of the rig defines the orientation of
the show, and the origins of the show axes are the spot on the floor
underneath the center of the horizontal truss. The _z_ axis
increases towards the audience from that point.
Because the height of the rig can be adjusted, you can pass in a
value with `:y` to set the height of the center of the lower bar on
the horizontal truss. If omitted a default height of 62.5 inches is
used, which is approximately the height of the bar when the
extension poles are collapsed for load-in and strike.
We try to hang blades 1-4 at an angle of 72.5 degrees leaning towards
the audience, and blade 5 sags to about 101 degrees but if any angle
ends up being off and difficult to correct, it can be passed in with
`:blade-1-angle` through `:blade-5-angle` The actual mounting height
of blade 5, if it differs from 4 inches can be passed with
`:blade-5-height`.
Fixture numbers are assigned stage left to stage right (looking at
the lights from behind the rig), except for blade 5, which is an
extra which is sometimes placed in the middle.
It would be possible to extend this function to support positioning
and rotating the truss within show space, now that `patch-fixture`
allows you to pass in a transformation matrix. But until that
complexity is needed, this simpler approach seems practical. The
truss is the main component of our show, so having it be at the
origin makes sense."
[& {:keys [universe y blade-1-angle blade-2-angle blade-3-angle blade-4-angle blade-5-angle blade-5-height]
:or {universe 1 y (tf/inches 62.5)
blade-1-angle (tf/degrees 80.7) blade-2-angle (tf/degrees 76.4)
blade-3-angle (tf/degrees 77.6) blade-4-angle (tf/degrees 76.5)
blade-5-angle (tf/degrees 99) blade-5-height (tf/inches 4)}}]
;; Torrent F3 moving head effect spots
(show/patch-fixture! :torrent-1 (blizzard/torrent-f3) universe 1
:x (tf/inches 50) :y (+ y (tf/inches -14))
:x-rotation (tf/degrees 180)
:y-rotation (tf/degrees -90))
(show/patch-fixture! :torrent-2 (blizzard/torrent-f3) universe 17
:x (tf/inches -50) :y (+ y (tf/inches -14))
:x-rotation (tf/degrees 180)
:y-rotation (tf/degrees -90))
;; Hex IRC mini RGBAW+UV pars
(show/patch-fixture! :hex-1 (chauvet/slimpar-hex3-irc) universe 129
:x (tf/inches 51.5) :y (+ y (tf/inches 15)))
(show/patch-fixture! :hex-2 (chauvet/slimpar-hex3-irc) universe 145
:x (tf/inches -51.5) :y (+ y (tf/inches 15)))
;; Blade moving-head RGBA pinspots
(show/patch-fixture! :blade-1 (blizzard/blade-rgbw :15-channel :version-2 true :hung (tf/inches 12)) universe 270
:x (tf/inches 37) :y y
:relative-rotations [[:y-rotation (tf/degrees 90)]
[:z-rotation blade-4-angle]])
(show/patch-fixture! :blade-2 (blizzard/blade-rgbw :15-channel :hung (tf/inches 12)) universe 240
:x (tf/inches 20.5) :y (+ y (tf/inches 9))
:relative-rotations [[:y-rotation (tf/degrees 90)]
[:z-rotation blade-2-angle]])
(show/patch-fixture! :blade-3 (blizzard/blade-rgbw :15-channel :hung (tf/inches 12)) universe 225
:x (tf/inches -21) :y (+ y (tf/inches 9))
:relative-rotations [[:y-rotation (tf/degrees 90)]
[:z-rotation blade-1-angle]])
(show/patch-fixture! :blade-4 (blizzard/blade-rgbw :15-channel :hung (tf/inches 12)) universe 255
:x (tf/inches -37) :y y
:relative-rotations [[:y-rotation (tf/degrees 90)]
[:z-rotation blade-3-angle]])
(show/patch-fixture! :blade-5 (blizzard/blade-rgbw :15-channel :version-2 true :hung (tf/inches 12)) universe 285
:y (+ y blade-5-height)
:relative-rotations [[:y-rotation (tf/degrees 90)]
[:z-rotation blade-5-angle]])
;; Snowball RGBA moonflower effect
(show/patch-fixture! :snowball (blizzard/snowball) universe 33
:x (tf/inches 6.5) :y (+ y (tf/inches 15)))
;; Hypnotic RGB web effect diffraction pattern laser
(show/patch-fixture! :hyp-rgb (adj/hypnotic-rgb) universe 45
:y (+ y (tf/inches -5)))
;; These last two can be patched as generic dimmers instead if you want them to respond to dimmer cues,
;; although they can only be on or off:
;; LED UV bar
(show/patch-fixture! :eco-uv (afterglow.fixtures/generic-switch) universe 61)
;; LED colored water effect
(show/patch-fixture! :h2o-led (afterglow.fixtures/generic-switch) universe 62))
(def rig-height
"The height of the center of the bottom horizontal truss bar of the
main lighting rig as set up in the current venue."
2.18)
(def stage-wall
"The location of the wall behind the rig on the show Z axis."
-0.42)
(def house-rear-wall
"The location of the wall behind the audience on the show Z axis."
12.9)
(def left-wall
"The location of the house left wall on the show X axis."
-5.89)
(def right-wall
"The location of the house right wall on the show X axis."
5.67)
(def ceiling
"The location of the ceiling on the show Y axis."
3.6)
(defonce ^{:doc "Allow us to send messages to an OSC interface like TouchOSC."}
osc-client
(atom nil))
(def ipad-address
"The IP address of the iPad that will be used with OSC."
"172.16.42.3")
;; TODO: This kind of binding and tracking should be moved into an osc support namespace.
(defonce ^{:doc "Keep track of any OSC cue bindings we have set up,
so we can clear them out before re-creating the show."}
osc-cue-bindings
(atom #{}))
(defn add-osc-cue-binding
"Set up a binding so the state of a cue gets communicated via OSC,
and record that we did that so it can be cleaned up later. Then set
up so that incoming OSC messages can start and end that cue."
[x y path]
(let [binding (fn [state _ _]
(case state
:started (osc/osc-send @osc-client path 1)
:ended (osc/osc-send @osc-client path 0)
nil))]
(swap! osc-cue-bindings conj [x y binding path])
(ct/add-cue-fn! (:cue-grid *show*) x y binding))
(osc/osc-handle @core/osc-server path
(fn [msg]
(let [[cue active] (show/find-cue-grid-active-effect *show* x y)]
(when cue
(if (pos? (first (:args msg)))
(if (and active (not (:held cue)))
(show/end-effect! (:key cue))
(show/add-effect-from-cue-grid! x y))
(when (and active (:held cue))
(show/end-effect! (:key cue)))))))))
(defn clear-osc-cue-bindings
"Clear out any OSC cue bindings which have been established."
[]
(doseq [[x y f path] @osc-cue-bindings]
(ct/clear-cue-fn! (:cue-grid *show*) x y f)
(osc/osc-handle @core/osc-server path
(fn [_msg] :done)))
(reset! osc-cue-bindings #{}))
(defonce ^{:doc "Keep track of any OSC var bindings we have set up,
so we can clear them out before re-creating the show."}
osc-var-bindings
(atom #{}))
(defn add-osc-var-binding
"Arrange to send an OSC message whenever the value of a show
variable changes, and record that we did that so it can be cleaned
up later. Then set things up so incoming OSC messages update the
value of that variable.
If you need to do anything more complicated than send a message with
the raw value of the variable, or update the variable with the raw
first value from the incoming OSC message, you can pass your own
functions with the optional keyword arguments `:send-fn` and
`:receive-fn`. `:send-fn` will be called with the keyword
identifying the variable that has changed, and its new value.
`:receive-fn` will be called with the incoming OSC message.
If you want this binding to not affect reception of messages on the
OSC path (for example because you have another variable binding set
up which processes these messages, since they contain values for
multiple show variables), then pass `:none` as the value for
`:receive-fn`."
[var-key path & {:keys [send-fn receive-fn]}]
(let [have-receiver (not= receive-fn :none)
binding (or send-fn
(fn [_ v]
(osc/osc-send @osc-client path v)))]
(swap! osc-var-bindings conj [var-key binding path have-receiver])
(show/add-variable-set-fn! var-key binding)
(when have-receiver
(osc/osc-handle @core/osc-server path
(or receive-fn
(fn [msg]
(show/set-variable! var-key (first (:args msg)))))))))
(defn clear-osc-var-bindings
"Clear out any OSC var bindings which have been established."
[]
(doseq [[k f path have-receiver] @osc-var-bindings]
(show/clear-variable-set-fn! k f)
(when have-receiver (osc/osc-handle @core/osc-server path
(fn [_msg] :done))))
(reset! osc-var-bindings #{}))
(declare make-cues)
(defn use-sample-show
"Set up a sample show for experimenting with Afterglow. By default
it will create the show to use universe 1, but if you want to use a
different universe (for example, a dummy universe on ID 0, because
your DMX interface isn't handy right now), you can override that by
supplying a different ID after `:universe`.
Usually we run our shows on a single universe, but sometimes we
connect the Weather System fixtures to an extra universe, and wire
them separately from the main lighting rig. When we do that, we can
pass the extra universe ID in after `:extra-universe`.
If you have an instance of Pangolin Beyond running a laser show that
you want to control as well, pass a true value with `:add-beyond?`.
If you don't want to experiment with Open Sound Control, you can
pass a false value with `:add-osc?`."
[& {:keys [universe extra-universe add-beyond? add-osc?] :or {universe 1
extra-universe universe
add-osc? true}}]
;; Since this class is an entry point for interactive REPL usage,
;; make sure a sane logging environment is established.
(core/init-logging)
;; Create, or re-create the show, on the chosen OLA universe, for demonstration
;; purposes. Make it the default show so we don't need to wrap everything below
;; in a (with-show sample-show ...) binding
(set-default-show! (swap! sample-show (fn [s]
(when s
(show/unregister-show s)
(with-show s
(show/stop!)
(show/blackout-show)))
(show/show :universes (distinct [universe extra-universe])
:description "Sample Show"))))
;; Throw a couple of fixtures in there to play with. For better fun, use
;; fixtures and addresses that correspond to your actual hardware. We always
;; have a main universe for our main rig, and sometimes attach the other
;; fixtures to their own universe if that turns out to be easier to wire.
(patch-lighting-rig :universe universe :y rig-height
:blade-3-angle (tf/degrees 71.2) :blade-4-angle (tf/degrees 78.7))
(show/patch-fixture! :ws-1 (blizzard/weather-system) extra-universe 161
:x 2.2 :y 1.33 :z -1.1 :y-rotation 0.0)
(show/patch-fixture! :ws-2 (blizzard/weather-system) extra-universe 187
:x -2.2 :y 1.33 :z -1.1 :y-rotation 0.0)
#_(show/patch-fixture! :puck-1 (blizzard/puck-fab5) universe 97 :x (tf/inches -76) :y (tf/inches 8) :z (tf/inches 52))
#_(show/patch-fixture! :puck-2 (blizzard/puck-fab5) universe 113 :x (tf/inches -76) :y (tf/inches 8) :z (tf/inches 40))
(when add-osc?
;; Turn on the OSC server, and clear any variable and cue bindings that might have been around from previous runs.
(when (nil? @core/osc-server)
(core/start-osc-server 16010))
(clear-osc-var-bindings)
(clear-osc-cue-bindings))
;; Enable cues whose purpose is to set show variable values while they run.
(let [var-binder (atom (var-fx/create-for-show *show*))]
;; Enable communication with the Beyond laser show
(when add-beyond? (beyond/bind-to-show laser-show *show*))
;; Create a bunch of example cues
(make-cues var-binder add-beyond? add-osc?))
;; Automatically bind the show to any compatible grid controllers that are connected now
;; or in the future.
(ct/auto-bind *show*)
;; Return the symbol through which the show can be accessed, rather than the value itself,
;; which is huge and causes issues for some REPL environments.
'*show*)
(defn global-color-effect
"Make a color effect which affects all lights in the sample show.
This became vastly more useful once I implemented dynamic color
parameters. Can include only a specific set of lights by passing
them with :fixtures"
[color & {:keys [include-color-wheels? fixtures effect-name] :or {fixtures (show/all-fixtures)}}]
(try
(let [[c desc] (cond (= (type color) :com.evocomputing.colors/color)
[color (color-name color)]
(and (params/param? color)
(= (params/result-type color) :com.evocomputing.colors/color))
[color "variable"]
:else
[(create-color color) color])]
(color-fx/color-effect (or effect-name (str "Global " desc)) c fixtures
:include-color-wheels? include-color-wheels?))
(catch Exception e
(throw (Exception. (str "Can't figure out how to create color from " color) e)))))
(defn global-dimmer-effect
"Return an effect that sets all the dimmers in the sample rig.
Originally this had to be to a static value, but now that dynamic
parameters exist, it can vary in response to a MIDI mapped show
variable, an oscillator, or the location of the fixture. You can
override the default name by passing in a value with :effect-name"
[level & {:keys [effect-name add-virtual-dimmers?]}]
(let [htp? (not add-virtual-dimmers?)]
(dimmer-effect level (show/all-fixtures) :effect-name effect-name :htp? htp?
:add-virtual-dimmers? add-virtual-dimmers?)))
(defn fiat-lux
"Start simple with a cool blue color from all the lights."
[]
(show/add-effect! :all-color (global-color-effect "slateblue" :include-color-wheels? true))
(show/add-effect! :dimmers (global-dimmer-effect 255))
(show/add-effect! :torrent-shutter
(afterglow.effects.channel/function-effect
"Torrents Open" :shutter-open 50 (show/fixtures-named "torrent"))))
;; Get a little fancier with a beat-driven fade
;; (show/add-effect! :dimmers (global-dimmer-effect
;; (oscillators/build-oscillated-param (oscillators/sawtooth))))
;; To actually start the effects above (although only the last one assigned to any
;; given keyword will still be in effect), uncomment or evaluate the next line:
;; (show/start!)
(defn sparkle-test
"Set up a sedate rainbow fade and then layer on a sparkle effect to test
effect mixing."
[]
(let [hue-param (oscillators/build-oscillated-param (oscillators/sawtooth :interval :phrase) :max 360)]
(show/add-effect! :all-color
(global-color-effect
(params/build-color-param :s 100 :l 50 :h hue-param)))
(show/add-effect! :sparkle
(fun/sparkle (show/all-fixtures) :chance 0.05 :fade-time 50))))
(defn mapped-sparkle-test
"A verion of the sparkle test that creates a bunch of MIDI-mapped
show variables to adjust parameters while it runs."
[]
(show/add-midi-control-to-var-mapping "Slider" 0 16 :sparkle-hue :max 360)
(show/add-midi-control-to-var-mapping "Slider" 0 0 :sparkle-lightness :max 100.0)
(show/add-midi-control-to-var-mapping "Slider" 0 17 :sparkle-fade :min 10 :max 2000)
(show/add-midi-control-to-var-mapping "Slider" 0 1 :sparkle-chance :max 0.3)
(let [hue-param (oscillators/build-oscillated-param (oscillators/sawtooth :interval :phrase) :max 360)
sparkle-color-param (params/build-color-param :s 100 :l :sparkle-lightness :h :sparkle-hue)]
(show/add-effect! :all-color
(global-color-effect
(params/build-color-param :s 100 :l 50 :h hue-param)))
(show/add-effect! :sparkle
(fun/sparkle (show/all-fixtures) :color sparkle-color-param
:chance :sparkle-chance :fade-time :sparkle-fade))))
;; Temporary for working on light aiming code
(defn add-pan-tilt-controls
[]
(show/add-midi-control-to-var-mapping "Slider" 0 0 :tilt :max 255.99)
(show/add-midi-control-to-var-mapping "Slider" 0 16 :pan :max 255.99)
(show/add-effect!
:pan-torrent (afterglow.effects.channel/channel-effect
"Pan Torrent"
:pan
(chan/extract-channels (chan/expand-heads (show/fixtures-named :torrent)) #(= (:type %) :pan))))
(show/add-effect!
:tilt-torrent (afterglow.effects.channel/channel-effect
"Tilt Torrent"
:tilt
(chan/extract-channels (chan/expand-heads (show/fixtures-named :torrent)) #(= (:type %) :tilt)))))
(defn add-xyz-controls
[]
(show/add-midi-control-to-var-mapping "Slider" 0 4 :x)
(show/add-midi-control-to-var-mapping "Slider" 0 5 :y)
(show/add-midi-control-to-var-mapping "Slider" 0 6 :z)
(show/add-effect! :position
(move/direction-effect
"Pointer" (params/build-direction-param :x :x :y :y :z :z) (show/all-fixtures)))
#_(show/add-effect! :position
(move/aim-effect
"Aimer" (params/build-aim-param :x :x :y :y :z :z) (show/all-fixtures)))
(show/set-variable! :y 2.6416)) ; Approximate height of ceiling
(defn osc-demo
"Early experiments with using OSC to control shows. This should grow
into a well-defined API, with integration to show variables, cue
grids, and the like."
[]
(when (nil? @core/osc-server) (core/start-osc-server 16010))
(let [left (tf/inches -88)
right (tf/inches 86)
width (- right left)
front (tf/inches -21)
rear (tf/inches 295)
depth (- rear front)
height 3]
(osc/osc-handle @core/osc-server "/1/aim-a"
(fn [msg]
(show/set-variable! :aim-group-a-x (+ left (* width (first (:args msg)))))
(show/set-variable! :aim-group-a-z (+ front (* depth (second (:args msg)))))
#_(timbre/info msg)))
(osc/osc-handle @core/osc-server "/1/aim-a-y"
(fn [msg]
(show/set-variable! :aim-group-a-y (* height (first (:args msg))))
#_(timbre/info msg)))
(osc/osc-handle @core/osc-server "/1/aim-b"
(fn [msg]
(show/set-variable! :aim-group-b-x (+ left (* width (first (:args msg)))))
(show/set-variable! :aim-group-b-z (+ front (* depth (second (:args msg)))))
#_(timbre/info msg)))
(osc/osc-handle @core/osc-server "/1/aim-b-y"
(fn [msg]
(show/set-variable! :aim-group-b-y (* height (first (:args msg))))
#_(timbre/info msg))))
(osc/osc-handle @core/osc-server "/1/sparkle" (fn [msg]
(if (pos? (first (:args msg)))
(show/add-effect! :sparkle (fun/sparkle (show/all-fixtures)
:chance 0.1
:fade-time 100))
(show/end-effect! :sparkle))))
#_(osc/osc-listen @core/osc-server (fn [msg] (timbre/info msg)) :debug)
#_(osc/zero-conf-on)
(show/set-variable! :x 0)
(show/set-variable! :y 2.6416) ; Approximate height of ceiling
(show/set-variable! :z 0)
(show/add-effect! :position
(move/aim-effect
"Aimer" (params/build-aim-param :x :x :y :y :z :z) (show/all-fixtures))))
(defn osc-shutdown
"Shut down osc server and clean up."
[]
(clear-osc-var-bindings)
(clear-osc-cue-bindings)
(core/stop-osc-server)
(swap! osc-client #(when % (osc/osc-close %) nil)))
(defn make-color-cue
"Create a cue-grid entry which establishes a global color effect,
given a named color. Also set up a cue color parameter so the color
can be tweaked in the Web UI or on the Ableton Push, and changes
can be saved to persist between invocations."
[color-name x y & {:keys [include-color-wheels? held fixtures effect-key effect-name priority]
:or {fixtures (show/all-fixtures)
effect-key :color
effect-name (str "Color " color-name)
priority 0}}]
(let [color (create-color color-name)
color-var {:key "color" :type :color :start color :name "Color"}
cue (cues/cue effect-key
(fn [var-map]
(global-color-effect (params/bind-keyword-param (:color var-map)
:com.evocomputing.colors/color
color)
:effect-name effect-name
:fixtures fixtures
:include-color-wheels? include-color-wheels?))
:priority priority
:held held
:color color
:color-fn (cues/color-fn-from-cue-var color-var x y)
:variables [color-var])]
(show/set-cue! x y cue)))
(defn- name-torrent-gobo-cue
"Come up with a summary name for one of the gobo cues we are
creating that is concise but meaningful on a controller interface."
[prefix function]
(let [simplified (str/replace (name function) #"^gobo-fixed-" "")
simplified (str/replace simplified #"^gobo-moving-" "m/")
spaced (str/replace simplified "-" " ")]
(str (str/upper-case (name prefix)) " " spaced)))
(defn- make-torrent-gobo-cues
"Create cues for the fixed and moving gobo options, stationary and
shaking. Takes up half a page, with the top left at the coordinates
specified."
[prefix fixtures top left]
;; Make cues for the stationary and shaking versions of all fixed gobos
(doseq [_ (map-indexed (fn [i v]
(let [blue (create-color :blue)
x (if (< i 8) left (+ left 2))
y (if (< i 8) (- top i) (- top i -1))
cue-key (keyword (str (name prefix) "-gobo-fixed"))]
(show/set-cue! x y (cues/function-cue cue-key (keyword v) fixtures :color blue
:short-name (name-torrent-gobo-cue prefix v)))
(let [function (keyword (str (name v) "-shake"))]
(show/set-cue! (inc x) y (cues/function-cue
cue-key function fixtures :color blue
:short-name (name-torrent-gobo-cue prefix function))))))
["gobo-fixed-mortar" "gobo-fixed-4-rings" "gobo-fixed-atom" "gobo-fixed-jacks"
"gobo-fixed-saw" "gobo-fixed-sunflower" "gobo-fixed-45-adapter"
"gobo-fixed-star" "gobo-fixed-rose-fingerprint"])])
;; Make cues for the stationary and shaking versions of all rotating gobos
(doseq [_ (map-indexed (fn [i v]
(let [green (create-color :green)
cue-key (keyword (str (name prefix) "-gobo-moving"))]
(show/set-cue! (+ left 2) (- top i)
(cues/function-cue cue-key (keyword v) fixtures :color green
:short-name (name-torrent-gobo-cue prefix v)))
(let [function (keyword (str (name v) "-shake"))]
(show/set-cue! (+ left 3) (- top i)
(cues/function-cue
cue-key function fixtures :color green
:short-name (name-torrent-gobo-cue prefix function))))))
["gobo-moving-rings" "gobo-moving-color-swirl" "gobo-moving-stars"
"gobo-moving-optical-tube" "gobo-moving-magenta-bundt"
"gobo-moving-blue-mega-hazard" "gobo-moving-turbine"])]))
(defn make-strobe-cue
"_This is no longer used in the sample cue set, but is left as an
example in case you want to create a strobe cue that depends only on
numeric parameters, rather than the newer color parameter
capabilities._
Create a cue which strobes a set of fixtures as long
as the cue pad is held down, letting the operator adjust the
lightness of the strobe color by varying the pressure they are
applying to the pad on controllers which support pressure
sensitivity, and having the base strobe color depend on a set of
shared numeric show variable."
[name fixtures x y]
(show/set-cue! x y
(cues/cue (keyword (str "strobe-" (clojure.string/replace (clojure.string/lower-case name) " " "-")))
(fn [var-map] (fun/strobe (str "Strobe " name) fixtures
(:level var-map 50) (:lightness var-map 100)))
:color :purple
:held true
:priority 100
:variables [{:key "level" :min 0 :max 100 :start 100 :name "Level"}
{:key "lightness" :min 0 :max 100 :name "Lightness" :velocity true}])))
(def white
"The color to flash strobe cues to identify them as such."
(create-color :white))
(defn make-strobe-cue-2
"Create a cue which strobes a set of fixtures as long as the cue pad
is held down, letting the operator adjust the lightness of the
strobe color by varying the pressure they are applying to the pad on
controllers which support pressure sensitivity, and having the base
strobe color depend on a shared show color variable. On controllers
which support it, the color of the cue pad will be also driven by
this shared color variable, with a white flicker to emphasize them
as strobing cues."
[name fixtures x y]
(when-not (= (type (show/get-variable :strobe-color)) :com.evocomputing.colors/color)
;; If the default strobe color has not yet been established, set it to purple.
(show/set-variable! :strobe-color (create-color :purple)))
(let [color-var {:key :strobe-color :type :color :name "Strobe Color"}]
(show/set-cue! x y
(cues/cue (keyword (str "strobe-" (clojure.string/replace (clojure.string/lower-case name) " " "-")))
(fn [var-map] (fun/strobe-2 (str "Strobe " name) fixtures
(:level var-map 50) (:lightness var-map 100)))
:color :purple
:color-fn (fn [cue _active _show snapshot]
(if (> (rhythm/snapshot-beat-phase snapshot 0.5) 0.7)
white
(or (show/get-variable :strobe-color)
(:color cue))))
:held true
:priority 100
:variables [{:key "level" :min 0 :max 100 :start 100 :name "Level"}
{:key "lightness" :min 0 :max 100 :name "Lightness" :velocity true}
color-var]))))
(def light-groups
"The named groupings of lights to build rows of effects in the cue grid."
[:torrent :blade :ws :hex :puck :snowball])
(defn group-end-keys
"Helper function to produce a vector of effect keywords to end all
effects running on light groups with a given suffix."
[effect-suffix]
(mapv #(keyword (str (name %) "-" effect-suffix)) light-groups))
(defn build-group-cue-elements
"Helper function which builds the common variables needed to create
a cue which runs on either all lights or a named group of lights."
[group effect-suffix name-suffix]
(let [effect-key (or (when group (keyword (str (name group) "-" effect-suffix)))
(keyword effect-suffix))
fixtures (or (when group (show/fixtures-named group))
(show/all-fixtures))
end-keys (or (when group [(keyword effect-suffix)])
(group-end-keys effect-suffix))
effect-name (str (case group
nil "All"
:ws "WS"
(clojure.string/capitalize (name group)))
" " (clojure.string/capitalize name-suffix))]
[effect-key fixtures end-keys effect-name]))
(defn make-dimmer-cue
"Creates a cue which lets the operator adjust the dimmer level of a
group of fixtures. Group will be one of the values
in [[light-groups]], or `nil` if the cue should affect all lights."
[group x y color]
(let [[effect-key fixtures end-keys effect-name] (build-group-cue-elements group "dimmers" "dimmers")]
(show/set-cue! x y
(cues/cue effect-key
(fn [var-map] (dimmer-effect
(params/bind-keyword-param (:level var-map 255) Number 255)
fixtures :effect-name effect-name))
:variables [{:key "level" :min 0 :max 255 :start 255 :name "Level"}]
:color color :end-keys end-keys))))
(defn build-ratio-param
"Creates a dynamic parameter for setting the beat ratio of one of
the dimmer oscillator cues in [[make-cues]] by forming the ratio of
the cue variables introduced by the cue. This allows the show
operator to decide over how many beats the oscillator runs, and how
many times it cycles in that interval.
Expects the cue's variable map to contain entries `:beats` and
`:cycles` which will form the numerator and denominator of the
ratio. If any entry is missing, a default value of `1` is used
for it."
[var-map]
(let [beats-param (params/bind-keyword-param (:beats var-map) Number 1)
cycles-param (params/bind-keyword-param (:cycles var-map) Number 1)]
(params/build-param-formula Number #(/ %1 %2) beats-param cycles-param)))
(defn- make-sawtooth-dimmer-param
"Creates the sawtooth oscillated parameter used by
`make-sawtooth-dimmer-cue` for both the actual effect and its
visualizer."
[var-map]
(oscillators/build-oscillated-param (oscillators/sawtooth :down? (:down var-map)
:interval-ratio (build-ratio-param var-map)
:phase (:phase var-map))
:min (:min var-map) :max (:max var-map)))
(defn make-sawtooth-dimmer-cue
"Create a cue which applies a sawtooth oscillator to the dimmers of
the specified group of fixtures, with cue variables to adjust the
oscillator parameters."
[group x y color]
(let [[effect-key fixtures end-keys effect-name] (build-group-cue-elements group "dimmers" "saw")]
(show/set-cue! x y
(cues/cue effect-key
(fn [var-map] (dimmer-effect (make-sawtooth-dimmer-param var-map) fixtures
:effect-name effect-name))
:color color
:variables [{:key "beats" :min 1 :max 32 :type :integer :start 2 :name "Beats"}
{:key "down" :type :boolean :start true :name "Down?"}
{:key "cycles" :min 1 :max 10 :type :integer :start 1 :name "Cycles"}
{:key "phase" :min 0 :max 1 :start 0 :name "Phase"}
{:key "min" :min 0 :max 255 :start 0 :name "Min"}
{:key "max" :min 0 :max 255 :start 255 :name "Max"}]
:visualizer (fn [var-map show]
(let [p (make-sawtooth-dimmer-param var-map)]
(fn [snapshot]
(/ (params/evaluate p show snapshot nil) 255.0))))
:end-keys end-keys))))
(defn- make-triangle-dimmer-param
"Creates the triangle oscillated parameter used by
`make-triangle-dimmer-cue` for both the actual effect and its
visualizer."
[var-map]
(oscillators/build-oscillated-param (oscillators/triangle :interval-ratio (build-ratio-param var-map)
:phase (:phase var-map))
:min (:min var-map) :max (:max var-map)))
(defn make-triangle-dimmer-cue
"Create a cue which applies a triangle oscillator to the dimmers of
the specified set of fixtures, with cue variables to adjust the
oscillator parameters."
[group x y color]
(let [[effect-key fixtures end-keys effect-name] (build-group-cue-elements group "dimmers" "triangle")]
(show/set-cue! x y
(cues/cue effect-key
(fn [var-map] (dimmer-effect (make-triangle-dimmer-param var-map) fixtures
:effect-name effect-name))
:color color
:variables [{:key "beats" :min 1 :max 32 :type :integer :start 2 :name "Beats"}
{:key "cycles" :min 1 :max 10 :type :integer :start 1 :name "Cycles"}
{:key "phase" :min 0 :max 1 :start 0 :name "Phase"}
{:key "min" :min 0 :max 255 :start 0 :name "Min"}
{:key "max" :min 0 :max 255 :start 255 :name "Max"}]
:visualizer (fn [var-map show]
(let [p (make-triangle-dimmer-param var-map)]
(fn [snapshot]
(/ (params/evaluate p show snapshot nil) 255.0))))
:end-keys end-keys))))
(defn- make-sine-dimmer-param
"Creates the sine oscillated parameter used by
`make-sine-dimmer-cue` for both the actual effect and its
visualizer."
[var-map]
(oscillators/build-oscillated-param (oscillators/sine :interval-ratio (build-ratio-param var-map)
:phase (:phase var-map))
:min (:min var-map) :max (:max var-map)))
(defn make-sine-dimmer-cue
"Create a cue which applies a sine oscillator to the dimmers of the
specified set of fixtures, with cue variables to adjust the
oscillator parameters."
[group x y color]
(let [[effect-key fixtures end-keys effect-name] (build-group-cue-elements group "dimmers" "sine")]
(show/set-cue! x y
(cues/cue effect-key
(fn [var-map] (dimmer-effect (make-sine-dimmer-param var-map) fixtures
:effect-name effect-name))
:color color
:variables [{:key "beats" :min 1 :max 32 :type :integer :start 2 :name "Beats"}
{:key "cycles" :min 1 :max 10 :type :integer :start 1 :name "Cycles"}
{:key "phase" :min 0 :max 1 :start 0 :name "Phase"}
{:key "min" :min 0 :max 255 :start 1 :name "Min"}
{:key "max" :min 0 :max 255 :start 255 :name "Max"}]
:visualizer (fn [var-map show]
(let [p (make-sine-dimmer-param var-map)]
(fn [snapshot]
(/ (params/evaluate p show snapshot nil) 255.0))))
:end-keys end-keys))))
(defn- make-square-dimmer-param
"Creates the square oscillated parameter used by
`make-square-dimmer-cue` for both the actual effect and its
visualizer."
[var-map]
(oscillators/build-oscillated-param (oscillators/square :interval-ratio (build-ratio-param var-map)
:width (:width var-map)
:phase (:phase var-map))
:min (:min var-map) :max (:max var-map)))
(defn make-square-dimmer-cue
"Create a cue which applies a square oscillator to the dimmers of
the specified set of fixtures, with cue variables to adjust the
oscillator parameters."
[group x y color]
(let [[effect-key fixtures end-keys effect-name] (build-group-cue-elements group "dimmers" "square")]
(show/set-cue! x y
(cues/cue effect-key
(fn [var-map] (dimmer-effect (make-square-dimmer-param var-map) fixtures
:effect-name effect-name))
:color color
:variables [{:key "beats" :min 1 :max 32 :type :integer :start 2 :name "Beats"}
{:key "width" :min 0 :max 1 :start 0.5 :name "Width"}
{:key "cycles" :min 1 :max 10 :type :integer :start 1 :name "Cycles"}
{:key "phase" :min 0 :max 1 :start 0 :name "Phase"}
{:key "min" :min 0 :max 255 :start 0 :name "Min"}
{:key "max" :min 0 :max 255 :start 255 :name "Max"}]
:visualizer (fn [var-map show]
(let [p (make-square-dimmer-param var-map)]
(fn [snapshot]
(/ (params/evaluate p show snapshot nil) 255.0))))
:end-keys end-keys))))
(defn x-phase
"Return a value that ranges from zero for the leftmost fixture in a
show to 1 for the rightmost, for staggering the phase of an
oscillator in making a can-can chase."
[head _show]
(let [dimensions @(:dimensions *show*)]
(/ (- (:x head) (:min-x dimensions)) (- (:max-x dimensions) (:min-x dimensions)))))
(defn try-laser-cues
"Create some cues that integrate Pangolin Beyond. Assumes sample
show has been created, and takes the beyond server to work with as
an argument."
[server]
(beyond/bind-to-show server *show*)
(let [hue-bar (oscillators/build-oscillated-param ; Spread a rainbow across a bar of music
(oscillators/sawtooth :interval :bar) :max 360)
hue-param (params/build-color-param :s :rainbow-saturation :l 50 :h hue-bar)]
(show/set-cue! 0 1
(cues/cue :all-color (fn [_] (fx/scene "Rainbow with laser" (global-color-effect hue-param)
(beyond/laser-color-effect server hue-param)))
:short-name "Rainbow Bar Fade"
:variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
:type :integer}])))
(show/set-cue! 2 7 (cues/cue :beyond-cue-1-1 (fn [_] (beyond/cue-effect server 1 1)) :short-name "Beyond 1 1"))
(show/set-cue! 3 7 (cues/cue :beyond-cue-1-2 (fn [_] (beyond/cue-effect server 1 2)) :short-name "Beyond 1 2"))
(show/set-cue! 6 7 (cues/function-cue :snowball-sound :sound-active (show/fixtures-named "snowball") :color :cyan)))
(defonce ^{:doc "A step parameter for controlling example chase cues.
Change it to experiment with other kinds of timing and fades."}
step-param
(atom nil))
(defn- build-focus-oscillator
"Returns a cue which oscillates a fixture's focus between a minimum
and minimum value using a sine oscillator with cue variables to
adjust the range and the oscillator's parameters."
[effect-key effect-name fixtures]
(cues/cue effect-key
(fn [var-map] (afterglow.effects.channel/function-effect
effect-name :focus
(oscillators/build-oscillated-param
(oscillators/sine :interval-ratio (build-ratio-param var-map) :phase (:phase var-map))
:min (:min var-map) :max (:max var-map))
fixtures))
:color (create-color :yellow)
:variables [{:key "min" :min 0 :max 100 :start 0 :name "Min"}
{:key "max" :min 0 :max 100 :start 100 :name "Max"}
{:key "beats" :min 1 :max 32 :type :integer :start 4 :name "Beats"}
{:key "cycles" :min 1 :max 10 :type :integer :start 1 :name "Cycles"}
{:key "phase" :min 0 :max 1 :start 0 :name "Phase"}]))
(defn make-main-color-dimmer-cues
"Creates a page of cues that assign dimmers and colors to the
lights. This is probably going to be assigned as the first page, but
can be moved by passing non-zero values for `page-x` and `page-y`.
If Beyond laser show integration is desired, `add-beyond?` will be
`true`. Similarly, if Open Sound Control integration is desired,
`add-osc?` will be `true`."
[page-x page-y add-beyond? add-osc?]
(let [x-base (* page-x 8)
y-base (* page-y 8)
rig-left (:x (first (show/fixtures-named :hex-2)))
rig-right (:x (first (show/fixtures-named :hex-1)))
rig-width (- rig-right rig-left)
hue-bar (oscillators/build-oscillated-param ; Spread a rainbow across a bar of music
(oscillators/sawtooth :interval :bar) :max 360)
desat-beat (oscillators/build-oscillated-param ; Desaturate a color as a beat progresses
(oscillators/sawtooth :down? true) :max 100)
hue-gradient (params/build-spatial-param ; Spread a rainbow across the light grid
(show/all-fixtures)
(fn [head] (- (:x head) (:min-x @(:dimensions *show*)))) :max 360)
rig-hue-gradient (params/build-spatial-param ; Spread a rainbow across just the main rig, repeating
(show/all-fixtures) ; beyond that, irrespective of other lights' positions.
(fn [head] (colors/clamp-hue (* 360 (/ (- (:x head) rig-left) rig-width)))))
hue-z-gradient (params/build-spatial-param ; Spread a rainbow across the light grid front to back
(show/all-fixtures)
(fn [head] (- (:z head) (:min-z @(:dimensions *show*)))) :max 360)]
;; Bottom row assigns colors, first to all fixtures, and then (at a higher priority, so they can
;; run a the same time as the first, and locally override it) individual fixture groups.
(make-color-cue "white" x-base y-base :include-color-wheels? true
:fixtures (show/all-fixtures) :effect-key :all-color :effect-name "Color all")
(doall (map-indexed (fn [i group]
(make-color-cue "white" (+ x-base (inc i)) y-base :include-color-wheels? true
:fixtures (show/fixtures-named group)
:effect-key (keyword (str (name group) "-color"))
:effect-name (str "Color " (name group))
:priority 1))
light-groups))
;; Some special/fun cues
(show/set-variable! :rainbow-saturation 100)
(show/set-cue! x-base (inc y-base)
(let [color-param (params/build-color-param :s :rainbow-saturation :l 50 :h hue-bar)]
(cues/cue :all-color (fn [_] (global-color-effect color-param))
:color-fn (cues/color-fn-from-param color-param)
:short-name "Rainbow Bar Fade"
:variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
:type :integer}])))
(show/set-cue! (inc x-base) (inc y-base)
(cues/cue :all-color (fn [_] (global-color-effect
(params/build-color-param :s :rainbow-saturation :l 50
:h rig-hue-gradient)
:include-color-wheels? true))
:short-name "Rainbow Rig"
:variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
:type :integer}]))
(show/set-cue! (+ x-base 2) (inc y-base)
(let [color-param (params/build-color-param :s :rainbow-saturation :l 50 :h hue-gradient
:adjust-hue hue-bar)]
(cues/cue :all-color (fn [_] (global-color-effect color-param))
:color-fn (cues/color-fn-from-param color-param)
:short-name "Rainbow Grid+Bar"
:variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
:type :integer}])))
(show/set-cue! (+ x-base 3) (inc y-base) ; Desaturate the rainbow as each beat progresses
(let [color-param (params/build-color-param :s desat-beat :l 50 :h hue-gradient
:adjust-hue hue-bar)]
(cues/cue :all-color (fn [_] (global-color-effect color-param))
:color-fn (cues/color-fn-from-param color-param)
:short-name "Rainbow Pulse")))
(show/set-cue! (+ x-base 4) (inc y-base)
(cues/cue :transform-colors (fn [_] (color-fx/transform-colors (show/all-fixtures)))
:priority 1000))
(show/set-cue! (+ x-base 5) (inc y-base)
(cues/cue :all-color (fn [_] (global-color-effect
(params/build-color-param :s 100 :l 50 :h hue-z-gradient)
:include-color-wheels? true))
:short-name "Z Rainbow Grid"))
(when add-beyond?
(show/set-cue! (+ x-base 6) (inc y-base)
(let [color-param (params/build-color-param :s :rainbow-saturation :l 50 :h hue-bar)]
(cues/cue :all-color (fn [_] (fx/scene "Rainbow with laser" (global-color-effect color-param)
(beyond/laser-color-effect laser-show color-param)))
:color-fn (cues/color-fn-from-param color-param)
:short-name "Rainbow with Laser"
:variables [{:key :rainbow-saturation :name "Saturatn" :min 0 :max 100 :start 100
:type :integer}]))))
(show/set-cue! (+ x-base 7) (inc y-base)
(let [color-param (params/build-color-param :s 100 :l 50 :h hue-gradient
:adjust-hue hue-bar)]
(cues/cue :all-color (fn [_] (global-color-effect color-param
:fixtures (show/fixtures-named "blade")))
:color-fn (cues/color-fn-from-param color-param)
:short-name "Rainbow Blades")))
#_(show/set-cue! (+ x-base 7) (+ y-base 7)
(cues/function-cue :strobe-all :strobe (show/all-fixtures) :effect-name "Raw Strobe"))
;; The fun sparkle cue, and a binding so TouchOSC can control it and show its state
(show/set-cue! (+ x-base 7) (+ y-base 2)
(cues/cue :sparkle (fn [var-map]
(cues/apply-merging-var-map var-map fun/sparkle (show/all-fixtures)))
:held true
:priority 100
:variables [{:key "chance" :min 0.0 :max 0.4 :start 0.05 :velocity true}
{:key "fade-time" :name "Fade" :min 1 :max 2000 :start 50 :type :integer}]))
(when add-osc?
(add-osc-cue-binding (+ x-base 7) (+ y-base 2) "/1/sparkle"))
;; Dimmer cues to turn on and set brightness of groups of lights
(make-dimmer-cue nil x-base (+ y-base 2) :yellow)
(doall (map-indexed (fn [i group] (make-dimmer-cue group (+ x-base (inc i)) (+ y-base 2) :yellow)) light-groups))
;; Dimmer oscillator cues: Sawtooth
(make-sawtooth-dimmer-cue nil x-base (+ y-base 3) :yellow)
(doall (map-indexed (fn [i group]
(make-sawtooth-dimmer-cue group (+ x-base (inc i)) (+ y-base 3) :orange)) light-groups))
;; Dimmer oscillator cues: Triangle
(make-triangle-dimmer-cue nil x-base (+ y-base 4) :orange)
(doall (map-indexed (fn [i group]
(make-triangle-dimmer-cue group (+ x-base (inc i)) (+ y-base 4) :red)) light-groups))
;; Dimmer oscillator cues: Sine
(make-sine-dimmer-cue nil x-base (+ y-base 5) :cyan)
(doall (map-indexed (fn [i group]
(make-sine-dimmer-cue group (+ x-base (inc i)) (+ y-base 5) :blue)) light-groups))
;; Dimmer oscillator cues: Square
(make-square-dimmer-cue nil x-base (+ y-base 6) :cyan)
(doall (map-indexed (fn [i group]
(make-square-dimmer-cue group (+ x-base (inc i)) (+ y-base 6) :green)) light-groups))
;; Strobe cues