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. The set up so incoming OSC messages update the value of that variable.
afterglow.examples
Show some simple ways to use Afterglow, and hopefully inspire exploration.
add-osc-cue-binding
(add-osc-cue-binding x y path)
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.
add-osc-var-binding
(add-osc-var-binding var-key path & {:keys [send-fn receive-fn]})
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
.
add-pan-tilt-controls
(add-pan-tilt-controls)
add-xyz-controls
(add-xyz-controls)
build-cross-scene
(build-cross-scene move-key reference-key color)
Create a scene which sets the color of one light, and aims it just below and in front of another.
build-group-cue-elements
(build-group-cue-elements group effect-suffix name-suffix)
Helper function which builds the common variables needed to create a cue which runs on either all lights or a named group of lights.
build-ratio-param
(build-ratio-param var-map)
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.
can-can
(can-can & {:keys [bars cycles stagger spread pan-min pan-max tilt-min tilt-max], :or {bars 1, cycles 1, stagger 0, spread 0, pan-min 0, pan-max 0, tilt-min -100, tilt-max 100}})
A effect that moves the blades like they are in a kick line.
ceiling
The location of the ceiling on the show Y axis.
circle-chain
(circle-chain fixtures ceiling? & {:keys [bars radius stagger], :or {bars 2, radius 1.0, stagger 0.0}})
Create a chase that generates a series of circles on either the floor or the ceiling, causing a single head to trace out each, and passing them along from head to head.
-
The number of bars taken to trace out each circle defaults to 2 and can be adjusted by passing a different value with the optional keyword argument :bars
. The radius of each circle defaults to one meter, and can be adjusted with :radius
. If you want each head to be tracing a different position in its circle, you can pass a value between zero and one with :stagger
.
crossover-chase
(crossover-chase & {:keys [beats fade-fraction cross-color end-color], :or {beats 1, fade-fraction 0, cross-color (colors/create-color :red), end-color (colors/create-color :yellow)}})
Create a sequential chase which gradually takes over all the moving heads from whatever they were doing, changes their colors, and makes them cross in an interesting pattern. By default, stages of the chase advance on every beat, but you can adjust that by passing in a different value for with the optional keyword argument :beats
. To add a fade between stages, pass a non-zero value (up to 1, which means continually fade) with :fade-fraction
.
-
The color used during the crossover stages defaults to red, but you can pass a different color object to use with :cross-color
.
dimmer-sweep
(dimmer-sweep fixtures osc & {:keys [width level fade], :or {width 0.1, level 255, fade false}})
An effect which uses an oscillator to move a bar of light across a group of fixtures. The width of the bar, maximum dimmer level, and whether the level should fade from the center of the bar to the edge, can be controlled with optional keyword arguments.
fiat-lux
(fiat-lux)
Start simple with a cool blue color from all the lights.
global-color-effect
(global-color-effect color & {:keys [include-color-wheels? fixtures effect-name], :or {fixtures (show/all-fixtures)}})
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
global-dimmer-effect
(global-dimmer-effect level & {:keys [effect-name add-virtual-dimmers?]})
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
group-end-keys
(group-end-keys effect-suffix)
Helper function to produce a vector of effect keywords to end all effects running on light groups with a given suffix.
house-rear-wall
The location of the wall behind the audience on the show Z axis.
ipad-address
The IP address of the iPad that will be used with OSC.
laser-show
Allows commands to be sent to the instance of Pangolin Beyond running alongside this light show, in order to affect laser cues.
left-wall
The location of the house left wall on the show X axis.
light-groups
The named groupings of lights to build rows of effects in the cue grid.
make-ambient-cues
(make-ambient-cues page-x page-y)
Create a page of cues for controlling lasers, and ambient effects like the H2O LED and black light.
-
Also holds cues for turning on sound active mode when the show operator wants to let things take care of themselves for a while, and doesn’t mind losing the ability to control show brightness via dimmer masters.
make-color-cue
(make-color-cue 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}})
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.
make-cues
(make-cues)
Create a bunch of example cues for experimentation.
make-dimmer-cue
(make-dimmer-cue group x y color)
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.
make-main-color-dimmer-cues
(make-main-color-dimmer-cues page-x page-y)
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
.
make-movement-cues
(make-movement-cues page-x page-y)
Create a page of with some large scale and layered movement effects. And miscellany which I’m not totally sure what to do with yet.
make-sawtooth-dimmer-cue
(make-sawtooth-dimmer-cue group x y color)
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.
make-sine-dimmer-cue
(make-sine-dimmer-cue group x y color)
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.
make-square-dimmer-cue
(make-square-dimmer-cue group x y color)
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.
make-strobe-cue
(make-strobe-cue name fixtures x y)
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 paramter 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.
make-strobe-cue-2
(make-strobe-cue-2 name fixtures x y)
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.
make-torrent-cues
(make-torrent-cues page-x page-y)
Create a page of cues for configuring aspects of the Torrent F3s and another to its right for their gobo selection.
make-triangle-dimmer-cue
(make-triangle-dimmer-cue group x y color)
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.
mapped-sparkle-test
(mapped-sparkle-test)
A verion of the sparkle test that creates a bunch of MIDI-mapped show variables to adjust parameters while it runs.
osc-client
Allow us to send messages to an OSC interface like TouchOSC.
osc-cue-bindings
Keep track of any OSC cue bindings we have set up, so we can clear them out before re-creating the show.
osc-demo
(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.
osc-shutdown
(osc-shutdown)
Shut down osc server and clean up.
osc-var-bindings
Keep track of any OSC var bindings we have set up, so we can clear them out before re-creating the show.
patch-lighting-rig
(patch-lighting-rig & {: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)}})
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.
+
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
.
add-pan-tilt-controls
(add-pan-tilt-controls)
add-xyz-controls
(add-xyz-controls)
build-cross-scene
(build-cross-scene move-key reference-key color)
Create a scene which sets the color of one light, and aims it just below and in front of another.
build-group-cue-elements
(build-group-cue-elements group effect-suffix name-suffix)
Helper function which builds the common variables needed to create a cue which runs on either all lights or a named group of lights.
build-ratio-param
(build-ratio-param var-map)
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.
can-can
(can-can & {:keys [bars cycles stagger spread pan-min pan-max tilt-min tilt-max], :or {bars 1, cycles 1, stagger 0, spread 0, pan-min 0, pan-max 0, tilt-min -100, tilt-max 100}})
A effect that moves the blades like they are in a kick line.
ceiling
The location of the ceiling on the show Y axis.
circle-chain
(circle-chain fixtures ceiling? & {:keys [bars radius stagger], :or {bars 2, radius 1.0, stagger 0.0}})
Create a chase that generates a series of circles on either the floor or the ceiling, causing a single head to trace out each, and passing them along from head to head.
+
The number of bars taken to trace out each circle defaults to 2 and can be adjusted by passing a different value with the optional keyword argument :bars
. The radius of each circle defaults to one meter, and can be adjusted with :radius
. If you want each head to be tracing a different position in its circle, you can pass a value between zero and one with :stagger
.
crossover-chase
(crossover-chase & {:keys [beats fade-fraction cross-color end-color], :or {beats 1, fade-fraction 0, cross-color (colors/create-color :red), end-color (colors/create-color :yellow)}})
Create a sequential chase which gradually takes over all the moving heads from whatever they were doing, changes their colors, and makes them cross in an interesting pattern. By default, stages of the chase advance on every beat, but you can adjust that by passing in a different value for with the optional keyword argument :beats
. To add a fade between stages, pass a non-zero value (up to 1, which means continually fade) with :fade-fraction
.
+
The color used during the crossover stages defaults to red, but you can pass a different color object to use with :cross-color
.
dimmer-sweep
(dimmer-sweep fixtures osc & {:keys [width level fade], :or {width 0.1, level 255, fade false}})
An effect which uses an oscillator to move a bar of light across a group of fixtures. The width of the bar, maximum dimmer level, and whether the level should fade from the center of the bar to the edge, can be controlled with optional keyword arguments.
fiat-lux
(fiat-lux)
Start simple with a cool blue color from all the lights.
global-color-effect
(global-color-effect color & {:keys [include-color-wheels? fixtures effect-name], :or {fixtures (show/all-fixtures)}})
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
global-dimmer-effect
(global-dimmer-effect level & {:keys [effect-name add-virtual-dimmers?]})
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
group-end-keys
(group-end-keys effect-suffix)
Helper function to produce a vector of effect keywords to end all effects running on light groups with a given suffix.
house-rear-wall
The location of the wall behind the audience on the show Z axis.
ipad-address
The IP address of the iPad that will be used with OSC.
laser-show
Allows commands to be sent to the instance of Pangolin Beyond running alongside this light show, in order to affect laser cues.
left-wall
The location of the house left wall on the show X axis.
light-groups
The named groupings of lights to build rows of effects in the cue grid.
make-ambient-cues
(make-ambient-cues page-x page-y)
Create a page of cues for controlling lasers, and ambient effects like the H2O LED and black light.
+
Also holds cues for turning on sound active mode when the show operator wants to let things take care of themselves for a while, and doesn’t mind losing the ability to control show brightness via dimmer masters.
make-color-cue
(make-color-cue 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}})
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.
make-cues
(make-cues add-beyond?)
Create a bunch of example cues for experimentation. If Beyond laser show integration is desired, add-beyond?
will be true
.
make-dimmer-cue
(make-dimmer-cue group x y color)
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.
make-main-color-dimmer-cues
(make-main-color-dimmer-cues page-x page-y add-beyond?)
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
.
make-movement-cues
(make-movement-cues page-x page-y)
Create a page of with some large scale and layered movement effects. And miscellany which I’m not totally sure what to do with yet.
make-sawtooth-dimmer-cue
(make-sawtooth-dimmer-cue group x y color)
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.
make-sine-dimmer-cue
(make-sine-dimmer-cue group x y color)
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.
make-square-dimmer-cue
(make-square-dimmer-cue group x y color)
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.
make-strobe-cue
(make-strobe-cue name fixtures x y)
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 paramter 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.
make-strobe-cue-2
(make-strobe-cue-2 name fixtures x y)
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.
make-torrent-cues
(make-torrent-cues page-x page-y)
Create a page of cues for configuring aspects of the Torrent F3s and another to its right for their gobo selection.
make-triangle-dimmer-cue
(make-triangle-dimmer-cue group x y color)
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.
mapped-sparkle-test
(mapped-sparkle-test)
A verion of the sparkle test that creates a bunch of MIDI-mapped show variables to adjust parameters while it runs.
osc-client
Allow us to send messages to an OSC interface like TouchOSC.
osc-cue-bindings
Keep track of any OSC cue bindings we have set up, so we can clear them out before re-creating the show.
osc-demo
(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.
osc-shutdown
(osc-shutdown)
Shut down osc server and clean up.
osc-var-bindings
Keep track of any OSC var bindings we have set up, so we can clear them out before re-creating the show.
patch-lighting-rig
(patch-lighting-rig & {: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)}})
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.
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.
right-wall
The location of the house right wall on the show X axis.
sample-show
Holds the sample show if it has been created, so it can be unregistered if it is being re-created.
sparkle-test
(sparkle-test)
Set up a sedate rainbow fade and then layer on a sparkle effect to test effect mixing.
stage-wall
The location of the wall behind the rig on the show Z axis.
step-param
A step parameter for controlling example chase cues. Change it to experiment with other kinds of timing and fades.
torrent-8
(torrent-8 & {:keys [bars cycles stagger spread pan-min pan-max tilt-min tilt-max], :or {bars 1, cycles 1, stagger 0, spread 0, pan-min -45, pan-max 45, tilt-min 0, tilt-max 45}})
A effect that moves the torrents in a figure 8.
try-laser-cues
(try-laser-cues server)
Create some cues that integrate Pangolin Beyond. Assumes sample show has been created, and takes the beyond server to work with as an argument.
use-sample-show
(use-sample-show & {:keys [universe extra-universe], :or {universe 1, extra-universe universe}})
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.
var-binder
Allows effects to set variables in the running show.
white
The color to flash strobe cues to identify them as such.
x-phase
(x-phase head show)
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.
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.