diff --git a/CHANGELOG.md b/CHANGELOG.md index 772aa292..c0a38297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ This change log follows the conventions of ## [Unreleased][unreleased] +Nothing yet. + +## [0.2.1] - 2016-04-03 + ### Added - The web and Push interfaces now offer a way to save adjusted cue @@ -29,6 +33,9 @@ This change log follows the conventions of - Launchpad Mini - Launchpad S (untested, but the Mini, which works, is based on the S) - Launchpad Mk2 +- The identity of grid controllers is verified before binding to them, + by sending a MIDI Device Inquiry message and inspecting the + response. - The auto-bind mechanism has been improved so much that the sample show can now simply turn it on to fully automate the process of detecting and binding to any compatible grid controllers that appear @@ -42,9 +49,6 @@ This change log follows the conventions of across fixtures. - Incoming MIDI System Exclusive messages can now be received and delivered to handlers. -- The identity of grid controllers is verified before binding to them, - by sending a MIDI Device Inquiry message and inspecting the - response. - Cue variables can now be Booleans, to support cues which want to be able to adjust the direction of a sawtooth oscillator while running. - The dimmer oscillator cues created in the sample show now include @@ -150,7 +154,7 @@ This change log follows the conventions of - The sample show is becoming a much more practical example of how to layer flexible color and dimmer cues, with good cue variables to add even more dimensions. -- A lot of repetitive code in the examples namespace was consolitated +- A lot of repetitive code in the examples namespace was consolidated using helper functions. - The `controllers/IOverlay` protocol was expanded to include the ability for an overlay to handle and absorb pitch-bend messages, in @@ -558,7 +562,8 @@ This change log follows the conventions of - Initial Public Release -[unreleased]: https://github.com/brunchboy/afterglow/compare/v0.2.0...HEAD +[unreleased]: https://github.com/brunchboy/afterglow/compare/v0.2.1...HEAD +[0.2.1]: https://github.com/brunchboy/afterglow/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/brunchboy/afterglow/compare/v0.1.6...v0.2.0 [0.1.6]: https://github.com/brunchboy/afterglow/compare/v0.1.5...v0.1.6 [0.1.5]: https://github.com/brunchboy/afterglow/compare/v0.1.4...v0.1.5 diff --git a/README.md b/README.md index a41c7e3d..c43c69a3 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This page provides an introduction in how to install and use Afterglow. The main [documentation](doc/README.adoc#afterglow-documentation) goes much deeper, and there is also -[API documentation](http://rawgit.com/brunchboy/afterglow/master/api-doc/index.html). +[API documentation](http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/index.html). For more interactive help, the [Afterglow room on Gitter](https://gitter.im/brunchboy/afterglow) is the place to start, and if you want to see (or contribute to) more @@ -346,7 +346,7 @@ tweak something quickly, you can use that: > when you are running from a jar rather than launching from a REPL, > you will often want to access a real REPL. You can accomplish that > with command-line arguments or by using the web console to invoke -> [core/start-nrepl](http://rawgit.com/brunchboy/afterglow/master/api-doc/afterglow.core.html#var-start-nrepl) +> [core/start-nrepl](http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/afterglow.core.html#var-start-nrepl) > and then connecting your favorite REPL environment to the network > REPL port you created. @@ -433,7 +433,7 @@ set up a Universe with ID 1. > will likely want to do something similar in setting up your own > shows, since a single show is the most common scenario. See the > `afterglow.show-context` -> [API documentation](http://rawgit.com/brunchboy/afterglow/master/api-doc/afterglow.show-context.html) +> [API documentation](http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/afterglow.show-context.html) > for more details. The `show-context` namespace also defines the > dynamic variable `*show*` which you can use to refer to the current > default show when you need to mention it explicitly, as you will see @@ -476,7 +476,7 @@ to the show’s dimmer grand master. Setting this to a value less than 100 scales the dimmer values sent to the lights down by that amount. So the above command dims the lights to 80% of their possible brightness, no matter what else the cues are trying to do. See the -[dimmer effects API documentation](http://rawgit.com/brunchboy/afterglow/master/api-doc/afterglow.effects.dimmer.html) +[dimmer effects API documentation](http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/afterglow.effects.dimmer.html) for more details. Here is an example of what I call right away when testing effects in my office with the little Korg nanoKONTROL 2 plugged in: diff --git a/api-doc/afterglow.beyond.html b/api-doc/afterglow.beyond.html index 81d78c2e..f0872de2 100644 --- a/api-doc/afterglow.beyond.html +++ b/api-doc/afterglow.beyond.html @@ -1,5 +1,5 @@ -afterglow.beyond documentation

afterglow.beyond

Provides the ability to communicate with Pangolin’s Beyond laser show software, including synchronizing it with Afterglow’s BPM and beat grid, and triggering cues. This initial implementation assumes that sending small UDP datagrams is fast enough that it can be done on the caller’s thread. If this turns out not to be true, it can be changed to use a core.async channel the way that ola-clojure does.

beyond-server

(beyond-server address port)

Creates a representation of the UDP PangoScript server running in Beyond at the specified address and port. The value returned can then be used with the other functions in this namespace to interact with that laser show.

bind-to-show

(bind-to-show server show)(bind-to-show server show resync-interval)

Causes the BPM of the laser show being run by the specified Beyond Talk server to be synced with the main metronome of the specified show. When sync is started, the beats will be synced as well, and they will be resynced periodically to correct for potential drift. The default resync interval is ten seconds, but it can be set to a different value by passing a resync interval, in milliseconds, as a third argument.

+afterglow.beyond documentation

afterglow.beyond

Provides the ability to communicate with Pangolin’s Beyond laser show software, including synchronizing it with Afterglow’s BPM and beat grid, and triggering cues. This initial implementation assumes that sending small UDP datagrams is fast enough that it can be done on the caller’s thread. If this turns out not to be true, it can be changed to use a core.async channel the way that ola-clojure does.

beyond-server

(beyond-server address port)

Creates a representation of the UDP PangoScript server running in Beyond at the specified address and port. The value returned can then be used with the other functions in this namespace to interact with that laser show.

bind-to-show

(bind-to-show server show)(bind-to-show server show resync-interval)

Causes the BPM of the laser show being run by the specified Beyond Talk server to be synced with the main metronome of the specified show. When sync is started, the beats will be synced as well, and they will be resynced periodically to correct for potential drift. The default resync interval is ten seconds, but it can be set to a different value by passing a resync interval, in milliseconds, as a third argument.

Also hooks this Beyond server instance into the supplied show’s rendering loop, so that the laser-related effects and assigners provided by this namespace can participate, even though they do not result in DMX values being sent to the show universes.

-

To undo a binding established by this function, simply call it again to bind to another show, or with a nil show to unbind entirely.

cue-effect

(cue-effect server page number)

An effect which causes a laser cue to run as long as it is active. The number of the grid page and the number of the cue within that page are passed as arguments (and cannot be dynamic parameters).

laser-color-effect

(laser-color-effect server color)

An effect which sets the Beyond RGBA cue color override to match the color parameter passed in, and sets it back to normal when ended.

restore-laser-color

(restore-laser-color server)

Sets Beyond’s Live Control RGBA cue color override to allow the affected cue to show its normal colors.

resync-to-beat

(resync-to-beat server)

Schedules a message to the laser show being run by the specified Beyond server to let it know when the beat after next takes place in its synchronized show. Has no effect if the server is not synced.

send-command

(send-command server command)

Sends a PangoScript command to the specified Beyond Talk server.

set-laser-color

(set-laser-color server c)

Sets Beyond’s Live Control RGBA cue color override to match the supplied color value.

\ No newline at end of file +

To undo a binding established by this function, simply call it again to bind to another show, or with a nil show to unbind entirely.

cue-effect

(cue-effect server page number)

An effect which causes a laser cue to run as long as it is active. The number of the grid page and the number of the cue within that page are passed as arguments (and cannot be dynamic parameters).

laser-color-effect

(laser-color-effect server color)

An effect which sets the Beyond RGBA cue color override to match the color parameter passed in, and sets it back to normal when ended.

restore-laser-color

(restore-laser-color server)

Sets Beyond’s Live Control RGBA cue color override to allow the affected cue to show its normal colors.

resync-to-beat

(resync-to-beat server)

Schedules a message to the laser show being run by the specified Beyond server to let it know when the beat after next takes place in its synchronized show. Has no effect if the server is not synced.

send-command

(send-command server command)

Sends a PangoScript command to the specified Beyond Talk server.

set-laser-color

(set-laser-color server c)

Sets Beyond’s Live Control RGBA cue color override to match the supplied color value.

\ No newline at end of file diff --git a/api-doc/afterglow.channels.html b/api-doc/afterglow.channels.html index cd7289e8..39766958 100644 --- a/api-doc/afterglow.channels.html +++ b/api-doc/afterglow.channels.html @@ -1,16 +1,16 @@ -afterglow.channels documentation

afterglow.channels

Functions for modeling DMX channels

all-addresses

(all-addresses fixtures)

Returns all the addresses being used by a list of patched fixtures, including those used by any fixture heads.

build-function

(build-function range-type function-type label & {:keys [start end var-label], :or {start 0, end 255}})

Returns a function spefication that encompasses a range of possible DMX values for a channel. If start and end are not specified, the function uses the full range of the channel.

channel

(channel offset)

Creates a minimal channel specification, containing just the address offset within the fixture’s list of channels. The first channel used by a fixture is, by convention, given offset 1.

-

You probably want to use fine-channel rather than this function to create even channels which do not have a :fine-offset because of the other helpful features it offers, such as setting up the channel function specification for you.

color

(color offset color & {:keys [hue function-label fine-offset]})

A channel which controls a color component. If :hue is supplied along with a hue value, this channel will participate in color mixing even if color is not one of the standard values :red, :green, :blue, or :white whose hues and contributions to color mixing are automatically understood.

+afterglow.channels documentation

afterglow.channels

Functions for modeling DMX channels

all-addresses

(all-addresses fixtures)

Returns all the addresses being used by a list of patched fixtures, including those used by any fixture heads.

build-function

(build-function range-type function-type label & {:keys [start end var-label], :or {start 0, end 255}})

Returns a function spefication that encompasses a range of possible DMX values for a channel. If start and end are not specified, the function uses the full range of the channel.

channel

(channel offset)

Creates a minimal channel specification, containing just the address offset within the fixture’s list of channels. The first channel used by a fixture is, by convention, given offset 1.

+

You probably want to use fine-channel rather than this function to create even channels which do not have a :fine-offset because of the other helpful features it offers, such as setting up the channel function specification for you.

color

(color offset color & {:keys [hue function-label fine-offset]})

A channel which controls a color component. If :hue is supplied along with a hue value, this channel will participate in color mixing even if color is not one of the standard values :red, :green, :blue, or :white whose hues and contributions to color mixing are automatically understood.

By default, the function created for the channel uses the name of the color keyword as its function label. Since this label is displayed in the web interface as the text label in the cue grid cell for Function Cues created for the function, you may wish to specify a more readable name, which you can do by passing it in with :function-label.

-

If the fixture uses two-byte values for this color component, pass the offset of the channel containing the most-significant byte in offset, and specify the offset of the channel containing the least-significant byte with :fine-offset.

color-wheel-hue

(color-wheel-hue hue & {:keys [range label], :or {range :fixed}})

Creates a function specification which identifies a color wheel position with a particular hue, so it can participate in Afterglow’s color effects. The hue can be specified as a number, a jolby/colors object, or a string which is passed to the jolby/colors create-color function.

+

If the fixture uses two-byte values for this color component, pass the offset of the channel containing the most-significant byte in offset, and specify the offset of the channel containing the least-significant byte with :fine-offset.

color-wheel-hue

(color-wheel-hue hue & {:keys [range label], :or {range :fixed}})

Creates a function specification which identifies a color wheel position with a particular hue, so it can participate in Afterglow’s color effects. The hue can be specified as a number, a jolby/colors object, or a string which is passed to the jolby/colors create-color function.

The label to assign the function spec can be passed via the :label optional keyword argument, or it will be inferred from the hue value supplied. The function spec will be considered a fixed range unless you specify :range :variable.

-

If hue is a sequence, then returns a sequence of the results of calling color-wheel-hue on each of the elements in that sequence, with the same optional arguments.

dimmer

(dimmer offset & {:keys [inverted-from fine-offset]})

A channel which controls a dimmer.

+

If hue is a sequence, then returns a sequence of the results of calling color-wheel-hue on each of the elements in that sequence, with the same optional arguments.

dimmer

(dimmer offset & {:keys [inverted-from fine-offset]})

A channel which controls a dimmer.

Normal dimmers are dark at zero, and get brighter as the channel value increases, to a maximum brightness at 255. However, some fixtures have inverted dimmers. If that is the case, pass the DMX value at which the inversion takes place with :inverted-from. For example, fixtures which are brightest at zero and darken as the value approaches 255 would be specified as :inverted-from 0, while fixtures which are dark at zero, jump to maximum brightness at 1, then dim as the value grows towards 255 would be specified as :inverted-from 1.

-

If the fixture uses two-byte values for the dimmer level, pass the offset of the channel containing the most-significant byte in offset, and specify the offset of the channel containing the least-significant byte with :fine-offset.

expand-heads

(expand-heads fixtures)

Given a list of fixtures, expands it to include the heads.

extract-channels

(extract-channels fixtures pred)

Given a fixture list, returns the channels matching the specified predicate.

extract-heads-with-some-matching-channel

(extract-heads-with-some-matching-channel fixtures pred)

Given a fixture list, returns all heads (which may be top-level fixtures too) whose channels contain a match for the specified predicate.

find-rgb-heads

(find-rgb-heads fixtures)(find-rgb-heads fixtures include-color-wheels?)

Returns all heads of the supplied fixtures which are capable of mixing RGB color, in other words they have at least a red, green, and blue color channel. If the second argument is present and true, also returns heads with color wheels.

fine-channel

(fine-channel chan-type offset & {:keys [fine-offset function-type function-name var-label], :or {function-type chan-type}})

Defines a channel of type chan-type which may be paired with a second channel in order to support multi-byte values. When a value is passed in with :fine-offset, the channel specified by offset is understood as containing the most-significant byte of a two-byte value, with the least-significant byte carried in the channel whose offset followed :fine-offset.

+

If the fixture uses two-byte values for the dimmer level, pass the offset of the channel containing the most-significant byte in offset, and specify the offset of the channel containing the least-significant byte with :fine-offset.

expand-heads

(expand-heads fixtures)

Given a list of fixtures, expands it to include the heads.

extract-channels

(extract-channels fixtures pred)

Given a fixture list, returns the channels matching the specified predicate.

extract-heads-with-some-matching-channel

(extract-heads-with-some-matching-channel fixtures pred)

Given a fixture list, returns all heads (which may be top-level fixtures too) whose channels contain a match for the specified predicate.

find-rgb-heads

(find-rgb-heads fixtures)(find-rgb-heads fixtures include-color-wheels?)

Returns all heads of the supplied fixtures which are capable of mixing RGB color, in other words they have at least a red, green, and blue color channel. If the second argument is present and true, also returns heads with color wheels.

fine-channel

(fine-channel chan-type offset & {:keys [fine-offset function-type function-name var-label], :or {function-type chan-type}})

Defines a channel of type chan-type which may be paired with a second channel in order to support multi-byte values. When a value is passed in with :fine-offset, the channel specified by offset is understood as containing the most-significant byte of a two-byte value, with the least-significant byte carried in the channel whose offset followed :fine-offset.

Automatically creates a function specification which spans all the legal DMX values for the channel. By default, the function type is taken to be the same as chan-type, but this can be changed by passing in a different keyword with :function-type.

Similarly, the name of the function created is, by default, a capitalized version of the function type (without its leading colon). Since this name is displayed in the web interface as the text label in the cue grid cell for Function Cues created for the function, you may wish to specify a more readable name, which you can do by passing it with :function-name.

-

Finally, you may specify a label to be used when creating a user interface for adjusting the value associated with this function. Function Cues will use this as the label for the cue-local variable they create, and it will appear in places like the Ableton Push Effect Control interface. You can specify what this variable label should be with :var-label; if you do not, the generic label Level will be used.

focus

(focus offset)(focus offset fine-offset)

A channel which adjusts focus, with an optional second channel for fine control.

frost

(frost offset)(frost offset fine-offset)

A channel which adjusts frost, with an optional second channel for fine control.

functions

(functions chan-type offset & functions)

Defines a channel whose values are divided up into different ranges which perform different functions. After the channel type and DMX offset, pass a list of starting values and function specifications.

+

Finally, you may specify a label to be used when creating a user interface for adjusting the value associated with this function. Function Cues will use this as the label for the cue-local variable they create, and it will appear in places like the Ableton Push Effect Control interface. You can specify what this variable label should be with :var-label; if you do not, the generic label Level will be used.

focus

(focus offset)(focus offset fine-offset)

A channel which adjusts focus, with an optional second channel for fine control.

frost

(frost offset)(frost offset fine-offset)

A channel which adjusts frost, with an optional second channel for fine control.

functions

(functions chan-type offset & functions)

Defines a channel whose values are divided up into different ranges which perform different functions. After the channel type and DMX offset, pass a list of starting values and function specifications.

The simplest form of specification is a keyword or string identifying the function type; this will be expanded into a variable-range (for keywords) or fixed-range (for strings) function of that type.

For more complex functions, pass in a map containing the :type keyword and any other settings you need to make (e.g. :label, :range, :var-label), and the rest will be filled in for you.

To skip a range, pass nil for its specification.

@@ -20,4 +20,4 @@ 10 "Strobe Random" 20 :strobe) -

See the online documentation for more details and examples.

has-rgb-heads?

(has-rgb-heads? fixture)(has-rgb-heads? fixture include-color-wheels?)

Given a fixture, returns a truthy value if it has any heads capable of mixing RGB color. If the second argument is present and true, having a head with a color wheel is good enough.

iris

(iris offset)(iris offset fine-offset)

A channel which controls an iris, with an optional second channel for fine control.

pan

(pan offset)(pan offset fine-offset)

A channel which pans a moving head, with an optional second channel for fine control.

patch-fixture

(patch-fixture fixture universe start-address id-fn)

Assign a fixture to a DMX universe and starting channel; resolves all of its channel assignments.

tilt

(tilt offset)(tilt offset fine-offset)

A channel which tilts a moving head, with an optional second channel for fine control.

zoom

(zoom offset)(zoom offset fine-offset)

A channel which adjusts zoom, with an optional second channel for fine control.

\ No newline at end of file +

See the online documentation for more details and examples.

has-rgb-heads?

(has-rgb-heads? fixture)(has-rgb-heads? fixture include-color-wheels?)

Given a fixture, returns a truthy value if it has any heads capable of mixing RGB color. If the second argument is present and true, having a head with a color wheel is good enough.

iris

(iris offset)(iris offset fine-offset)

A channel which controls an iris, with an optional second channel for fine control.

pan

(pan offset)(pan offset fine-offset)

A channel which pans a moving head, with an optional second channel for fine control.

patch-fixture

(patch-fixture fixture universe start-address id-fn)

Assign a fixture to a DMX universe and starting channel; resolves all of its channel assignments.

tilt

(tilt offset)(tilt offset fine-offset)

A channel which tilts a moving head, with an optional second channel for fine control.

zoom

(zoom offset)(zoom offset fine-offset)

A channel which adjusts zoom, with an optional second channel for fine control.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.ableton-push-2.html b/api-doc/afterglow.controllers.ableton-push-2.html index 69cc7498..594f8aa6 100644 --- a/api-doc/afterglow.controllers.ableton-push-2.html +++ b/api-doc/afterglow.controllers.ableton-push-2.html @@ -1,7 +1,7 @@ -afterglow.controllers.ableton-push-2 documentation

afterglow.controllers.ableton-push-2

Allows the Ableton Push 2 to be used as a control surface for Afterglow. Its features are described in the online documentation.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

amber-color

The color for bright amber buttons.

build-touch-strip-mode

(build-touch-strip-mode & flags)

Calculate a touch strip mode byte based on a list of flags (keys in touch-strip-mode-flags).

button-cell-margin

The number of pixels to keep blank between labels of adjacent buttons.

button-cell-width

The number of pixels allocated to each button above or below the graphical display.

calculate-text-width

(calculate-text-width graphics font text)

Figure out how many pixels wide some text will be in a given font.

clear-all-touch-strip-leds

(clear-all-touch-strip-leds controller)

Send a System Exclusive message which requests all touch strip LEDs be turned off.

clear-display

(clear-display controller)

Clear the graphical display.

clear-interface

(clear-interface controller)

Clears the graphical display and all illuminated buttons and pads.

control-buttons

The labeled buttons which send and respond to Control Change events.

create-graphics

(create-graphics controller)

Create the graphics object we will use to draw in the display, and configure its rendering hints properly.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

-

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

default-track-color

The color gauge tracks will use unless otherwise specified.

dim

(dim color)

Return a dimmed version of a color.

dim-amber-color

The color for dim amber buttons.

dim-green-color

The color for dim green buttons.

dim-red-color

The color for dim red buttons.

dim-white-color

The color for dim white buttons.

draw-attributed-variable-value

(draw-attributed-variable-value controller index encoder-count attributed-string color)

Draw a label under an encoder at the top of the graphical display, with an attributed string so the label can have mixed fonts, colors, etc. Assumes the value will fit in the allocated space.

draw-beat-mark

(draw-beat-mark graphics snapshot beat-position)

Draw one of the marks representing a beat on the beat grid.

draw-boolean-gauge

(draw-boolean-gauge controller index encoder-count value & {:keys [track-color active-color fraction], :or {track-color default-track-color, active-color track-color, fraction 1.0}})

Draw a graphical gauge with an indicator that covers the left or right half of an arc under a variable value, depending on if the value is true or false. The default color for both the track and active area is dim white. To support animating state changes, a fraction parameter can be supplied which specifies how far from the opposite state the indicator should be drawn.

draw-bottom-button-label

(draw-bottom-button-label controller index text color & {:keys [background-color], :or {background-color off-color}})

Draw a label for a button below the graphical display.

draw-circular-gauge

(draw-circular-gauge controller index encoder-count value & {:keys [lowest highest track-color active-color], :or {lowest 0, highest 360, track-color default-track-color, active-color track-color}})

Draw a graphical gauge with an indicator that rides around an circle (starting at the bottom) under a variable value. The default range is from 0 to 360 (for hues), and the default color for both the track and active area is dim white.

draw-cue-variable-gauge

(draw-cue-variable-gauge controller index encoder-count cue cue-var effect-id)

Draw an appropriate gauge for a cue variable given its type and value.

draw-cue-variable-gauges

(draw-cue-variable-gauges controller x cue effect-id)

Displays the appropriate style of adjustment gauge for variables currently assigned to the encoders over an active cue.

draw-cue-variable-names

(draw-cue-variable-names controller x cue effect-id)

Draw the names of adjustable variables under the appropriate encoders for a cue.

draw-cue-variable-value

(draw-cue-variable-value controller index encoder-count text color)(draw-cue-variable-value controller index encoder-count text color font)

Draw a label under an encoder at the top of the graphical display.

draw-cue-visualizer

(draw-cue-visualizer controller snapshot cell-x cue var-map)

Displays an animated visualization of the cue progress right above the name for cues which support this.

draw-encoder-button-label

(draw-encoder-button-label controller index encoder-count text color)

Draw a label under an encoder at the top of the graphical display.

draw-gauge

(draw-gauge controller index encoder-count value & {:keys [lowest highest track-color active-color], :or {lowest 0, highest 100, track-color default-track-color, active-color track-color}})

Draw a graphical gauge with an indicator that fills an arc under a variable value. The default range is from zero to a hundred, and the default color for both the track and active area is dim white.

draw-hue-gauge

(draw-hue-gauge controller index encoder-count value active?)

Draw a graphical gauge whose colors are the hues of the color circle, with an indicator that rides around an circle (starting at the bottom) under a variable value.

draw-null-gauge

(draw-null-gauge controller index encoder-count color)

Draw a mostly meaningless gauge simply to indicate that the encoder is doing something. Used for beat adjustments, for example, which have no reasonable range or location to show.

draw-pan-gauge

(draw-pan-gauge controller index encoder-count value & {:keys [lowest highest track-color active-color], :or {lowest 0, highest 100, track-color default-track-color, active-color track-color}})

Draw a graphical gauge with an indicator that extends from the top center of an arc under a variable value. The default range is from zero to a hundred, and the default color for both the track and active area is dim white.

draw-saturation-gauge

(draw-saturation-gauge controller index encoder-count hue value active?)

Draw a graphical gauge whose colors are the saturation levels of the specified hue circle, with an indicator like that of a level gauge, under a variable value.

empty-grid-pads

A representation of the state when all 64 of the grid pads are off.

empty-top-pads

A representation of the state when all eight of the top pads are off.

encoder-label-underline-height

The height at which to draw the line under an encoder label.

fit-string

(fit-string text font render-context max-width)

Truncates a string (appending an ellipsis) enough to fit within a given pixel width.

font-for-cue-variable-emphasis

The font used when drawing cue variable values.

font-for-cue-variable-values

The font used when drawing cue variable values.

font-for-encoder-button-label

The font used when drawing labels under encoders.

font-for-metronome-values

The font used when drawing metronome values.

fonts-loaded

get-display-font

(get-display-font k style size)

Find one of the fonts configured for use on the display by keyword, which should be one of :condensed, :condensed-light, :roboto, or :roboto-medium. The style argument is a java.awt.Font style constant, and size is point size.

-

Roboto is available in all style variations, Roboto Medium in plain and italic, Condensed only in bold, and condensed light in plain and italic.

green-color

The color for bright green buttons.

in-mode?

(in-mode? controller button)

Check whether the controller is in a particular mode, identified by a control button number or keyword.

load-fonts

(load-fonts)

Load and register the fonts we will use to draw on the display, if they have not already been.

master-background

The background for the grand master section, to mark it as such.

master-content

The color for content in the metronome section, to mark it as such.

metronome-background

The background for the metronome section, to mark it as such.

metronome-content

The color for content in the metronome section, to mark it as such.

no-effects-active-color

The color to use for the text explaining that no effects are active.

off-color

The color of buttons that are completely off.

port-filter

Because the Push registers multiple ports with the MIDI environment, we need to be sure to bind only to the User port. This filter is used with filter-devices to screen out any port that does not seem to be the User port. If port names are assigned differently on your operating system, you may need to change this.

record-interface

(record-interface controller path & {:keys [loop], :or {loop true}})

Capture an animated GIF of the display for documentation purposes. Takes a filename to which the animation should be written. Returns a function which you must call to end the recording and close the file. Defaults to creating an animation which loops, but you can override that by passing false with the optional keyword argument :loop.

red-color

The color for bright red buttons.

send-sysex

(send-sysex controller command)

Send a MIDI System Exclusive command to the Push 2 with the proper prefix. The command argument begins with the Command ID of the desired command, as listed in Table 2.4.2 of the Ableton Push 2 MIDI and Display Interface Manual, followed by its parameter bytes. The SOX byte, Ableton Sysex ID, device ID, and model ID will be prepended, and the EOX byte appended, before sending the command.

set-button-color

(set-button-color controller button color)

Set one of the labeled buttons to a particular color (if it is a monochrome button, the lightness of the color is translated to a control value; otherwise, the palette entry assigned to the button is set to the specified color, and the corresponding velocity is sent.

set-cc-led-color

(set-cc-led-color controller control palette-index color)

Set one of the color LEDs that respond to control change values to a particular color. If the color is black, we send a control value of zero. Otherwise, we take over the color palette entry assigned to the LED, and set it to the desired RGB value, then send it a control change with the velocity corresponding to the palette entry we just adjusted.

-

Since we also have to set a white value, we pass along the white value that was present in the palette we found for this entry when initially binding to the Push 2.

set-encoder-pad-color

(set-encoder-pad-color controller x color)

Set one of the pads below the row of display encoders to a particular color.

set-graphics-color

(set-graphics-color graphics color)

Set the paint of the supplied graphics context to use the specified color.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color. If the color is black, we send a note off to the pad. Otherwise, we take over the color palette entry whose velocity matches the note number of the pad, and set it to the desired RGB value, then send it a note with the velocity corresponding to the palette entry we just adjusted.

-

Since we also have to set a white value, we pass along the white value that was present in the palette we found for this velocity when initially binding to the Push 2.

set-top-pad-color

(set-top-pad-color controller x color)

Set one of the top-row pads (between the grid and the display) to a particular color.

set-touch-strip-mode

(set-touch-strip-mode controller mode)

Set the touch strip operating mode.

show-labels

(show-labels controller)(show-labels controller color)

Illuminates all buttons with text labels, for development assistance.

sign-velocity

(sign-velocity val)

Convert a midi velocity to its signed equivalent, to translate encoder rotations, which are twos-complement seven bit numbers.

stop-indicator

The overlay drawn on top of the effects when the show is stopped.

string-width

(string-width text font render-context)

Determines how many pixels wide a string will be in a given font and render context.

touch-strip-mode-default

The mode to which we should return the touch strip when we are shutting down.

touch-strip-mode-flags

The values which are combined to set the touch strip into particular modes.

touch-strip-mode-hue

The mode to which we should set the touch strip when the user is editing a hue.

touch-strip-mode-level

The mode to which we should set the touch strip when the user is editing a pan-style control.

touch-strip-mode-pan

The mode to which we should set the touch strip when the user is editing a level-style control.

touch-strip-mode-sysex

The mode to which we should set the touch strip when we want to be able to individually set LEDs, for example to turn them all off.

white-color

The color for bright white buttons.

\ No newline at end of file +afterglow.controllers.ableton-push-2 documentation

afterglow.controllers.ableton-push-2

Allows the Ableton Push 2 to be used as a control surface for Afterglow. Its features are described in the online documentation.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

amber-color

The color for bright amber buttons.

build-touch-strip-mode

(build-touch-strip-mode & flags)

Calculate a touch strip mode byte based on a list of flags (keys in touch-strip-mode-flags).

button-cell-margin

The number of pixels to keep blank between labels of adjacent buttons.

button-cell-width

The number of pixels allocated to each button above or below the graphical display.

calculate-text-width

(calculate-text-width graphics font text)

Figure out how many pixels wide some text will be in a given font.

clear-all-touch-strip-leds

(clear-all-touch-strip-leds controller)

Send a System Exclusive message which requests all touch strip LEDs be turned off.

clear-display

(clear-display controller)

Clear the graphical display.

clear-interface

(clear-interface controller)

Clears the graphical display and all illuminated buttons and pads.

control-buttons

The labeled buttons which send and respond to Control Change events.

create-graphics

(create-graphics controller)

Create the graphics object we will use to draw in the display, and configure its rendering hints properly.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

+

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

default-track-color

The color gauge tracks will use unless otherwise specified.

dim

(dim color)

Return a dimmed version of a color.

dim-amber-color

The color for dim amber buttons.

dim-green-color

The color for dim green buttons.

dim-red-color

The color for dim red buttons.

dim-white-color

The color for dim white buttons.

draw-attributed-variable-value

(draw-attributed-variable-value controller index encoder-count attributed-string color)

Draw a label under an encoder at the top of the graphical display, with an attributed string so the label can have mixed fonts, colors, etc. Assumes the value will fit in the allocated space.

draw-beat-mark

(draw-beat-mark graphics snapshot beat-position)

Draw one of the marks representing a beat on the beat grid.

draw-boolean-gauge

(draw-boolean-gauge controller index encoder-count value & {:keys [track-color active-color fraction], :or {track-color default-track-color, active-color track-color, fraction 1.0}})

Draw a graphical gauge with an indicator that covers the left or right half of an arc under a variable value, depending on if the value is true or false. The default color for both the track and active area is dim white. To support animating state changes, a fraction parameter can be supplied which specifies how far from the opposite state the indicator should be drawn.

draw-bottom-button-label

(draw-bottom-button-label controller index text color & {:keys [background-color], :or {background-color off-color}})

Draw a label for a button below the graphical display.

draw-circular-gauge

(draw-circular-gauge controller index encoder-count value & {:keys [lowest highest track-color active-color], :or {lowest 0, highest 360, track-color default-track-color, active-color track-color}})

Draw a graphical gauge with an indicator that rides around an circle (starting at the bottom) under a variable value. The default range is from 0 to 360 (for hues), and the default color for both the track and active area is dim white.

draw-cue-variable-gauge

(draw-cue-variable-gauge controller index encoder-count cue cue-var effect-id)

Draw an appropriate gauge for a cue variable given its type and value.

draw-cue-variable-gauges

(draw-cue-variable-gauges controller x cue effect-id)

Displays the appropriate style of adjustment gauge for variables currently assigned to the encoders over an active cue.

draw-cue-variable-names

(draw-cue-variable-names controller x cue effect-id)

Draw the names of adjustable variables under the appropriate encoders for a cue.

draw-cue-variable-value

(draw-cue-variable-value controller index encoder-count text color)(draw-cue-variable-value controller index encoder-count text color font)

Draw a label under an encoder at the top of the graphical display.

draw-cue-visualizer

(draw-cue-visualizer controller snapshot cell-x cue var-map)

Displays an animated visualization of the cue progress right above the name for cues which support this.

draw-encoder-button-label

(draw-encoder-button-label controller index encoder-count text color)

Draw a label under an encoder at the top of the graphical display.

draw-gauge

(draw-gauge controller index encoder-count value & {:keys [lowest highest track-color active-color], :or {lowest 0, highest 100, track-color default-track-color, active-color track-color}})

Draw a graphical gauge with an indicator that fills an arc under a variable value. The default range is from zero to a hundred, and the default color for both the track and active area is dim white.

draw-hue-gauge

(draw-hue-gauge controller index encoder-count value active?)

Draw a graphical gauge whose colors are the hues of the color circle, with an indicator that rides around an circle (starting at the bottom) under a variable value.

draw-null-gauge

(draw-null-gauge controller index encoder-count color)

Draw a mostly meaningless gauge simply to indicate that the encoder is doing something. Used for beat adjustments, for example, which have no reasonable range or location to show.

draw-pan-gauge

(draw-pan-gauge controller index encoder-count value & {:keys [lowest highest track-color active-color], :or {lowest 0, highest 100, track-color default-track-color, active-color track-color}})

Draw a graphical gauge with an indicator that extends from the top center of an arc under a variable value. The default range is from zero to a hundred, and the default color for both the track and active area is dim white.

draw-saturation-gauge

(draw-saturation-gauge controller index encoder-count hue value active?)

Draw a graphical gauge whose colors are the saturation levels of the specified hue circle, with an indicator like that of a level gauge, under a variable value.

empty-grid-pads

A representation of the state when all 64 of the grid pads are off.

empty-top-pads

A representation of the state when all eight of the top pads are off.

encoder-label-underline-height

The height at which to draw the line under an encoder label.

fit-string

(fit-string text font render-context max-width)

Truncates a string (appending an ellipsis) enough to fit within a given pixel width.

font-for-cue-variable-emphasis

The font used when drawing cue variable values.

font-for-cue-variable-values

The font used when drawing cue variable values.

font-for-encoder-button-label

The font used when drawing labels under encoders.

font-for-metronome-values

The font used when drawing metronome values.

fonts-loaded

get-display-font

(get-display-font k style size)

Find one of the fonts configured for use on the display by keyword, which should be one of :condensed, :condensed-light, :roboto, or :roboto-medium. The style argument is a java.awt.Font style constant, and size is point size.

+

Roboto is available in all style variations, Roboto Medium in plain and italic, Condensed only in bold, and condensed light in plain and italic.

green-color

The color for bright green buttons.

in-mode?

(in-mode? controller button)

Check whether the controller is in a particular mode, identified by a control button number or keyword.

load-fonts

(load-fonts)

Load and register the fonts we will use to draw on the display, if they have not already been.

master-background

The background for the grand master section, to mark it as such.

master-content

The color for content in the metronome section, to mark it as such.

metronome-background

The background for the metronome section, to mark it as such.

metronome-content

The color for content in the metronome section, to mark it as such.

no-effects-active-color

The color to use for the text explaining that no effects are active.

off-color

The color of buttons that are completely off.

port-filter

Because the Push registers multiple ports with the MIDI environment, we need to be sure to bind only to the User port. This filter is used with filter-devices to screen out any port that does not seem to be the User port. If port names are assigned differently on your operating system, you may need to change this.

record-interface

(record-interface controller path & {:keys [loop], :or {loop true}})

Capture an animated GIF of the display for documentation purposes. Takes a filename to which the animation should be written. Returns a function which you must call to end the recording and close the file. Defaults to creating an animation which loops, but you can override that by passing false with the optional keyword argument :loop.

red-color

The color for bright red buttons.

send-sysex

(send-sysex controller command)

Send a MIDI System Exclusive command to the Push 2 with the proper prefix. The command argument begins with the Command ID of the desired command, as listed in Table 2.4.2 of the Ableton Push 2 MIDI and Display Interface Manual, followed by its parameter bytes. The SOX byte, Ableton Sysex ID, device ID, and model ID will be prepended, and the EOX byte appended, before sending the command.

set-button-color

(set-button-color controller button color)

Set one of the labeled buttons to a particular color (if it is a monochrome button, the lightness of the color is translated to a control value; otherwise, the palette entry assigned to the button is set to the specified color, and the corresponding velocity is sent.

set-cc-led-color

(set-cc-led-color controller control palette-index color)

Set one of the color LEDs that respond to control change values to a particular color. If the color is black, we send a control value of zero. Otherwise, we take over the color palette entry assigned to the LED, and set it to the desired RGB value, then send it a control change with the velocity corresponding to the palette entry we just adjusted.

+

Since we also have to set a white value, we pass along the white value that was present in the palette we found for this entry when initially binding to the Push 2.

set-encoder-pad-color

(set-encoder-pad-color controller x color)

Set one of the pads below the row of display encoders to a particular color.

set-graphics-color

(set-graphics-color graphics color)

Set the paint of the supplied graphics context to use the specified color.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color. If the color is black, we send a note off to the pad. Otherwise, we take over the color palette entry whose velocity matches the note number of the pad, and set it to the desired RGB value, then send it a note with the velocity corresponding to the palette entry we just adjusted.

+

Since we also have to set a white value, we pass along the white value that was present in the palette we found for this velocity when initially binding to the Push 2.

set-top-pad-color

(set-top-pad-color controller x color)

Set one of the top-row pads (between the grid and the display) to a particular color.

set-touch-strip-mode

(set-touch-strip-mode controller mode)

Set the touch strip operating mode.

show-labels

(show-labels controller)(show-labels controller color)

Illuminates all buttons with text labels, for development assistance.

sign-velocity

(sign-velocity val)

Convert a midi velocity to its signed equivalent, to translate encoder rotations, which are twos-complement seven bit numbers.

stop-indicator

The overlay drawn on top of the effects when the show is stopped.

string-width

(string-width text font render-context)

Determines how many pixels wide a string will be in a given font and render context.

touch-strip-mode-default

The mode to which we should return the touch strip when we are shutting down.

touch-strip-mode-flags

The values which are combined to set the touch strip into particular modes.

touch-strip-mode-hue

The mode to which we should set the touch strip when the user is editing a hue.

touch-strip-mode-level

The mode to which we should set the touch strip when the user is editing a pan-style control.

touch-strip-mode-pan

The mode to which we should set the touch strip when the user is editing a level-style control.

touch-strip-mode-sysex

The mode to which we should set the touch strip when we want to be able to individually set LEDs, for example to turn them all off.

white-color

The color for bright white buttons.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.ableton-push.html b/api-doc/afterglow.controllers.ableton-push.html index 5c3668c1..f4861b9c 100644 --- a/api-doc/afterglow.controllers.ableton-push.html +++ b/api-doc/afterglow.controllers.ableton-push.html @@ -1,15 +1,15 @@ -afterglow.controllers.ableton-push documentation

afterglow.controllers.ableton-push

Allows the Ableton Push to be used as a control surface for Afterglow. Its features are described in the online documentation.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

auto-bind

deprecated in 0.2.1

(auto-bind show & {:keys [device-filter refresh-interval display-name], :or {device-filter "User Port", refresh-interval (/ 1000 15), display-name "Ableton Push"}})

Deprecated in favor of the shared controllers/auto-bind implementation.

+afterglow.controllers.ableton-push documentation

afterglow.controllers.ableton-push

Allows the Ableton Push to be used as a control surface for Afterglow. Its features are described in the online documentation.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

auto-bind

deprecated in 0.2.1

(auto-bind show & {:keys [device-filter refresh-interval display-name], :or {device-filter "User Port", refresh-interval (/ 1000 15), display-name "Ableton Push"}})

Deprecated in favor of the shared controllers/auto-bind implementation.

Watches for an Ableton Push controller to be connected, and as soon as it is, binds it to the specified show using bind-to-show. If that controller ever gets disconnected, it will be re-bound once it reappears. Returns a watcher structure which can be passed to deactivate if you would like to stop it watching for reconnections. The underlying controller mapping, once bound, can be accessed through the watcher’s :controller key.

If you have more than one Ableton Push that might beconnected, or have renamed how it appears in your list of MIDI devices, you need to supply a value after :device-filter which identifies the ports to be used to communicate with the Push you want this function to use. The values returned by afterglow.midi/open-inputs-if-needed! and afterglow.midi/open-outputs-if-needed! will be searched, and the first port that matches using filter-devices will be used.

Once bound, the controller will be identified in the user interface (for the purposes of linking it to the web cue grid) as “Ableton Push”. If you would like to use a different name (for example, if you are lucky enough to have more than one Push), you can pass in a custom value after :display-name.

-

If you want the user interface to be refreshed at a different rate than the default of fifteen times per second, pass your desired number of milliseconds after :refresh-interval.

bind-to-show

deprecated in 0.2.1

(bind-to-show show & {:keys [device-filter refresh-interval display-name], :or {device-filter "User Port", refresh-interval (/ 1000 15), display-name "Ableton Push"}})

Deprecated in favor of the shared controllers/bind-to-show implementation.

+

If you want the user interface to be refreshed at a different rate than the default of fifteen times per second, pass your desired number of milliseconds after :refresh-interval.

bind-to-show

deprecated in 0.2.1

(bind-to-show show & {:keys [device-filter refresh-interval display-name], :or {device-filter "User Port", refresh-interval (/ 1000 15), display-name "Ableton Push"}})

Deprecated in favor of the shared controllers/bind-to-show implementation.

Establish a connection to the Ableton Push, for managing the given show.

Initializes the display, and starts the UI updater thread. Since SysEx messages are required for updating the display, if you are on a Mac, you must install CoreMIDI4J to provide a working implementation. (If you need to work with Java 1.6, you can instead use mmj, but that is no longer developed, and does not support connecting or disconnecting MIDI devices after Java has started.)

If you have more than one Ableton Push connected, or have renamed how it appears in your list of MIDI devices, you need to supply a value after :device-filter which identifies the ports to be used to communicate with the Push you want this function to use. The values returned by afterglow.midi/open-inputs-if-needed! and afterglow.midi/open-outputs-if-needed! will be searched, and the first port that matches with filter-devices will be used.

The controller will be identified in the user interface (for the purposes of linking it to the web cue grid) as “Ableton Push”. If you would like to use a different name (for example, if you are lucky enough to have more than one Push), you can pass in a custom value after :display-name.

-

If you want the user interface to be refreshed at a different rate than the default of fifteen times per second, pass your desired number of milliseconds after :refresh-interval.

button-state

(button-state button state)(button-state button state color-key)

Calculate the numeric value that corresponds to a particular named state for the specified button, and (if supported and supplied), a named color.

clear-display-line

(clear-display-line controller line)

Clears a line of the text display.

clear-interface

(clear-interface controller)

Clears the text display and all illuminated buttons and pads.

color-button-colors

The control values and modes for a labeled button which changes color. These are added to the monochrome states (except for off) to obtain the color and brightness/behavior.

control-buttons

The labeled buttons which send and respond to Control Change events.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

-

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

in-mode?

(in-mode? controller button)

Check whether the controller is in a particular mode, identified by a control button number or keyword.

make-gauge

(make-gauge value & {:keys [lowest highest width], :or {lowest 0, highest 100, width 17}})

Create a graphical gauge with an indicator that fills a line. The default range is from zero to a hundred, and the default size is 17 characters, or a full display cell.

make-pan-gauge

(make-pan-gauge value & {:keys [lowest highest width], :or {lowest 0, highest 100, width 17}})

Create a graphical gauge with an indicator that moves along a line. The default range is from zero to a hundred, and the default size is 17 characters, or a full display cell.

monochrome-button-states

The control values and modes for a labeled button which does not change color.

off-color

The color of buttons that are completely off.

port-filter

Because the Push registers multiple ports with the MIDI environment, we need to be sure to bind only to the User port. This filter is used with filter-devices to screen out any port that does not seem to be the User port. If port names are assigned differently on your operating system, you may need to change this.

set-button-state

(set-button-state controller button state)(set-button-state controller button state color-key)

Set one of the labeled buttons to a particular state, and, if supported, color. If the state is already a number, it is used as-is, otherwise it is calculated using button-state.

set-display-line

(set-display-line controller line bytes)

Sets a line of the text display.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color.

set-pad-color-approximate

deprecated in 0.1.4

(set-pad-color-approximate controller x y color)

Deprecated in favor of new set-pad-color implementation.

-

Set the color of one of the 64 touch pads to the closest approximation available for a desired color. This was the first implementation that was discovered, but there is now a much more powerful way to specify an exact color using a SysEx message.

set-pad-velocity

(set-pad-velocity controller x y velocity)

Set the velocity of one of the 64 touch pads.

set-second-pad-color

(set-second-pad-color controller x color)

Set the color of one of the 8 second-row touch pads (right above the 8x8 pad of larger, velocity sensitive, pads) to the closest approximation available for a desired color.

set-top-pad-state

(set-top-pad-state controller x state)(set-top-pad-state controller x state color-key)

Set one of the top-row pads to a particular state and color. If state is already a number, it is used as-is, otherwise it is calculated using top-pad-state.

show-labels

(show-labels controller)(show-labels controller state)(show-labels controller state color)

Illuminates all buttons with text labels, for development assistance.

sign-velocity

(sign-velocity val)

Convert a midi velocity to its signed equivalent, to translate encoder rotations, which are twos-complement seven bit numbers.

special-symbols

The byte values which draw special-purpose characters on the Push display.

top-pad-state

(top-pad-state state)(top-pad-state state color-key)

Calculate the numeric value that corresponds to a particular named state for the specified top-row pad, and (if supplied), named color.

touch-strip-mode-default

The mode to which we should return the touch strip when we are shutting down.

touch-strip-mode-hue

The mode to which we should set the touch strip when the user is editing a hue.

touch-strip-mode-level

The mode to which we should set the touch strip when the user is editing a pan-style control.

touch-strip-mode-pan

The mode to which we should set the touch strip when the user is editing a level-style control.

velocity-for-color

(velocity-for-color color)

Given a target color, calculate the MIDI note velocity which will achieve the closest approximation available on an Ableton Push pad, using the thoughtful hue palette provided by Ableton:

-

Push pad palette

write-display-text

(write-display-text controller row start text)

Update a batch of characters within the display to be rendered on the next update.

\ No newline at end of file +

If you want the user interface to be refreshed at a different rate than the default of fifteen times per second, pass your desired number of milliseconds after :refresh-interval.

button-state

(button-state button state)(button-state button state color-key)

Calculate the numeric value that corresponds to a particular named state for the specified button, and (if supported and supplied), a named color.

clear-display-line

(clear-display-line controller line)

Clears a line of the text display.

clear-interface

(clear-interface controller)

Clears the text display and all illuminated buttons and pads.

color-button-colors

The control values and modes for a labeled button which changes color. These are added to the monochrome states (except for off) to obtain the color and brightness/behavior.

control-buttons

The labeled buttons which send and respond to Control Change events.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

+

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

in-mode?

(in-mode? controller button)

Check whether the controller is in a particular mode, identified by a control button number or keyword.

make-gauge

(make-gauge value & {:keys [lowest highest width], :or {lowest 0, highest 100, width 17}})

Create a graphical gauge with an indicator that fills a line. The default range is from zero to a hundred, and the default size is 17 characters, or a full display cell.

make-pan-gauge

(make-pan-gauge value & {:keys [lowest highest width], :or {lowest 0, highest 100, width 17}})

Create a graphical gauge with an indicator that moves along a line. The default range is from zero to a hundred, and the default size is 17 characters, or a full display cell.

monochrome-button-states

The control values and modes for a labeled button which does not change color.

off-color

The color of buttons that are completely off.

port-filter

Because the Push registers multiple ports with the MIDI environment, we need to be sure to bind only to the User port. This filter is used with filter-devices to screen out any port that does not seem to be the User port. If port names are assigned differently on your operating system, you may need to change this.

set-button-state

(set-button-state controller button state)(set-button-state controller button state color-key)

Set one of the labeled buttons to a particular state, and, if supported, color. If the state is already a number, it is used as-is, otherwise it is calculated using button-state.

set-display-line

(set-display-line controller line bytes)

Sets a line of the text display.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color.

set-pad-color-approximate

deprecated in 0.1.4

(set-pad-color-approximate controller x y color)

Deprecated in favor of new set-pad-color implementation.

+

Set the color of one of the 64 touch pads to the closest approximation available for a desired color. This was the first implementation that was discovered, but there is now a much more powerful way to specify an exact color using a SysEx message.

set-pad-velocity

(set-pad-velocity controller x y velocity)

Set the velocity of one of the 64 touch pads.

set-second-pad-color

(set-second-pad-color controller x color)

Set the color of one of the 8 second-row touch pads (right above the 8x8 pad of larger, velocity sensitive, pads) to the closest approximation available for a desired color.

set-top-pad-state

(set-top-pad-state controller x state)(set-top-pad-state controller x state color-key)

Set one of the top-row pads to a particular state and color. If state is already a number, it is used as-is, otherwise it is calculated using top-pad-state.

show-labels

(show-labels controller)(show-labels controller state)(show-labels controller state color)

Illuminates all buttons with text labels, for development assistance.

sign-velocity

(sign-velocity val)

Convert a midi velocity to its signed equivalent, to translate encoder rotations, which are twos-complement seven bit numbers.

special-symbols

The byte values which draw special-purpose characters on the Push display.

top-pad-state

(top-pad-state state)(top-pad-state state color-key)

Calculate the numeric value that corresponds to a particular named state for the specified top-row pad, and (if supplied), named color.

touch-strip-mode-default

The mode to which we should return the touch strip when we are shutting down.

touch-strip-mode-hue

The mode to which we should set the touch strip when the user is editing a hue.

touch-strip-mode-level

The mode to which we should set the touch strip when the user is editing a pan-style control.

touch-strip-mode-pan

The mode to which we should set the touch strip when the user is editing a level-style control.

velocity-for-color

(velocity-for-color color)

Given a target color, calculate the MIDI note velocity which will achieve the closest approximation available on an Ableton Push pad, using the thoughtful hue palette provided by Ableton:

+

Push pad palette

write-display-text

(write-display-text controller row start text)

Update a batch of characters within the display to be rendered on the next update.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.color.html b/api-doc/afterglow.controllers.color.html index 301c273e..475dded5 100644 --- a/api-doc/afterglow.controllers.color.html +++ b/api-doc/afterglow.controllers.color.html @@ -1,8 +1,8 @@ -afterglow.controllers.color documentation

afterglow.controllers.color

Provides support for adjusting components of a show variable containing a color using any MIDI controller.

add-midi-control-to-color-mapping

(add-midi-control-to-color-mapping device-filter channel control-number variable component & {:keys [min max transform-fn]})

Cause specified component of the color value stored in the specified variable in *show* to be updated by any MIDI controller-change messages from the specified device sent on the specified channel and control-number.

+afterglow.controllers.color documentation

afterglow.controllers.color

Provides support for adjusting components of a show variable containing a color using any MIDI controller.

add-midi-control-to-color-mapping

(add-midi-control-to-color-mapping device-filter channel control-number variable component & {:keys [min max transform-fn]})

Cause specified component of the color value stored in the specified variable in *show* to be updated by any MIDI controller-change messages from the specified device sent on the specified channel and control-number.

The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

The values you can pass for component include :red, :green, :blue, :hue, :saturation, and :lightness.

As control changes come in, they will be mapped from the MIDI range (of 0 to 127) to the legal range for the chosen color component. If :min and/or :max are specified, the values will be scaled to the supplied range instead, but will still be clamped to fit within legal values for the chosen color component (RGB values can range from 0 to 255, hues from 0 to 360, and saturation and lightness from 0 to 100).

If :transform-fn is specified, it will be called with the scaled color component value, and its return value will be assigned to the color, although once again the value will be clamped to within the legal range for the component.

-

Returns a MIDI mapping function, which can be passed to remove-control-mapping if you later want to stop the MIDI control affecting the color variable.

\ No newline at end of file +

Returns a MIDI mapping function, which can be passed to remove-control-mapping if you later want to stop the MIDI control affecting the color variable.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.html b/api-doc/afterglow.controllers.html index a9c9cdb1..3ec17760 100644 --- a/api-doc/afterglow.controllers.html +++ b/api-doc/afterglow.controllers.html @@ -1,22 +1,22 @@ -afterglow.controllers documentation

afterglow.controllers

Provides shared services for all controller implementations.

activate-cue!

(activate-cue! grid x y id)

Records the fact that the cue at the specified grid coordinates was activated in a show, and assigned the specified id, which can be used later to determine whether the same cue is still running. If id is nil, the cue is deactivated rather than activated.

-

Sends appropriate MIDI feedback events to any non-grid controllers which have requested them for that cue, so they can update their interfaces appropriately, then calls any registered functions that want updates about the cue state letting them know it has started, its effect keyword, and the id of the effect that was created or ended.

active-bindings

(active-bindings)

Returns the set of controllers which are currently bound to shows.

add-active-binding

(add-active-binding controller)

Registers a controller which has been bound to a show, and which should be deactivated when deactivate-all is called or the JVM is shutting down, to gracefully clean up the binding.

add-beat-feedback!

(add-beat-feedback! metronome device channel kind note & {:keys [on off], :or {on 127, off 0}})

Arranges for the specified non-grid MIDI controller to receive feedback events to make a particular LED flash on each beat of the specified metronome.

add-control-held-feedback-overlay

(add-control-held-feedback-overlay state control-num f)

Builds a simple overlay which just adds something to the user interface until a particular control (identified by control-num) is released, and adds it to the controller. The overlay will end when a control-change message with value 0 is sent to the specified control number. Other than that, all it does is call the supplied function every time the interface is being updated, passing it the metronome snapshot which represents the moment at which the interface is being drawn. If the function returns a falsey value, the overlay will be ended.

-

As with add-overlay, state must be a value created by create-overlay-state and tracked by the controller.

add-cue-feedback!

(add-cue-feedback! grid x y device channel kind note & {:keys [on off], :or {on 127, off 0}})

Arranges for the specified non-grid MIDI controller to receive feedback events when the cue grid location activates or deactivates.

add-cue-fn!

(add-cue-fn! grid x y f)

Arranges for the supplied function to be called when the cue grid location activates or deactivates. It will be called with three arguments: the first, a keyword identifying the state to which the cue has transitioned, either :started, :ending, or :ended, the keyword with which the cue created an effect in the show, and the unique numeric ID assigned to the effect when it was started. The last two argumetnts can be used with end-effect! and its :when-id argument to avoid accidentally ending a different cue.

add-overlay

(add-overlay state overlay & {:keys [priority], :or {priority 0}})

Add a temporary overlay to the interface. The state argument must be a value created by create-overlay-state, and overlay an implementation of the IOverlay protocol to be added as the most recent overlay to that state. The optional keyword argument :priority can be used to modify the sorting order of overlays, which is that more recent ones run later, so they get the last word when it comes to rendering. The default priority is 0.

auto-bind

(auto-bind show & {:keys [device-filter], :as args})

Watches for a recognized grid controller to be connected, and as soon as it is, binds it to the specified show using bind-to-show. If that controller ever gets disconnected, it will be re-bound once it reappears.

+afterglow.controllers documentation

afterglow.controllers

Provides shared services for all controller implementations.

activate-cue!

(activate-cue! grid x y id)

Records the fact that the cue at the specified grid coordinates was activated in a show, and assigned the specified id, which can be used later to determine whether the same cue is still running. If id is nil, the cue is deactivated rather than activated.

+

Sends appropriate MIDI feedback events to any non-grid controllers which have requested them for that cue, so they can update their interfaces appropriately, then calls any registered functions that want updates about the cue state letting them know it has started, its effect keyword, and the id of the effect that was created or ended.

active-bindings

(active-bindings)

Returns the set of controllers which are currently bound to shows.

add-active-binding

(add-active-binding controller)

Registers a controller which has been bound to a show, and which should be deactivated when deactivate-all is called or the JVM is shutting down, to gracefully clean up the binding.

add-beat-feedback!

(add-beat-feedback! metronome device channel kind note & {:keys [on off], :or {on 127, off 0}})

Arranges for the specified non-grid MIDI controller to receive feedback events to make a particular LED flash on each beat of the specified metronome.

add-control-held-feedback-overlay

(add-control-held-feedback-overlay state control-num f)

Builds a simple overlay which just adds something to the user interface until a particular control (identified by control-num) is released, and adds it to the controller. The overlay will end when a control-change message with value 0 is sent to the specified control number. Other than that, all it does is call the supplied function every time the interface is being updated, passing it the metronome snapshot which represents the moment at which the interface is being drawn. If the function returns a falsey value, the overlay will be ended.

+

As with add-overlay, state must be a value created by create-overlay-state and tracked by the controller.

add-cue-feedback!

(add-cue-feedback! grid x y device channel kind note & {:keys [on off], :or {on 127, off 0}})

Arranges for the specified non-grid MIDI controller to receive feedback events when the cue grid location activates or deactivates.

add-cue-fn!

(add-cue-fn! grid x y f)

Arranges for the supplied function to be called when the cue grid location activates or deactivates. It will be called with three arguments: the first, a keyword identifying the state to which the cue has transitioned, either :started, :ending, or :ended, the keyword with which the cue created an effect in the show, and the unique numeric ID assigned to the effect when it was started. The last two argumetnts can be used with end-effect! and its :when-id argument to avoid accidentally ending a different cue.

add-overlay

(add-overlay state overlay & {:keys [priority], :or {priority 0}})

Add a temporary overlay to the interface. The state argument must be a value created by create-overlay-state, and overlay an implementation of the IOverlay protocol to be added as the most recent overlay to that state. The optional keyword argument :priority can be used to modify the sorting order of overlays, which is that more recent ones run later, so they get the last word when it comes to rendering. The default priority is 0.

auto-bind

(auto-bind show & {:keys [device-filter], :as args})

Watches for a recognized grid controller to be connected, and as soon as it is, binds it to the specified show using bind-to-show. If that controller ever gets disconnected, it will be re-bound once it reappears.

If you would like to limit the controllers that Afterglow will automatically bind to, you may supply a filter with the optional keyword argument :device-filter which uniquely matches the MIDI ports used by the devices you want to be auto-bound. The values returned by afterglow.midi/open-inputs-if-needed! and afterglow.midi/open-outputs-if-needed! will be searched, and any pair of identically-named ports that are accepted by your :device-filter with filter-devices will be bound if they are attached to a controller type that Afterglow knows how to work with.

The controller binding implementation chosen will be determined by calling identify with the ports found, and seeing which member of recognizers recognizes the result and returns a dispatch value. That value will be used to call bind-to-show-impl with the ports and other arguments, and it will do the appropriate things to work with the controller that was found.

If you are watching for a specific controller type whose mapping accepts other optional keyword arguments, you can include them as well, and they will be passed along to bind-to-show when it is detected.

All rich controller binding implementations accept a couple of standard optional keyword arguments to adjust their behavior. The controller will be identified in the user interface (for the purposes of linking it to the web cue grid) with a default name based on its type (for example “Ableton Push”). If you would like to use a different name (for example, if you are lucky enough to have more than one Push), you can pass in a custom value after the optional keyword argument :display-name.

If you want the user interface to be refreshed at a different rate than the default for the controller type, pass your desired number of milliseconds after :refresh-interval.

-

Controllers which perform their own startup animation, or which need to be given extra time to become ready after their ports appear in the MIDI environment can look for the optional keyword argument :new-connection to indicate the device has just been connected, and react appropriately.

beat-refresh-interval

How often, in milliseconds, are the controllers requesting beat feedback refreshed.

bind-to-show

(bind-to-show show device-filter & {:keys [auto-binding], :as args})

Establish a rich user-interface binding on a supported grid controller for show.

+

Controllers which perform their own startup animation, or which need to be given extra time to become ready after their ports appear in the MIDI environment can look for the optional keyword argument :new-connection to indicate the device has just been connected, and react appropriately.

beat-refresh-interval

How often, in milliseconds, are the controllers requesting beat feedback refreshed.

bind-to-show

(bind-to-show show device-filter & {:keys [auto-binding], :as args})

Establish a rich user-interface binding on a supported grid controller for show.

To locate the controller that you want to bind to, you need to supply a device-filter which uniquely matches the ports to be used to communicate with it. The values returned by afterglow.midi/open-inputs-if-needed! and afterglow.midi/open-outputs-if-needed! will be searched, and the first port that matches with filter-devices will be used. There must be both an input and output matching the filter for the binding to succeed.

The controller binding implementation chosen will be determined by calling identify with the ports found, and seeing which member of recognizers recognizes the result and returns a non-null value. The corresponding dispatch key will be used with the result value to call bind-to-show-impl with the ports and other arguments, and it will do the appropriate things to work with the controller that was found.

All rich controller binding implementations accept a couple of standard optional keyword arguments to adjust their behavior. The controller will be identified in the user interface (for the purposes of linking it to the web cue grid) with a default name based on its type (for example “Ableton Push”). If you would like to use a different name (for example, if you are lucky enough to have more than one Push), you can pass in a custom value after the optional keyword argument :display-name.

If you want the user interface to be refreshed at a different rate than the default for the controller type, pass your desired number of milliseconds after :refresh-interval.

If you are binding to a specific controller type whose mapping accepts other optional keyword arguments, you can include them as well, and they will be passed on to the binding implementation function.

-

If the controller was bound, the binding will be returned, and you can later call deactivate with it. If the binding failed, nil will be returned, and there will be messages explaining why in the log file.

bind-to-show-impl

multimethod

Establish a rich user-interface binding on a supported grid controller for show. A multimethod which selects the appropriate implementation based on passing the value returned by identify to all functions registered in recognizers. The port used to receive MIDI messages from the controller is passed as port-in, and the port used to send messages to it is passed as port-out.

+

If the controller was bound, the binding will be returned, and you can later call deactivate with it. If the binding failed, nil will be returned, and there will be messages explaining why in the log file.

bind-to-show-impl

multimethod

Establish a rich user-interface binding on a supported grid controller for show. A multimethod which selects the appropriate implementation based on passing the value returned by identify to all functions registered in recognizers. The port used to receive MIDI messages from the controller is passed as port-in, and the port used to send messages to it is passed as port-out.

New controller binding implementations simply need to define an appropriate implementation of this multimethod, and add their recognition function to recognizers.

-

All rich controller binding implementations should honor the :display-name and :refresh-interval optional keyword arguments described in bind-rich-controller. They may also support additional optional keyword arguments specific to the details of their implementation, which the caller can supply when they know they are binding to such a controller.

cancel-auto-bind

(cancel-auto-bind)

Stop any auto-bind which may be in effect.

clear-beat-feedback!

(clear-beat-feedback! metronome device channel kind note)

Ceases flashing the specified non-grid MIDI controller element on beats of the specified metronome.

clear-cue!

(clear-cue! grid x y)

Removes any cue which existed at the specified coordinates in the cue grid. If one was there, updates the grid dimensions if needed. Also clears any variables that were saved for that cue.

clear-cue-feedback!

(clear-cue-feedback! grid x y device channel kind note)

Ceases sending the specified non-grid MIDI controller feedback events when the cue grid location activates or deactivates, returning the feedback values that had been in place if there were any.

clear-cue-fn!

(clear-cue-fn! grid x y f)

Ceases calling the supplied function when the cue grid location activates or deactivates.

clear-saved-cue-vars!

(clear-saved-cue-vars! grid x y)

Remove any saved starting values assigned to the cue at the specified grid location.

create-overlay-state

(create-overlay-state)

Return the state information needed to manage user-interface overlays implementing the IOverlay protocol. Controllers implementing this protocol will need to pass this object to the functions that manipulate and invoke overlays.

cue-at

(cue-at grid x y)

Find the cue, if any, at the specified coordinates.

cue-grid

(cue-grid)

Return a two dimensional arrangement for launching and monitoring cues, suitable for both a web interface and control surfaces with a pad grid. Cues are laid out with [0, 0] being the bottom left corner. The width of the grid is the highest x coordinate of a cue, and the height is the highest y coordinate.

cue-vars-saved-at

(cue-vars-saved-at grid x y)

Return the saved starting values, if any, assigned to the cue at the specified grid location.

deactivate

multimethod

Deactivates a controller binding established by bind-to-show. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

-

The implementation of this multimethod is chosen by using the :type key in the controller map as the dispatch value, so rich controller implementations simply need to register their own implementations appropriately when their namespaces are loaded.

deactivate-all

(deactivate-all)

Deactivates all controller bindings which are currently active. This will be registered as a shutdown hook to be called when the Java environment is shutting down, to clean up gracefully.

grid-dimensions

(grid-dimensions grid)

Return the current dimensions of the cue grid.

grid-height

(grid-height grid)

Return the current height of the cue grid.

grid-width

(grid-width grid)

Return the current width of the cue grid.

identify

(identify port-in port-out)

Sends a MIDI Device Inquiry message to the specified device and returns the response, waiting for up to a second, and trying up to three times if no response is received in that second. If the third attempt fails, returns nil.

IGridController

protocol

A controller which provides an interface for a section of the cue) grid, and which can be linked to the web interface so they scroll in unison.

members

add-move-listener

(add-move-listener this f)

Registers a function that will be called whenever the controller’s viewport on the overall cue grid is moved, or the controller is deactivated. The function will be called with two arguments, the controller and a keyword which will be either :move or :deactivated. In the latter case, the function will never be called again.

current-bottom

(current-bottom this)(current-bottom this y)

Returns the cue grid row currently displayed at the bottom of the controller, or sets it.

current-left

(current-left this)(current-left this x)

Returns the cue grid column currently displayed at the left of the controller, or sets it.

display-name

(display-name this)

Returns the name by which the controller can be identified in user interfaces.

physical-height

(physical-height this)

Returns the height of the cue grid on the controller.

physical-width

(physical-width this)

Returns the width of the cue grid on the controller.

remove-move-listener

(remove-move-listener this f)

Unregisters a move listener function so it will no longer be called when the controller’s origin is moved.

IOverlay

protocol

An activity which takes over part of the user interface while it is active.

members

adjust-interface

(adjust-interface this snapshot)

Set values for the next frame of the controller interface, however that may be done; return a falsey value if the overlay is finished and should be removed. The snapshot is an IMetroSnapshot that specifies the instant in musical time at which the interface is being rendered, so this overlay can be drawn in sync with the rest of the interface.

captured-controls

(captured-controls this)

Returns the MIDI control-change events that will be consumed by this overlay while it is active, a set of integers.

captured-notes

(captured-notes this)

Returns the MIDI note events that will be consumed by this overlay while it is active, a set of integers.

handle-aftertouch

(handle-aftertouch this message)

Called when a MIDI aftertouch event matching the captured-notes lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-control-change

(handle-control-change this message)

Called when a MIDI control-change event matching the captured-controls lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-note-off

(handle-note-off this message)

Called when a MIDI note-off event matching the captured-notes lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-note-on

(handle-note-on this message)

Called when a MIDI note-on event matching the captured-notes lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-pitch-bend

(handle-pitch-bend this message)

Called when a MIDI pitch-bend event has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

maximum-bpm

The highest BPM value which controllers are allowed to set.

minimum-bpm

The lowest BPM value which controllers are allowed to set.

overlay-handled?

(overlay-handled? state message)

See if there is an interface overlay active which wants to consume this message; if so, send it, and see if the overlay consumes it. Returns truthy if an overlay consumed the message, and it should not be given to anyone else. state must be a value created by create-overlay-state and tracked by the controller.

-

More recent (and higher priority) overlays get the first chance to decide if they want to consume the message, so the overlay list is traversed in reverse order.

pool

Provides thread scheduling for all controller user interface updates.

recognizers

A map whose keywords are dispatch values registered with bind-to-show-impl and whose values are functions which are called with three arguments: The identify response for a controller and the MIDI input and output ports it registered. The recognizer functions examine the device’s identify response and ports, if the device is recognized as a controller which is supported by the particular binding implementation associated with the dispatch keyword, return the binding information needed by their controller implementations to complete a binding to that device. In other words, non-nil responses mean the corresponding dispatch value, function result, and input and output ports should be used with bind-to-show-impl to establish a binding with that controller.

-

New controller binding implementations simply need to add an appropriate implementation of that multimethod, and register their recognition function in this map.

remove-active-binding

(remove-active-binding controller)

Removes a controller from the set of active bindings, so it will no longer be deactivated when deactivate-all is called or the JVM is shutting down.

report-cue-ending

(report-cue-ending grid x y id)

Calls any registered functions that want updates about the cue state to inform them it has begun to gracefully end, its effect keyword, and the id of the effect that is ending.

run-overlays

(run-overlays state snapshot)

Add any contributions from interface overlays, removing them if they report being finished. Most recent and higher priority overlays run last, having the opportunity to override older ones. state must be a value created by create-overlay-state and tracked by the controller. The snapshot is an IMetroSnapshot that captures the instant in time at which the interface is being rendered, and is passed in to the overlay so it can be rendered in sync with all other interface elements.

save-cue-vars!

(save-cue-vars! grid x y vars)

Save a set of variable starting values to be applied when launching a cue. If there is no cue at the specified grid location, nothing will be saved.

set-cue!

(set-cue! grid x y cue)

Puts the supplied cue at the specified coordinates in the cue grid. Replaces any cue which formerly existed at that location, and clears any variables that might have been saved for it. If cue is nil, delegates to clear-cue!

starting-vars-for-velocity

(starting-vars-for-velocity cue velocity)

Given a cue and the velocity of the MIDI message which is causing it to start, gather all cue variables which have been configured to respond to MIDI velocity, and assign their initial values based on the velocity of the MIDI message. Returns a map suitable for use with the :var-overrides argument to show/add-effect-from-cue-grid!.

value-for-velocity

(value-for-velocity v velocity)

Given a cue variable which has been configured to respond to MIDI velocity, and the velocity of a MIDI message affecting it (presumably either Note On or Aftertouch / Poly Pressure), calculate the value which should be assigned to that variable.

\ No newline at end of file +

All rich controller binding implementations should honor the :display-name and :refresh-interval optional keyword arguments described in bind-rich-controller. They may also support additional optional keyword arguments specific to the details of their implementation, which the caller can supply when they know they are binding to such a controller.

cancel-auto-bind

(cancel-auto-bind)

Stop any auto-bind which may be in effect.

clear-beat-feedback!

(clear-beat-feedback! metronome device channel kind note)

Ceases flashing the specified non-grid MIDI controller element on beats of the specified metronome.

clear-cue!

(clear-cue! grid x y)

Removes any cue which existed at the specified coordinates in the cue grid. If one was there, updates the grid dimensions if needed. Also clears any variables that were saved for that cue.

clear-cue-feedback!

(clear-cue-feedback! grid x y device channel kind note)

Ceases sending the specified non-grid MIDI controller feedback events when the cue grid location activates or deactivates, returning the feedback values that had been in place if there were any.

clear-cue-fn!

(clear-cue-fn! grid x y f)

Ceases calling the supplied function when the cue grid location activates or deactivates.

clear-saved-cue-vars!

(clear-saved-cue-vars! grid x y)

Remove any saved starting values assigned to the cue at the specified grid location.

create-overlay-state

(create-overlay-state)

Return the state information needed to manage user-interface overlays implementing the IOverlay protocol. Controllers implementing this protocol will need to pass this object to the functions that manipulate and invoke overlays.

cue-at

(cue-at grid x y)

Find the cue, if any, at the specified coordinates.

cue-grid

(cue-grid)

Return a two dimensional arrangement for launching and monitoring cues, suitable for both a web interface and control surfaces with a pad grid. Cues are laid out with [0, 0] being the bottom left corner. The width of the grid is the highest x coordinate of a cue, and the height is the highest y coordinate.

cue-vars-saved-at

(cue-vars-saved-at grid x y)

Return the saved starting values, if any, assigned to the cue at the specified grid location.

deactivate

multimethod

Deactivates a controller binding established by bind-to-show. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

+

The implementation of this multimethod is chosen by using the :type key in the controller map as the dispatch value, so rich controller implementations simply need to register their own implementations appropriately when their namespaces are loaded.

deactivate-all

(deactivate-all)

Deactivates all controller bindings which are currently active. This will be registered as a shutdown hook to be called when the Java environment is shutting down, to clean up gracefully.

grid-dimensions

(grid-dimensions grid)

Return the current dimensions of the cue grid.

grid-height

(grid-height grid)

Return the current height of the cue grid.

grid-width

(grid-width grid)

Return the current width of the cue grid.

identify

(identify port-in port-out)

Sends a MIDI Device Inquiry message to the specified device and returns the response, waiting for up to a second, and trying up to three times if no response is received in that second. If the third attempt fails, returns nil.

IGridController

protocol

A controller which provides an interface for a section of the cue) grid, and which can be linked to the web interface so they scroll in unison.

members

add-move-listener

(add-move-listener this f)

Registers a function that will be called whenever the controller’s viewport on the overall cue grid is moved, or the controller is deactivated. The function will be called with two arguments, the controller and a keyword which will be either :move or :deactivated. In the latter case, the function will never be called again.

current-bottom

(current-bottom this)(current-bottom this y)

Returns the cue grid row currently displayed at the bottom of the controller, or sets it.

current-left

(current-left this)(current-left this x)

Returns the cue grid column currently displayed at the left of the controller, or sets it.

display-name

(display-name this)

Returns the name by which the controller can be identified in user interfaces.

physical-height

(physical-height this)

Returns the height of the cue grid on the controller.

physical-width

(physical-width this)

Returns the width of the cue grid on the controller.

remove-move-listener

(remove-move-listener this f)

Unregisters a move listener function so it will no longer be called when the controller’s origin is moved.

IOverlay

protocol

An activity which takes over part of the user interface while it is active.

members

adjust-interface

(adjust-interface this snapshot)

Set values for the next frame of the controller interface, however that may be done; return a falsey value if the overlay is finished and should be removed. The snapshot is an IMetroSnapshot that specifies the instant in musical time at which the interface is being rendered, so this overlay can be drawn in sync with the rest of the interface.

captured-controls

(captured-controls this)

Returns the MIDI control-change events that will be consumed by this overlay while it is active, a set of integers.

captured-notes

(captured-notes this)

Returns the MIDI note events that will be consumed by this overlay while it is active, a set of integers.

handle-aftertouch

(handle-aftertouch this message)

Called when a MIDI aftertouch event matching the captured-notes lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-control-change

(handle-control-change this message)

Called when a MIDI control-change event matching the captured-controls lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-note-off

(handle-note-off this message)

Called when a MIDI note-off event matching the captured-notes lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-note-on

(handle-note-on this message)

Called when a MIDI note-on event matching the captured-notes lists has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

handle-pitch-bend

(handle-pitch-bend this message)

Called when a MIDI pitch-bend event has been received. Return a truthy value if the overlay has consumed the event, so it should not be processed further. If the special value :done is returned, it further indicates the overlay is finished and should be removed.

maximum-bpm

The highest BPM value which controllers are allowed to set.

minimum-bpm

The lowest BPM value which controllers are allowed to set.

overlay-handled?

(overlay-handled? state message)

See if there is an interface overlay active which wants to consume this message; if so, send it, and see if the overlay consumes it. Returns truthy if an overlay consumed the message, and it should not be given to anyone else. state must be a value created by create-overlay-state and tracked by the controller.

+

More recent (and higher priority) overlays get the first chance to decide if they want to consume the message, so the overlay list is traversed in reverse order.

pool

Provides thread scheduling for all controller user interface updates.

recognizers

A map whose keywords are dispatch values registered with bind-to-show-impl and whose values are functions which are called with three arguments: The identify response for a controller and the MIDI input and output ports it registered. The recognizer functions examine the device’s identify response and ports, if the device is recognized as a controller which is supported by the particular binding implementation associated with the dispatch keyword, return the binding information needed by their controller implementations to complete a binding to that device. In other words, non-nil responses mean the corresponding dispatch value, function result, and input and output ports should be used with bind-to-show-impl to establish a binding with that controller.

+

New controller binding implementations simply need to add an appropriate implementation of that multimethod, and register their recognition function in this map.

remove-active-binding

(remove-active-binding controller)

Removes a controller from the set of active bindings, so it will no longer be deactivated when deactivate-all is called or the JVM is shutting down.

report-cue-ending

(report-cue-ending grid x y id)

Calls any registered functions that want updates about the cue state to inform them it has begun to gracefully end, its effect keyword, and the id of the effect that is ending.

run-overlays

(run-overlays state snapshot)

Add any contributions from interface overlays, removing them if they report being finished. Most recent and higher priority overlays run last, having the opportunity to override older ones. state must be a value created by create-overlay-state and tracked by the controller. The snapshot is an IMetroSnapshot that captures the instant in time at which the interface is being rendered, and is passed in to the overlay so it can be rendered in sync with all other interface elements.

save-cue-vars!

(save-cue-vars! grid x y vars)

Save a set of variable starting values to be applied when launching a cue. If there is no cue at the specified grid location, nothing will be saved.

set-cue!

(set-cue! grid x y cue)

Puts the supplied cue at the specified coordinates in the cue grid. Replaces any cue which formerly existed at that location, and clears any variables that might have been saved for it. If cue is nil, delegates to clear-cue!

starting-vars-for-velocity

(starting-vars-for-velocity cue velocity)

Given a cue and the velocity of the MIDI message which is causing it to start, gather all cue variables which have been configured to respond to MIDI velocity, and assign their initial values based on the velocity of the MIDI message. Returns a map suitable for use with the :var-overrides argument to show/add-effect-from-cue-grid!.

value-for-velocity

(value-for-velocity v velocity)

Given a cue variable which has been configured to respond to MIDI velocity, and the velocity of a MIDI message affecting it (presumably either Note On or Aftertouch / Poly Pressure), calculate the value which should be assigned to that variable.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.launchpad-mini.html b/api-doc/afterglow.controllers.launchpad-mini.html index e3f90d92..f95fd18b 100644 --- a/api-doc/afterglow.controllers.launchpad-mini.html +++ b/api-doc/afterglow.controllers.launchpad-mini.html @@ -1,4 +1,4 @@ -afterglow.controllers.launchpad-mini documentation

afterglow.controllers.launchpad-mini

Allows the Novation Launchpad Mini and Launchpad S to be used as control surfaces for Afterglow.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)(add-button-held-feedback-overlay controller button color)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

button-active-color

The color of an available button that is currently being pressed.

button-available-color

The color of buttons that can be pressed but haven’t yet been.

button-dimmed-color

The color of buttons that can be pressed but are in conflict or otherwise backgrounded.

button-off-color

The color of buttons that are completely off.

clear-interface

(clear-interface controller)

Clears all illuminated buttons and pads.

control-buttons

The round buttons along the top which send and respond to Control Change events.

cue-held-color

The color to light up a pad when a cue runs only as long as it is held.

cue-running-color

The color to light up a pad when it is running a cue.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

-

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

note-buttons

The round buttons along the right which send and respond to Note events.

set-control-button-color

(set-control-button-color controller button color)

Set one of the top row of control buttons to one of the color values specified above.

set-note-button-color

(set-note-button-color controller button color)

Set one of the right hand row of note buttons to one of the color values specified above.

set-pad-color

(set-pad-color controller x y color)

Set one of the 64 grid pads to one of the color values specified above.

shift-active-color

The color of the Shift button when active.

shift-available-color

The color of the Shift button when not active.

show-round-buttons

(show-round-buttons controller)(show-round-buttons controller color)

Illuminates all round buttons.

stop-active-color

The color of the Stop button when active.

stop-available-color

The color of the Stop button when not active.

tempo-synced-beat-color

The color of the tap tempo button when the metronome is synchronzied and a beat is taking place.

tempo-synced-off-beat-color

The color of the tap tempo button when the metronome is synchronized and a beat is not taking place.

tempo-unsynced-beat-color

The color of the tap tempo button when synchronization is off and a beat is taking place.

tempo-unsynced-off-beat-color

The color of the tap tempo button when synchronization is off and a beat is not taking place.

\ No newline at end of file +afterglow.controllers.launchpad-mini documentation

afterglow.controllers.launchpad-mini

Allows the Novation Launchpad Mini and Launchpad S to be used as control surfaces for Afterglow.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)(add-button-held-feedback-overlay controller button color)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

button-active-color

The color of an available button that is currently being pressed.

button-available-color

The color of buttons that can be pressed but haven’t yet been.

button-dimmed-color

The color of buttons that can be pressed but are in conflict or otherwise backgrounded.

button-off-color

The color of buttons that are completely off.

clear-interface

(clear-interface controller)

Clears all illuminated buttons and pads.

control-buttons

The round buttons along the top which send and respond to Control Change events.

cue-held-color

The color to light up a pad when a cue runs only as long as it is held.

cue-running-color

The color to light up a pad when it is running a cue.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

+

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

note-buttons

The round buttons along the right which send and respond to Note events.

set-control-button-color

(set-control-button-color controller button color)

Set one of the top row of control buttons to one of the color values specified above.

set-note-button-color

(set-note-button-color controller button color)

Set one of the right hand row of note buttons to one of the color values specified above.

set-pad-color

(set-pad-color controller x y color)

Set one of the 64 grid pads to one of the color values specified above.

shift-active-color

The color of the Shift button when active.

shift-available-color

The color of the Shift button when not active.

show-round-buttons

(show-round-buttons controller)(show-round-buttons controller color)

Illuminates all round buttons.

stop-active-color

The color of the Stop button when active.

stop-available-color

The color of the Stop button when not active.

tempo-synced-beat-color

The color of the tap tempo button when the metronome is synchronzied and a beat is taking place.

tempo-synced-off-beat-color

The color of the tap tempo button when the metronome is synchronized and a beat is not taking place.

tempo-unsynced-beat-color

The color of the tap tempo button when synchronization is off and a beat is taking place.

tempo-unsynced-off-beat-color

The color of the tap tempo button when synchronization is off and a beat is not taking place.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.launchpad-mk2.html b/api-doc/afterglow.controllers.launchpad-mk2.html index 5a7d98d8..588f3183 100644 --- a/api-doc/afterglow.controllers.launchpad-mk2.html +++ b/api-doc/afterglow.controllers.launchpad-mk2.html @@ -1,4 +1,4 @@ -afterglow.controllers.launchpad-mk2 documentation

afterglow.controllers.launchpad-mk2

Allows the Novation Launchpad Mk2 to be used as a control surface for Afterglow.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)(add-button-held-feedback-overlay controller button color)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

button-active-color

The color of an available button that is currently being pressed.

button-available-color

The color of buttons that can be pressed but haven’t yet been.

button-off-color

The color of buttons that are completely off.

clear-interface

(clear-interface controller)

Clears all illuminated buttons and pads.

control-buttons

The round buttons along the top which send and respond to Control Change events.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

-

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

note-buttons

The round buttons along the right which send and respond to Note events.

set-led-color

(set-led-color controller led color)

Set one of the LEDs, given its control or note number, to a specific RGB color.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color.

show-round-buttons

(show-round-buttons controller)(show-round-buttons controller color)

Illuminates all round buttons.

stop-active-color

The color of the stop button when active.

stop-available-color

The color of the Stop button when not active.

tempo-synced-beat-color

The color of the tap tempo button when the metronome is synchronzied and a beat is taking place.

tempo-synced-off-beat-color

The color of the tap tempo button when the metronome is synchronized and a beat is not taking place.

tempo-unsynced-beat-color

The color of the tap tempo button when synchronization is off and a beat is taking place.

tempo-unsynced-off-beat-color

The color of the tap tempo button when synchronization is off and a beat is not taking place.

\ No newline at end of file +afterglow.controllers.launchpad-mk2 documentation

afterglow.controllers.launchpad-mk2

Allows the Novation Launchpad Mk2 to be used as a control surface for Afterglow.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)(add-button-held-feedback-overlay controller button color)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

button-active-color

The color of an available button that is currently being pressed.

button-available-color

The color of buttons that can be pressed but haven’t yet been.

button-off-color

The color of buttons that are completely off.

clear-interface

(clear-interface controller)

Clears all illuminated buttons and pads.

control-buttons

The round buttons along the top which send and respond to Control Change events.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

+

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

note-buttons

The round buttons along the right which send and respond to Note events.

set-led-color

(set-led-color controller led color)

Set one of the LEDs, given its control or note number, to a specific RGB color.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color.

show-round-buttons

(show-round-buttons controller)(show-round-buttons controller color)

Illuminates all round buttons.

stop-active-color

The color of the stop button when active.

stop-available-color

The color of the Stop button when not active.

tempo-synced-beat-color

The color of the tap tempo button when the metronome is synchronzied and a beat is taking place.

tempo-synced-off-beat-color

The color of the tap tempo button when the metronome is synchronized and a beat is not taking place.

tempo-unsynced-beat-color

The color of the tap tempo button when synchronization is off and a beat is taking place.

tempo-unsynced-off-beat-color

The color of the tap tempo button when synchronization is off and a beat is not taking place.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.launchpad-pro.html b/api-doc/afterglow.controllers.launchpad-pro.html index 910c099d..f249b65b 100644 --- a/api-doc/afterglow.controllers.launchpad-pro.html +++ b/api-doc/afterglow.controllers.launchpad-pro.html @@ -1,14 +1,14 @@ -afterglow.controllers.launchpad-pro documentation

afterglow.controllers.launchpad-pro

Allows the Novation Launchpad Pro to be used as a control surface for Afterglow.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)(add-button-held-feedback-overlay controller button color)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

auto-bind

deprecated in 0.2.1

(auto-bind show & {:keys [device-filter refresh-interval display-name], :or {device-filter "Standalone Port", refresh-interval (/ 1000 15), display-name "Launchpad Pro"}})

Deprecated in favor of the shared controllers/auto-bind implementation.

+afterglow.controllers.launchpad-pro documentation

afterglow.controllers.launchpad-pro

Allows the Novation Launchpad Pro to be used as a control surface for Afterglow.

add-button-held-feedback-overlay

(add-button-held-feedback-overlay controller button)(add-button-held-feedback-overlay controller button color)

Adds a simple overlay which keeps a control button bright as long as the user is holding it down.

auto-bind

deprecated in 0.2.1

(auto-bind show & {:keys [device-filter refresh-interval display-name], :or {device-filter "Standalone Port", refresh-interval (/ 1000 15), display-name "Launchpad Pro"}})

Deprecated in favor of the shared controllers/auto-bind implementation.

Watches for a Novation Launchpad Pro controller to be connected, and as soon as it is, binds it to the specified show using bind-to-show. If that controller ever gets disconnected, it will be re-bound once it reappears. Returns a watcher structure which can be passed to deactivate if you would like to stop it watching for reconnections. The underlying controller mapping, once bound, can be accessed through the watcher’s :controller key.

If you have more than one Launchpad Pro that might beconnected, or have renamed how it appears in your list of MIDI devices, you need to supply a value after :device-filter which identifies the ports to be used to communicate with the Launchpad you want this function to use. The values returned by afterglow.midi/open-inputs-if-needed! and afterglow.midi/open-outputs-if-needed! will be searched, and the first port that matches using filter-devices will be used.

Once bound, the controller will be identified in the user interface (for the purposes of linking it to the web cue grid) as “Launchpad Pro”. If you would like to use a different name (for example, if you have more than one Launchpad), you can pass in a custom value after :display-name.

-

If you want the user interface to be refreshed at a different rate than the default of fifteen times per second, pass your desired number of milliseconds after :refresh-interval.

bind-to-show

deprecated in 0.2.1

(bind-to-show show & {:keys [device-filter refresh-interval display-name skip-animation], :or {device-filter "Standalone Port", refresh-interval (/ 1000 15), display-name "Launchpad Pro"}})

Deprecated in favor of the shared controllers/bind-to-show implementation.

+

If you want the user interface to be refreshed at a different rate than the default of fifteen times per second, pass your desired number of milliseconds after :refresh-interval.

bind-to-show

deprecated in 0.2.1

(bind-to-show show & {:keys [device-filter refresh-interval display-name skip-animation], :or {device-filter "Standalone Port", refresh-interval (/ 1000 15), display-name "Launchpad Pro"}})

Deprecated in favor of the shared controllers/bind-to-show implementation.

Establish a connection to the Novation Launchpad Pro, for managing the given show.

Initializes the display and starts the UI updater thread. Since SysEx messages are required for updating the display, if you are on a Mac, you must install CoreMIDI4J to provide a working implementation. (If you need to work with Java 1.6, you can instead use mmj, but that is no longer developed, and does not support connecting or disconnecting MIDI devices after Java has started.)

If you have more than one Launchpad connected, or have renamed how it appears in your list of MIDI devices, you need to supply a value after :device-filter which identifies the ports to be used to communicate with the Launchpad you want this function to use. The values returned by afterglow.midi/open-inputs-if-needed! and afterglow.midi/open-outputs-if-needed! will be searched, and the first port that matches with filter-devices will be used.

The controller will be identified in the user interface (for the purposes of linking it to the web cue grid) as “Launchpad Pro”. If you would like to use a different name (for example, if have more than one Launchpad), you can pass in a custom value after :display-name.

If you want the user interface to be refreshed at a different rate than the default of fifteen times per second, pass your desired number of milliseconds after :refresh-interval.

-

If you would like to skip the startup animation (for example because the device has just powered on and run its own animation), pass true after :skip-animation.

button-active-color

The color of an available button that is currently being pressed.

button-available-color

The color of buttons that can be pressed but haven’t yet been.

button-off-color

The color of buttons that are completely off.

clear-interface

(clear-interface controller)

Clears all illuminated buttons and pads.

click-synced-beat-color

The color of the tap tempo button when the metronome is synchronzied and a beat is taking place.

click-synced-off-beat-color

The color of the tap tempo button when the metronome is synchronized and a beat is not taking place.

click-unsynced-beat-color

The color of the tap tempo button when synchronization is off and a beat is taking place.

click-unsynced-off-beat-color

The color of the tap tempo button when synchronization is off and a beat is not taking place.

control-buttons

The labeled buttons which send and respond to Control Change events.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

-

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

led-color-values

(led-color-values color)

Given a color, return the values that should be sent in a Sysex message to set an LED to that color.

port-filter

Because the Launchpad Pro registers multiple ports with the MIDI environment, we need to be sure to bind only to the Standalone port. This filter is used with filter-devices to screen out any port that does not seem to be the Standalone port. If port names are assigned differently on your operating system, you may need to change this.

set-led-color

(set-led-color controller led color)

Set one of the LEDs, given its control or note number, to a specific RGB color.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color.

show-labels

(show-labels controller)(show-labels controller color)

Illuminates all buttons with text labels, for development assistance.

stop-active-color

The color of the stop button when active.

stop-available-color

The color of the Stop button when not active.

\ No newline at end of file +

If you would like to skip the startup animation (for example because the device has just powered on and run its own animation), pass true after :skip-animation.

button-active-color

The color of an available button that is currently being pressed.

button-available-color

The color of buttons that can be pressed but haven’t yet been.

button-off-color

The color of buttons that are completely off.

clear-interface

(clear-interface controller)

Clears all illuminated buttons and pads.

click-synced-beat-color

The color of the tap tempo button when the metronome is synchronzied and a beat is taking place.

click-synced-off-beat-color

The color of the tap tempo button when the metronome is synchronized and a beat is not taking place.

click-unsynced-beat-color

The color of the tap tempo button when synchronization is off and a beat is taking place.

click-unsynced-off-beat-color

The color of the tap tempo button when synchronization is off and a beat is not taking place.

control-buttons

The labeled buttons which send and respond to Control Change events.

deactivate

(deactivate controller & {:keys [disconnected], :or {disconnected false}})

Deactivates a controller interface, killing its update thread and removing its MIDI listeners. If :disconnected is passed with a true value, it means that the controller has already been removed from the MIDI environment, so no effort will be made to clear its display or take it out of User mode.

+

In general you will not need to call this function directly; it will be dispatched to via controllers/deactivate when that is called with a controller binding implementation from this namespace. It is also called automatically when one of the controllers being used disappears from the MIDI environment.

led-color-values

(led-color-values color)

Given a color, return the values that should be sent in a Sysex message to set an LED to that color.

port-filter

Because the Launchpad Pro registers multiple ports with the MIDI environment, we need to be sure to bind only to the Standalone port. This filter is used with filter-devices to screen out any port that does not seem to be the Standalone port. If port names are assigned differently on your operating system, you may need to change this.

set-led-color

(set-led-color controller led color)

Set one of the LEDs, given its control or note number, to a specific RGB color.

set-pad-color

(set-pad-color controller x y color)

Set the color of one of the 64 touch pads to a specific RGB color.

show-labels

(show-labels controller)(show-labels controller color)

Illuminates all buttons with text labels, for development assistance.

stop-active-color

The color of the stop button when active.

stop-available-color

The color of the Stop button when not active.

\ No newline at end of file diff --git a/api-doc/afterglow.controllers.tempo.html b/api-doc/afterglow.controllers.tempo.html index 0026e98e..f586fc34 100644 --- a/api-doc/afterglow.controllers.tempo.html +++ b/api-doc/afterglow.controllers.tempo.html @@ -1,9 +1,9 @@ -afterglow.controllers.tempo documentation

afterglow.controllers.tempo

Provides support for easily implementing tap-tempo and shift buttons on any MIDI controller.

add-midi-control-to-shift-mapping

(add-midi-control-to-shift-mapping device-filter channel kind note & {:keys [feedback-on feedback-off], :or {feedback-on 127, feedback-off 0}})

Sets up a controller pad or button to act as a shift button which can be used to modify other mappings. The shift state is entered whenever the specified note (when kind is :note) or controller-change (when kind is :control) message is received with a non-zero velocity (or control value) on the specified channel. The shift state is ended whenever a matching note-off or controller-change message with velocity zero is received.

+afterglow.controllers.tempo documentation

afterglow.controllers.tempo

Provides support for easily implementing tap-tempo and shift buttons on any MIDI controller.

add-midi-control-to-shift-mapping

(add-midi-control-to-shift-mapping device-filter channel kind note & {:keys [feedback-on feedback-off], :or {feedback-on 127, feedback-off 0}})

Sets up a controller pad or button to act as a shift button which can be used to modify other mappings. The shift state is entered whenever the specified note (when kind is :note) or controller-change (when kind is :control) message is received with a non-zero velocity (or control value) on the specified channel. The shift state is ended whenever a matching note-off or controller-change message with velocity zero is received.

The device to be mapped is identified by device-filter. The first input port which matches using filter-devices will be used.

Afterglow will attempt to provide feedback by lighting the pad or button when it is held down by sending note on/off or control-change values to the same controller. The note velocities or control values used can be changed by passing in different values with :feedback-on and :feedback-off, and this behavior can be suppressed entirely by passing false with :feedback-on.

-

Returns a map containing an entry :state whose value is a function that can be called to check the state of the shift button, returning true whenever it is held down. There are other entries in the map which are used for the mapping’s own purposes. Pass the entire map to remove-midi-control-to-shift-mapping if you ever want to stop the MIDI control or note from acting like a shift button.

add-midi-control-to-tempo-mapping

(add-midi-control-to-tempo-mapping device-filter channel kind note & {:keys [feedback-on feedback-off shift-fn], :or {feedback-on 127, feedback-off 0, shift-fn (constantly false)}})

Sets up a controller pad or button to act as a sync-aware Tap Tempo button for the default metronome in *show*. Whenever the specified note (when kind is :note) or controller-change (when kind is :control) message is received with a non-zero velocity (or control value), the appropriate tempo adjustment action is taken.

+

Returns a map containing an entry :state whose value is a function that can be called to check the state of the shift button, returning true whenever it is held down. There are other entries in the map which are used for the mapping’s own purposes. Pass the entire map to remove-midi-control-to-shift-mapping if you ever want to stop the MIDI control or note from acting like a shift button.

add-midi-control-to-tempo-mapping

(add-midi-control-to-tempo-mapping device-filter channel kind note & {:keys [feedback-on feedback-off shift-fn], :or {feedback-on 127, feedback-off 0, shift-fn (constantly false)}})

Sets up a controller pad or button to act as a sync-aware Tap Tempo button for the default metronome in *show*. Whenever the specified note (when kind is :note) or controller-change (when kind is :control) message is received with a non-zero velocity (or control value), the appropriate tempo adjustment action is taken.

  • If the show’s sync mode is manual, this will invoke a low-level metronome tap-tempo handler to adjust the metronome tempo.

  • @@ -15,7 +15,7 @@

    The device to be mapped is identified by device-filter. The first input port which matches using filter-devices will be used.

    Afterglow will attempt to provide feedback by flashing the pad or button on each beat sending note on/off or control-change values to the same controller. The note velocities or control values used can be changed by passing in different values with :feedback-on and :feedback-off, and this behavior can be suppressed entirely by passing false with :feedback-on.

    If you have set up a button on your controller to act like the shift button on one of the full-featured grid controllers, you can pass in a function with :shift-fn that returns true when that the shift button is held down. Whenever that function returns true for a tempo tap, the returned tap handler function will synchronize at the next higher level. (In other words, if it was going to be a tempo tap, it would be treated as a beat tap; what would normally be a beat tap would be treated as a bar tap, and a bar tap would be promoted to start a phrase.) When you map a shift button using add-midi-control-to-shift-mapping, it gives you a function that is suitable for use with :shift-fn as the value of the :state key in the map it returns.

    -

    Returns the tempo-mapping function which can be passed to remove-midi-control-to-tempo-mapping if you ever want to stop the MIDI control or note from affecting the metronome in the future.

create-show-tempo-tap-handler

(create-show-tempo-tap-handler show & {:keys [shift-fn], :or {shift-fn (constantly false)}})

Returns a function that provides higher level tempo tap support for a show, based on the sync mode of the show metronome. Call the returned function whenever the user has tapped your tempo button.

+

Returns the tempo-mapping function which can be passed to remove-midi-control-to-tempo-mapping if you ever want to stop the MIDI control or note from affecting the metronome in the future.

create-show-tempo-tap-handler

(create-show-tempo-tap-handler show & {:keys [shift-fn], :or {shift-fn (constantly false)}})

Returns a function that provides higher level tempo tap support for a show, based on the sync mode of the show metronome. Call the returned function whenever the user has tapped your tempo button.

  • If the show’s sync mode is manual, this will invoke a low-level metronome tap-tempo handler to align the beat to the tap, and (if three or more taps occur within two seconds of each other) adjust the metronome tempo.

  • @@ -25,4 +25,4 @@

    If the show’s sync mode is DJ Link or Traktor Beat phase (so beats are already automatically aligned), calling the returned function will align the current beat to be a down beat (first beat of a bar).

If you have set up a button on your controller to act like the shift button on one of the full-featured grid controllers, you can pass in a function with :shift-fn that returns true when that the shift button is held down. Whenever that function returns true for a tempo tap, the returned tap handler function will synchronize at the next higher level. (In other words, if it was going to be a tempo or beat tap, it would be treated as a bar tap, and what would normally be a bar tap would be promoted to start a phrase.) If the metronome is not locked into a beat grid, when you set the position of a bar by shift-tapping, the beat is also aligned with the tap.

-

Returns a map describing the result of the current tempo tap.

remove-midi-control-to-shift-mapping

(remove-midi-control-to-shift-mapping device-filter channel kind note mapping)

Undoes the effect of add-midi-control-to-tempo-mapping. You must pass the value that was returned by that function as the argument mapping.

remove-midi-control-to-tempo-mapping

(remove-midi-control-to-tempo-mapping device-filter channel kind note f)

Undoes the effect of add-midi-control-to-tempo-mapping. You must pass the value that was returned by that function as the argument f.

\ No newline at end of file +

Returns a map describing the result of the current tempo tap.

remove-midi-control-to-shift-mapping

(remove-midi-control-to-shift-mapping device-filter channel kind note mapping)

Undoes the effect of add-midi-control-to-tempo-mapping. You must pass the value that was returned by that function as the argument mapping.

remove-midi-control-to-tempo-mapping

(remove-midi-control-to-tempo-mapping device-filter channel kind note f)

Undoes the effect of add-midi-control-to-tempo-mapping. You must pass the value that was returned by that function as the argument f.

\ No newline at end of file diff --git a/api-doc/afterglow.core.html b/api-doc/afterglow.core.html index 2f498576..cdd5cd4d 100644 --- a/api-doc/afterglow.core.html +++ b/api-doc/afterglow.core.html @@ -1,3 +1,3 @@ -afterglow.core documentation

afterglow.core

This is the main class for running Afterglow as a self-contained JAR application. When you are learning and experimenting in your REPL, the main namespace you want to be using is afterglow.examples

-main

(-main & args)

The entry point when invoked as a jar from the command line. Parse options and start servers on the appropriate ports.

cli-options

The command-line options supported by Afterglow.

error-msg

(error-msg errors)

Format an error message related to command-line invocation.

exit

(exit status msg)

Terminate execution with a message to the command-line user.

init-logging

(init-logging)(init-logging appenders-map)

Set up the logging environment for Afterglow. Called by main when invoked as a jar, and by the examples namespace when brought up in a REPL for exploration, and by extensions such as afterglow-max which host Afterglow in Cycling ’74’s Max.

nrepl-server

Holds the running REPL server, if there is one, for later shutdown.

osc-server

Holds the running OSC server, if there is one, for later shutdown.

session-cleaner

Holds the future which is cleaning up expired web sessions, if any.

start-nrepl

(start-nrepl port)

Start a network REPL for debugging or remote control.

start-osc-server

(start-osc-server port)

Start the embedded OSC server on the specified port.

start-web-server

(start-web-server port)(start-web-server port browser)

Start the embedded web UI server on the specified port. If a truthy value is supplied for browser, opens a web browser window on the newly launched server. If the server was already running, logs a warning. Either way, makes sure the background thread which cleans up expired sessions is running.

stop-osc-server

(stop-osc-server)

Shut down the embedded OSC server if it is running.

stop-servers

(stop-servers)

Shut down the embedded web UI, OSC and NREPL servers.

usage

(usage options-summary)

Print message explaining command-line invocation options.

web-server

Holds the running web UI server, if there is one, for later shutdown.

\ No newline at end of file +afterglow.core documentation

afterglow.core

This is the main class for running Afterglow as a self-contained JAR application. When you are learning and experimenting in your REPL, the main namespace you want to be using is afterglow.examples

-main

(-main & args)

The entry point when invoked as a jar from the command line. Parse options and start servers on the appropriate ports.

cli-options

The command-line options supported by Afterglow.

error-msg

(error-msg errors)

Format an error message related to command-line invocation.

exit

(exit status msg)

Terminate execution with a message to the command-line user.

init-logging

(init-logging)(init-logging appenders-map)

Set up the logging environment for Afterglow. Called by main when invoked as a jar, and by the examples namespace when brought up in a REPL for exploration, and by extensions such as afterglow-max which host Afterglow in Cycling ’74’s Max.

nrepl-server

Holds the running REPL server, if there is one, for later shutdown.

osc-server

Holds the running OSC server, if there is one, for later shutdown.

session-cleaner

Holds the future which is cleaning up expired web sessions, if any.

start-nrepl

(start-nrepl port)

Start a network REPL for debugging or remote control.

start-osc-server

(start-osc-server port)

Start the embedded OSC server on the specified port.

start-web-server

(start-web-server port)(start-web-server port browser)

Start the embedded web UI server on the specified port. If a truthy value is supplied for browser, opens a web browser window on the newly launched server. If the server was already running, logs a warning. Either way, makes sure the background thread which cleans up expired sessions is running.

stop-osc-server

(stop-osc-server)

Shut down the embedded OSC server if it is running.

stop-servers

(stop-servers)

Shut down the embedded web UI, OSC and NREPL servers.

usage

(usage options-summary)

Print message explaining command-line invocation options.

web-server

Holds the running web UI server, if there is one, for later shutdown.

\ No newline at end of file diff --git a/api-doc/afterglow.coremidi4j.html b/api-doc/afterglow.coremidi4j.html index 434c4dc1..de698f27 100644 --- a/api-doc/afterglow.coremidi4j.html +++ b/api-doc/afterglow.coremidi4j.html @@ -1,4 +1,4 @@ -afterglow.coremidi4j documentation

afterglow.coremidi4j

add-environment-change-handler

(add-environment-change-handler f)

Arranges for the supplied function to be called whenever the MIDI environment changes, in other words when a MIDI device is added or removed. This namespace can only be loaded if the CoreMIDI4J extension is present in the Java extensions directory.

-

Returns true if the handler was added, or false if the CoreMIDI4J extension was unable to load its native library, and so is inactive.

\ No newline at end of file +afterglow.coremidi4j documentation

afterglow.coremidi4j

add-environment-change-handler

(add-environment-change-handler f)

Arranges for the supplied function to be called whenever the MIDI environment changes, in other words when a MIDI device is added or removed. This namespace can only be loaded if the CoreMIDI4J extension is present in the Java extensions directory.

+

Returns true if the handler was added, or false if the CoreMIDI4J extension was unable to load its native library, and so is inactive.

\ No newline at end of file diff --git a/api-doc/afterglow.dj-link.html b/api-doc/afterglow.dj-link.html index 599c8019..9e436d23 100644 --- a/api-doc/afterglow.dj-link.html +++ b/api-doc/afterglow.dj-link.html @@ -1,3 +1,3 @@ -afterglow.dj-link documentation

afterglow.dj-link

Provides synchronization with equipment sending Pioneer Pro DJ Link packets on the local network, such as Pioneer Nexus mixers and players. This is purely experimental and based on network traffic capture, but unless they change the protocol, it works really well, providing rock solid BPM, beat, and measure-phase tracking.

filter-sources

(filter-sources name-filter)

Return a set of only those sources whose name matches the specified pattern. name-filter can either be a Pattern, or a string which will be turned into a pattern which matches in a case-insensitive way anywhere in the name.

find-source

(find-source source)

Makes sure the supplied DJ Link source is current and valid. Returns it, or throws an exception.

find-source-by-name

(find-source-by-name name-filter)

Looks up a source with a name that matches the specified pattern. name-filter can either be a Pattern, or a string which will be turned into a pattern which matches in a case-insensitive way anywhere in the name. Returns the single matching source found, or throws an exception.

max-packet-interval

The number of milliseconds after which we will consider a source to have disappeared if we have not heard any packets from it.

port

The UDP port on which BPM and beat packets are broadcast.

shut-down

(shut-down)

Close the UDP server socket and terminate the packet processing thread, if they are active.

start

(start)

Make sure the UDP server socket is open and the packet reception thread is running, starting fresh if need be.

start-if-needed

(start-if-needed)

If there is not already a socket receiving DJ Link packets, set it up.

\ No newline at end of file +afterglow.dj-link documentation

afterglow.dj-link

Provides synchronization with equipment sending Pioneer Pro DJ Link packets on the local network, such as Pioneer Nexus mixers and players. This is purely experimental and based on network traffic capture, but unless they change the protocol, it works really well, providing rock solid BPM, beat, and measure-phase tracking.

filter-sources

(filter-sources name-filter)

Return a set of only those sources whose name matches the specified pattern. name-filter can either be a Pattern, or a string which will be turned into a pattern which matches in a case-insensitive way anywhere in the name.

find-source

(find-source source)

Makes sure the supplied DJ Link source is current and valid. Returns it, or throws an exception.

find-source-by-name

(find-source-by-name name-filter)

Looks up a source with a name that matches the specified pattern. name-filter can either be a Pattern, or a string which will be turned into a pattern which matches in a case-insensitive way anywhere in the name. Returns the single matching source found, or throws an exception.

max-packet-interval

The number of milliseconds after which we will consider a source to have disappeared if we have not heard any packets from it.

port

The UDP port on which BPM and beat packets are broadcast.

shut-down

(shut-down)

Close the UDP server socket and terminate the packet processing thread, if they are active.

start

(start)

Make sure the UDP server socket is open and the packet reception thread is running, starting fresh if need be.

start-if-needed

(start-if-needed)

If there is not already a socket receiving DJ Link packets, set it up.

\ No newline at end of file diff --git a/api-doc/afterglow.effects.channel.html b/api-doc/afterglow.effects.channel.html index e786ae45..bdbac051 100644 --- a/api-doc/afterglow.effects.channel.html +++ b/api-doc/afterglow.effects.channel.html @@ -1,7 +1,7 @@ -afterglow.effects.channel documentation

afterglow.effects.channel

Effects pipeline functions for working with individual DMX channels.

apply-channel-value

(apply-channel-value buffers channel value)

A function which sets the DMX buffer value(s) for a channel, supporting fine channels as well (in which there is a high and low byte), using any fractional part of the value to determine the fine channel value if one is present.

-

Also supports inverted channels (as needed for some fixtures which have inverted dimmers). Such channels are specified by containing an :inverted-from key which specifies the DMX value at which inversion occurs. If the entire DMX range is inverted, in other words 0 represents the highest value and 255 the lowest, :inverted-from will be present with the value 0. For dimmers which are still black at zero, but which leap to full brightness at 1 then dim as the value grows towards 255, :inverted-from will be present with the value 1. Non-inverted channels will lack the key entirely.

build-channel-assigner

(build-channel-assigner channel f)

Returns an assigner which applies the specified assignment function to the supplied channel.

build-fixed-channel-effect

(build-fixed-channel-effect name level channels & {:keys [htp?]})

Returns an effect which simply assigns a fixed value to all the supplied channels. If htp? is true, applies highest-takes-precedence (i.e. compares the value to the previous assignment for the channel, and lets the highest value remain).

build-head-function-assigner

(build-head-function-assigner function head assign-f)

Returns a function assigner which applies the specified assignment function to the channels of the provided head or fixture which implement the specified named function. The head or fixture must (directly) have a channel implementing the named function.

build-head-function-assigners

(build-head-function-assigners function heads assign-f)

Returns a list of function assigners type which apply an assignment function to the channel of all the supplied heads or fixtures which implement the specified named function. Each head or fixture must (directly) have a channel implementing the named function.

build-head-parameter-function-assigner

(build-head-parameter-function-assigner function head param show snapshot)

Returns an function assigner which applies a parameter to the channel of the supplied head or fixture which implements the specified named function. If the parameter is not frame-dynamic, it gets resolved when creating this assigner. Otherwise, resolution is deferred to frame rendering time. The head or fixture must (directly) have a channel implementing the named function.

build-head-parameter-function-assigners

(build-head-parameter-function-assigners function heads param show)

Returns a list of assigners which apply a parameter to the channel(s) of the supplied heads or fixtures which implement the specified named function. Each head or fixture must (directly) have a channel implementing the named function.

build-raw-channel-assigners

(build-raw-channel-assigners channels f)

Returns a list of assigners which apply a channel assignment function to all the supplied channels.

channel-effect

(channel-effect effect-name level channels & {:keys [htp?]})

Returns an effect which assigns a dynamic value to all the supplied channels. If level is a keyword, it will be looked up as a show -variable. Ifhtp?` is true, applies highest-takes-precedence (i.e. compares the value to the previous assignment for the channel, and lets the highest value remain).

find-heads-with-function

(find-heads-with-function function fixtures)

Returns all heads of the supplied fixtures which have a channel that implements the specified function.

function-effect

(function-effect effect-name function level fixtures & {:keys [htp?]})

Returns an effect which assigns a dynamic value to all channels of the supplied fixtures or heads which have a range that implements the specified function. (Functions are a way for fixtures to use the same DMX channel to do multiple things, allocating ranges of values to get more dense use from a smaller number of channel allocations.) The function argument is the keyword by which the function information will be found for the supplied fixtures. The actual value sent for the channel associated with function for each fixture will be calculated by treating level as a percentage of the way between the lowest and highest DMX values assigned to that named function for the fixture. The name displayed for the effect in user interfaces is determined by effect-name.

+afterglow.effects.channel documentation

afterglow.effects.channel

Effects pipeline functions for working with individual DMX channels.

apply-channel-value

(apply-channel-value buffers channel value)

A function which sets the DMX buffer value(s) for a channel, supporting fine channels as well (in which there is a high and low byte), using any fractional part of the value to determine the fine channel value if one is present.

+

Also supports inverted channels (as needed for some fixtures which have inverted dimmers). Such channels are specified by containing an :inverted-from key which specifies the DMX value at which inversion occurs. If the entire DMX range is inverted, in other words 0 represents the highest value and 255 the lowest, :inverted-from will be present with the value 0. For dimmers which are still black at zero, but which leap to full brightness at 1 then dim as the value grows towards 255, :inverted-from will be present with the value 1. Non-inverted channels will lack the key entirely.

build-channel-assigner

(build-channel-assigner channel f)

Returns an assigner which applies the specified assignment function to the supplied channel.

build-fixed-channel-effect

(build-fixed-channel-effect name level channels & {:keys [htp?]})

Returns an effect which simply assigns a fixed value to all the supplied channels. If htp? is true, applies highest-takes-precedence (i.e. compares the value to the previous assignment for the channel, and lets the highest value remain).

build-head-function-assigner

(build-head-function-assigner function head assign-f)

Returns a function assigner which applies the specified assignment function to the channels of the provided head or fixture which implement the specified named function. The head or fixture must (directly) have a channel implementing the named function.

build-head-function-assigners

(build-head-function-assigners function heads assign-f)

Returns a list of function assigners type which apply an assignment function to the channel of all the supplied heads or fixtures which implement the specified named function. Each head or fixture must (directly) have a channel implementing the named function.

build-head-parameter-function-assigner

(build-head-parameter-function-assigner function head param show snapshot)

Returns an function assigner which applies a parameter to the channel of the supplied head or fixture which implements the specified named function. If the parameter is not frame-dynamic, it gets resolved when creating this assigner. Otherwise, resolution is deferred to frame rendering time. The head or fixture must (directly) have a channel implementing the named function.

build-head-parameter-function-assigners

(build-head-parameter-function-assigners function heads param show)

Returns a list of assigners which apply a parameter to the channel(s) of the supplied heads or fixtures which implement the specified named function. Each head or fixture must (directly) have a channel implementing the named function.

build-raw-channel-assigners

(build-raw-channel-assigners channels f)

Returns a list of assigners which apply a channel assignment function to all the supplied channels.

channel-effect

(channel-effect effect-name level channels & {:keys [htp?]})

Returns an effect which assigns a dynamic value to all the supplied channels. If level is a keyword, it will be looked up as a show +variable. Ifhtp?` is true, applies highest-takes-precedence (i.e. compares the value to the previous assignment for the channel, and lets the highest value remain).

find-heads-with-function

(find-heads-with-function function fixtures)

Returns all heads of the supplied fixtures which have a channel that implements the specified function.

function-effect

(function-effect effect-name function level fixtures & {:keys [htp?]})

Returns an effect which assigns a dynamic value to all channels of the supplied fixtures or heads which have a range that implements the specified function. (Functions are a way for fixtures to use the same DMX channel to do multiple things, allocating ranges of values to get more dense use from a smaller number of channel allocations.) The function argument is the keyword by which the function information will be found for the supplied fixtures. The actual value sent for the channel associated with function for each fixture will be calculated by treating level as a percentage of the way between the lowest and highest DMX values assigned to that named function for the fixture. The name displayed for the effect in user interfaces is determined by effect-name.

If :htp? is passed with a true value, applies highest-takes-precedence (i.e. compares the value to the previous assignment for the channels implementing the function, and lets the highest value remain).

-

If you have multiple effects trying to control different functions which use the same channel, you are unlikely to get the results you want. Hopefully the fixture designers chose how to share channels wisely, avoiding this pitfall.

function-percentage-to-dmx

(function-percentage-to-dmx percent function-spec)

Given a percentage value and a named function specfication which identifies a range of DMX channel values, scales the percentage into that range. If the function spec has a value scaler function attached to it (via the key :scale-fn), call that with the value to get the percentage before scaling it to the DMX range.

function-value-scaler

(function-value-scaler range-min range-max value)

Converts a named function value from an arbitrary range to a percentage along that range. Designed to be partially applied in a fixture definition, so function-percentage-to-dmx can pass the value being resolved as the last parameter.

raw-channel-effect

(raw-channel-effect effect-name f channels)

Returns an effect which simply calls a function to obtain the current level for all the supplied channels, runs forever, and ends immediately when requested.

\ No newline at end of file +

If you have multiple effects trying to control different functions which use the same channel, you are unlikely to get the results you want. Hopefully the fixture designers chose how to share channels wisely, avoiding this pitfall.

function-percentage-to-dmx

(function-percentage-to-dmx percent function-spec)

Given a percentage value and a named function specfication which identifies a range of DMX channel values, scales the percentage into that range. If the function spec has a value scaler function attached to it (via the key :scale-fn), call that with the value to get the percentage before scaling it to the DMX range.

function-value-scaler

(function-value-scaler range-min range-max value)

Converts a named function value from an arbitrary range to a percentage along that range. Designed to be partially applied in a fixture definition, so function-percentage-to-dmx can pass the value being resolved as the last parameter.

raw-channel-effect

(raw-channel-effect effect-name f channels)

Returns an effect which simply calls a function to obtain the current level for all the supplied channels, runs forever, and ends immediately when requested.

\ No newline at end of file diff --git a/api-doc/afterglow.effects.color.html b/api-doc/afterglow.effects.color.html index ec33bdd6..ef45f19f 100644 --- a/api-doc/afterglow.effects.color.html +++ b/api-doc/afterglow.effects.color.html @@ -1,4 +1,4 @@ -afterglow.effects.color documentation

afterglow.effects.color

Effects pipeline functions for working with color assignments to fixtures and heads.

build-htp-color-assigner

(build-htp-color-assigner head param show snapshot)

Returns an assigner that applies highest-takes-precedence color mixing of a dynamic color parameter to the supplied head or fixture. If the parameter is not frame-dynamic, it gets resolved when creating this assigner. Otherwise, resolution is deferred to frame rendering time. At that time, both the previous assignment and the current parameter are resolved, and the red, green, and blue values of the color are set to whichever of the previous and current assignment held the highest.

build-htp-color-assigners

(build-htp-color-assigners heads param show)

Returns a list of assigners which apply highest-takes-precedence color mixing to all the supplied heads or fixtures.

build-saturation-transformation

(build-saturation-transformation & {:keys [param], :or {param (osc/build-oscillated-param (osc/sawtooth :down? true) :max 100)}})

Creates a color transformation for use with transform-colors which changes the saturation based on a variable parameter. If no parameter is supplied, the default is to use an oscillated parameter based on sawtooth-beat with :down? set to true so the color is fully saturated at the start of the beat, and fully desaturated by the end. A different pattern can be created by supplying a different parameter with the :param optional keyword argument.

color-effect

(color-effect name color fixtures & {:keys [include-color-wheels? htp?]})

Returns an effect which assigns a color parameter to all heads of the fixtures supplied when invoked. If :include-color-wheels? is passed with a true value, then fixtures which use color wheels are included, otherwise only color-mixing fixtures are included. If :htp? is passed with a true value, highest-takes-precedence assignment is used with the red, green, and blue color values to blend this color with any previous color that might have been assigned to the affected fixtures.

fade-colors

(fade-colors from to fraction show snapshot target)

Calculate a weighted HSL blend between two colors, which may be dynamic parameters, and where nil is considered to be a fully darkened version of the other side of the fade.

htp-merge

(htp-merge previous current)

Helper function for assigners that want to use highest-takes-priority blending for RGB colors. Returns a color that contains the highest red component from the two input colors, the highest green component, and the highest blue component.

transform-colors

(transform-colors fixtures & {:keys [transform-fn beyond-server], :or {transform-fn (build-saturation-transformation), beyond-server nil}})

Creates an effect which modifies any effect that is currently assigning a color to the supplied fixtures. Needs to be assigned a higher priority than any effects it should transform, so that it will run after them. The actual transformation is implemented by a function which takes a color, show, snapshot, and head, and returns a transformed color. This function is specified with the :transform-fn optional keyword argument; if none is specified, build-saturation-transformation is called with no arguments to create one which causes the saturation of the color to range from full at the start of each beat to none at the end.

-

If the optional keyword argument :beyond-server is passed with a Beyond server (as returned by beyond-server), any color being sent to that integrated laser show using laser-color-effect will also be transformed.

\ No newline at end of file +afterglow.effects.color documentation

afterglow.effects.color

Effects pipeline functions for working with color assignments to fixtures and heads.

build-htp-color-assigner

(build-htp-color-assigner head param show snapshot)

Returns an assigner that applies highest-takes-precedence color mixing of a dynamic color parameter to the supplied head or fixture. If the parameter is not frame-dynamic, it gets resolved when creating this assigner. Otherwise, resolution is deferred to frame rendering time. At that time, both the previous assignment and the current parameter are resolved, and the red, green, and blue values of the color are set to whichever of the previous and current assignment held the highest.

build-htp-color-assigners

(build-htp-color-assigners heads param show)

Returns a list of assigners which apply highest-takes-precedence color mixing to all the supplied heads or fixtures.

build-saturation-transformation

(build-saturation-transformation & {:keys [param], :or {param (osc/build-oscillated-param (osc/sawtooth :down? true) :max 100)}})

Creates a color transformation for use with transform-colors which changes the saturation based on a variable parameter. If no parameter is supplied, the default is to use an oscillated parameter based on sawtooth-beat with :down? set to true so the color is fully saturated at the start of the beat, and fully desaturated by the end. A different pattern can be created by supplying a different parameter with the :param optional keyword argument.

color-effect

(color-effect name color fixtures & {:keys [include-color-wheels? htp?]})

Returns an effect which assigns a color parameter to all heads of the fixtures supplied when invoked. If :include-color-wheels? is passed with a true value, then fixtures which use color wheels are included, otherwise only color-mixing fixtures are included. If :htp? is passed with a true value, highest-takes-precedence assignment is used with the red, green, and blue color values to blend this color with any previous color that might have been assigned to the affected fixtures.

fade-colors

(fade-colors from to fraction show snapshot target)

Calculate a weighted HSL blend between two colors, which may be dynamic parameters, and where nil is considered to be a fully darkened version of the other side of the fade.

htp-merge

(htp-merge previous current)

Helper function for assigners that want to use highest-takes-priority blending for RGB colors. Returns a color that contains the highest red component from the two input colors, the highest green component, and the highest blue component.

transform-colors

(transform-colors fixtures & {:keys [transform-fn beyond-server], :or {transform-fn (build-saturation-transformation), beyond-server nil}})

Creates an effect which modifies any effect that is currently assigning a color to the supplied fixtures. Needs to be assigned a higher priority than any effects it should transform, so that it will run after them. The actual transformation is implemented by a function which takes a color, show, snapshot, and head, and returns a transformed color. This function is specified with the :transform-fn optional keyword argument; if none is specified, build-saturation-transformation is called with no arguments to create one which causes the saturation of the color to range from full at the start of each beat to none at the end.

+

If the optional keyword argument :beyond-server is passed with a Beyond server (as returned by beyond-server), any color being sent to that integrated laser show using laser-color-effect will also be transformed.

\ No newline at end of file diff --git a/api-doc/afterglow.effects.cues.html b/api-doc/afterglow.effects.cues.html index e0d75540..b0600a2a 100644 --- a/api-doc/afterglow.effects.cues.html +++ b/api-doc/afterglow.effects.cues.html @@ -1,18 +1,18 @@ -afterglow.effects.cues documentation

afterglow.effects.cues

Cues provide a user interface for controlling effects, by associating them with cells in a cue grid so they can be easily triggered and monitored, either through a physical grid controller, or the web show control interface. They also provide a way of binding cue variables to effect parameters, which can enable controller interfaces to adjust them, and of tying those variables to velocity and pressure sensitivity on physical grid controllers which have such capabilities.

add-midi-control-to-cue-mapping

deprecated in 0.2.0

(add-midi-control-to-cue-mapping device-filter channel kind note x y & {:keys [feedback-on feedback-off use-velocity momentary?], :or {feedback-on 127, feedback-off 0, use-velocity true, momentary? true}})

Deprecated in favor of the more accurately named add-midi-to-cue-mapping.

add-midi-to-cue-mapping

(add-midi-to-cue-mapping device-filter channel kind note x y & {:keys [feedback-on feedback-off use-velocity momentary?], :or {feedback-on 127, feedback-off 0, use-velocity true, momentary? true}})

Cause the specified cue from the *show* cue grid to be triggered by receipt of the specified note (when kind is :note) or controller-change (when kind is :control) message with a non-zero velocity or control value. This allows generic MIDI controllers, which do not have enough pads or feedback capabilities to act as a full grid controller like the Ableton Push, to still provide a physical means of triggering cues.

+afterglow.effects.cues documentation

afterglow.effects.cues

Cues provide a user interface for controlling effects, by associating them with cells in a cue grid so they can be easily triggered and monitored, either through a physical grid controller, or the web show control interface. They also provide a way of binding cue variables to effect parameters, which can enable controller interfaces to adjust them, and of tying those variables to velocity and pressure sensitivity on physical grid controllers which have such capabilities.

add-midi-control-to-cue-mapping

deprecated in 0.2.0

(add-midi-control-to-cue-mapping device-filter channel kind note x y & {:keys [feedback-on feedback-off use-velocity momentary?], :or {feedback-on 127, feedback-off 0, use-velocity true, momentary? true}})

Deprecated in favor of the more accurately named add-midi-to-cue-mapping.

add-midi-to-cue-mapping

(add-midi-to-cue-mapping device-filter channel kind note x y & {:keys [feedback-on feedback-off use-velocity momentary?], :or {feedback-on 127, feedback-off 0, use-velocity true, momentary? true}})

Cause the specified cue from the *show* cue grid to be triggered by receipt of the specified note (when kind is :note) or controller-change (when kind is :control) message with a non-zero velocity or control value. This allows generic MIDI controllers, which do not have enough pads or feedback capabilities to act as a full grid controller like the Ableton Push, to still provide a physical means of triggering cues.

The device to be mapped is identified by device-filter. The first input port which matches using filter-devices will be used.

The desired cue is identified by passing in its x and y coordinates within the show cue grid.

Afterglow will attempt to provide feedback about the progress of the cue by sending note on/off or control-change values to the same controller when the cue starts and ends. The note velocities or control values used can be changed by passing in different values with :feedback-on and :feedback-off, and this behavior can be suppressed entirely by passing false with :feedback-on.

If the controller is pressure-sensitive and you would like to have the velocity information passed on to any cue variables which are configured to respond to it, pass true with :use-velocity. This is the default assumed if :use-velocity is omitted, and also enables responsiveness to aftertouch (polyphonic key pressure) messages, which can adjust the cue variable for as long as you are holding down the key or pad, if your controller sends them (and kind is :note).

If the controller is not pressure-sensitive, and you would like to have the cue react as if it was pressed with a particular velocity, you can pass a number from 0 to 127 with :use-velocity. Whenever the cue is activated, it will be activated with the specified velocity. If you pass :use-velocity with false, the cue will be activated with a default velocity. In any of these cases where use-velocity is not true, no attempt will be made to respond to aftertouch messages.

Afterglow assumes the control is momentary, meaning it sends a note off (or control value of 0) as soon as it is released, and a second press will be used to end the cue unless the cue uses the :held modifier to indicate it should be ended when the button is released. If your controller does not have momentary buttons and already requires a second press to turn off the note or control value, pass false with :momentary? and Afterglow will always end cues when it receives a control value of 0, even if cues are not marked as :held.

-

Returns the cue-triggering function which can be passed to remove-midi-to-cue-mapping if you ever want to stop the MIDI control or note from affecting the cue in the future.

apply-merging-var-map

macro

(apply-merging-var-map var-map f & args)

Call the specified function merging all keys and values from the supplied cue variable map to the end of the provided argument list. Useful when creating an effect with optional keyword arguments whose values are being set by cue variables bound to the appropriate keys.

code-cue

(code-cue code label & {:keys [color], :or {color :white}})

Creates a cue that runs an arbitrary chunk of Clojure code instead of starting an effect, for example to reset the metronome if the controller mapping doesn’t have a dedicated button for doing that.

+

Returns the cue-triggering function which can be passed to remove-midi-to-cue-mapping if you ever want to stop the MIDI control or note from affecting the cue in the future.

apply-merging-var-map

macro

(apply-merging-var-map var-map f & args)

Call the specified function merging all keys and values from the supplied cue variable map to the end of the provided argument list. Useful when creating an effect with optional keyword arguments whose values are being set by cue variables bound to the appropriate keys.

code-cue

(code-cue code label & {:keys [color], :or {color :white}})

Creates a cue that runs an arbitrary chunk of Clojure code instead of starting an effect, for example to reset the metronome if the controller mapping doesn’t have a dedicated button for doing that.

The code argument must be a function that takes two arguments. It will be called with the show and metronome snapshot when the cue is started, and should return immediately, because this takes place on the effect rendering pipeline, so any lengthy operations must be performed on another thread. The effect won’t do anything else after calling code once, but the cue is configured to keep it “running” until you let go of that grid controller pad, so you can see visual feedback that it ran.

The label argument is a string which is used to identify the cue in the cue grid.

-

The optional keyword argument :color requests that the web interface and control surfaces draw the cue using the specified color rather than the default white to help the user identify it. This is only a request, as not all control surfaces support all (or any) colors. The color is passed to interpret-color, so it can be specified in a variety of ways.

color-fn-from-cue-var

(color-fn-from-cue-var var-spec)(color-fn-from-cue-var var-spec x y)

Builds a dynamic cue color function which reports the color of a cue based on the content of a cue variable, given the cue variable map.

+

The optional keyword argument :color requests that the web interface and control surfaces draw the cue using the specified color rather than the default white to help the user identify it. This is only a request, as not all control surfaces support all (or any) colors. The color is passed to interpret-color, so it can be specified in a variety of ways.

color-fn-from-cue-var

(color-fn-from-cue-var var-spec)(color-fn-from-cue-var var-spec x y)

Builds a dynamic cue color function which reports the color of a cue based on the content of a cue variable, given the cue variable map.

When the cue is running, we look up the value of the specified cue variable, and return that. If the variable is nil, the non-dynamic cue color is returned.

-

When the cue is not running, we try to look up the saved value for the variable if the cue’s x and y grid coordinates were supplied. If a saved value can be found for the variable, that color is returned. Failing that, we check whether the variable is a permanent show variable, which we can look up even when the cue is not running. If so, and the variable has a non-nil value, we return that color. Again, if all else fails, we return the non-dynamic cue color.

color-fn-from-param

(color-fn-from-param param)

Builds a dynamic cue color function which reports the color of a cue based on the value of a dynamic parameter. If the parameter evaluates to nil, the non-dynamic cue color is returned.

compound-cues-effect

(compound-cues-effect name show cues)

Creates an effect which launches the specified cues from the grid, stays running as long as they are, and ends them all when it is asked to end. Takes a list of three-element tuples identifying the x and y coordinates within the cue grid of the subordinate cues to launch, and an optional map of cue variable overrides, which can be used to change the initial values of any temporary variables introduced by that cue.

cue

(cue show-key effect-fn & {:keys [variables short-name color color-fn end-keys priority held visualizer], :or {short-name (:name (show/get-cue-effect effect-fn variables)), color :white, priority 0}})

Creates a cue for managing in a cue grid. show-key will be used as the effect keyword when the cue is triggered to add it to a show, ending any existing effect that was using that key. effect-fn is a function that will be called to obtain the effect to be started and monitored when this cue is triggered. It will be passed a map allowing lookup of any temporary variables introduced by the cue (see the :variables parameter below).

+

When the cue is not running, we try to look up the saved value for the variable if the cue’s x and y grid coordinates were supplied. If a saved value can be found for the variable, that color is returned. Failing that, we check whether the variable is a permanent show variable, which we can look up even when the cue is not running. If so, and the variable has a non-nil value, we return that color. Again, if all else fails, we return the non-dynamic cue color.

color-fn-from-param

(color-fn-from-param param)

Builds a dynamic cue color function which reports the color of a cue based on the value of a dynamic parameter. If the parameter evaluates to nil, the non-dynamic cue color is returned.

compound-cues-effect

(compound-cues-effect name show cues)

Creates an effect which launches the specified cues from the grid, stays running as long as they are, and ends them all when it is asked to end. Takes a list of three-element tuples identifying the x and y coordinates within the cue grid of the subordinate cues to launch, and an optional map of cue variable overrides, which can be used to change the initial values of any temporary variables introduced by that cue.

cue

(cue show-key effect-fn & {:keys [variables short-name color color-fn end-keys priority held visualizer], :or {short-name (:name (show/get-cue-effect effect-fn variables)), color :white, priority 0}})

Creates a cue for managing in a cue grid. show-key will be used as the effect keyword when the cue is triggered to add it to a show, ending any existing effect that was using that key. effect-fn is a function that will be called to obtain the effect to be started and monitored when this cue is triggered. It will be passed a map allowing lookup of any temporary variables introduced by the cue (see the :variables parameter below).

If supplied, :short-name identifies a compact, user-oriented name to be displayed in the web interface or controller display (if it has one) to help identify the cue, which can be helpful if the name of the underlying effect is ambiguous or overly long.

:color requests that the web interface and control surfaces draw the cue using the specified color rather than the default white to help the user identify it. This is only a request, as not all control surfaces support all (or any) colors. The color is passed to interpret-color, so it can be specified in a variety of ways. If omitted, a default color of white is used.

:color-fn, if present, is a function that will be called to determine the current color to be used in user interfaces for cues that have variable colors. This function will be called with the cue, the currently-running effect launched by that cue (if any), as returned by show/find-effect, the show, and metronome snapshot representing the time at which the user interface is being updated. If it returns a value, that will be used rather than the static color in :color. If it returns nil, :color is used instead. As with :color, the presence of this function is only a request, not all user interfaces support dynamic cue colors.

@@ -44,8 +44,8 @@

:velocity accompanied by a true value enables the variable to be set by strike pressure and adjusted by aftertouch pressure while the pad which launched the cue is held down on pressure-sensitive controllers.

  • :velocity-min and :velocity-max specify the range into which MIDI velocity and aftertouch values will be mapped, if they are present. Otherwise the standard :min and :max values will be used.

  • -

    current-cue-color

    (current-cue-color cue active show snapshot)

    Given a cue, an active effect map, and a metronome snapshot representing the moment for which the user interface is being rendered, return the color with which the cue should be rendered on a cue grid. If the cue is not currently running, active should be nil. Handles the delegation to the cue’s dynamic color function if one has been assigned. Useful dynamic color functions are built by color-fn-from-cue-var and color-fn-from-param.

    find-cue-variable-keyword

    (find-cue-variable-keyword cue var-spec & {:keys [show when-id]})

    Finds the keyword by which a cue variable is accessed; it may be directly bound to a show variable, or may be a temporary variable introduced for the cue, whose name needs to be looked up in the running effect’s variable map. If a temporary variable, the id of the effect which is expected to be running for the cue must be passed with :when-id, and this id must match the id of the actual effect currently running under that key, or nil will be returned.

    -

    If a show is passed with the :show optional keyword argument, the effect is looked up in that show. Otherwise, it is looked up in the default show.

    function-cue

    (function-cue show-key function fixtures & {:keys [level htp? effect-name short-name color color-fn end-keys priority held velocity velocity-min velocity-max], :or {color :white, level 0, priority 0}})

    Creates a cue that applies the specified function to the supplied fixtures or heads. Automatically adds a temporary variable for adjusting the function value if the function is not fixed over its range. show-key will be used as the effect keyword when the cue is triggered to add it to a show, ending any existing effect that was using that key. function identifies the fixture function to be activated by this cue, and fixtures lists the fixtures and heads can which should be affected (though only fixtures and heads which implement the specified function will actually participate).

    +

    current-cue-color

    (current-cue-color cue active show snapshot)

    Given a cue, an active effect map, and a metronome snapshot representing the moment for which the user interface is being rendered, return the color with which the cue should be rendered on a cue grid. If the cue is not currently running, active should be nil. Handles the delegation to the cue’s dynamic color function if one has been assigned. Useful dynamic color functions are built by color-fn-from-cue-var and color-fn-from-param.

    find-cue-variable-keyword

    (find-cue-variable-keyword cue var-spec & {:keys [show when-id]})

    Finds the keyword by which a cue variable is accessed; it may be directly bound to a show variable, or may be a temporary variable introduced for the cue, whose name needs to be looked up in the running effect’s variable map. If a temporary variable, the id of the effect which is expected to be running for the cue must be passed with :when-id, and this id must match the id of the actual effect currently running under that key, or nil will be returned.

    +

    If a show is passed with the :show optional keyword argument, the effect is looked up in that show. Otherwise, it is looked up in the default show.

    function-cue

    (function-cue show-key function fixtures & {:keys [level htp? effect-name short-name color color-fn end-keys priority held velocity velocity-min velocity-max], :or {color :white, level 0, priority 0}})

    Creates a cue that applies the specified function to the supplied fixtures or heads. Automatically adds a temporary variable for adjusting the function value if the function is not fixed over its range. show-key will be used as the effect keyword when the cue is triggered to add it to a show, ending any existing effect that was using that key. function identifies the fixture function to be activated by this cue, and fixtures lists the fixtures and heads can which should be affected (though only fixtures and heads which implement the specified function will actually participate).

    Passing a value for :effect-name sets the name for the effect created by this cue. If none is provided, the name of the function is used.

    If supplied, :short-name identifies a compact, user-oriented name to be displayed in the web interface or controller display (if it has one) to help identify the cue, which can be helpful if the name of the underlying effect is ambiguous or overly long.

    :color requests that the web interface and control surfaces draw the cue using the specified color rather than the default white to help the user identify it. This is only a request, as not all control surfaces support all (or any) colors. The color is passed to interpret-color, so it can be specified in a variety of ways.

    @@ -54,9 +54,9 @@

    :end-keys introduces a sequence of keywords identifying other effects which should be ended whenever this one is started. This allows a set of grid cues to be set up as mutually exclusive, even if they use different keywords within the show for other reasons.

    :priority assigns a sorting priority to the effect. If not assigned, a default priority of zero is used. The effect will be added to the show after any effects of equal or lower priority, but before any with higher priority. Effects are run in order, and later effects can override earlier ones if they are trying to affect the same things, so a higher priority and more recent effect wins.

    If :held is passed with a true value, then the cue will be active only as long as the corresponding pad or button on the control surface is held down, for controllers which support this feature. This can be useful for very intense cues like strobes. Show operators can override the :held flag by holding down the Shift key when triggering the cue on interfaces which have Shift keys, like the web interface and Ableton Push.

    -

    If the function being controlled has a variable effect, and thus a cue variable is being introduced to adjust it, :velocity, :velocity-min, and :velocity-max will be used when creating that variable, allowing it to be controlled by strike and aftertouch pressure on control surfaces which support that feature, as described in cue.

    get-cue-variable

    (get-cue-variable cue var-spec & {:keys [show when-id]})

    Finds the current value of the supplied cue variable, which may be directly bound to a show variable, or may be a temporary variable introduced for the cue, whose name needs to be looked up in the running effect’s variable map. If a temporary variable, the id of the effect which is expected to be running for the cue must be passed with :when-id, and this id must match the id of the actual effect currently running under that key, or nil will be returned.

    +

    If the function being controlled has a variable effect, and thus a cue variable is being introduced to adjust it, :velocity, :velocity-min, and :velocity-max will be used when creating that variable, allowing it to be controlled by strike and aftertouch pressure on control surfaces which support that feature, as described in cue.

    get-cue-variable

    (get-cue-variable cue var-spec & {:keys [show when-id]})

    Finds the current value of the supplied cue variable, which may be directly bound to a show variable, or may be a temporary variable introduced for the cue, whose name needs to be looked up in the running effect’s variable map. If a temporary variable, the id of the effect which is expected to be running for the cue must be passed with :when-id, and this id must match the id of the actual effect currently running under that key, or nil will be returned.

    Permanent variables associated with the cue can always be retrieved by omitting :with-id. If you want to only get the variable when a particular effect is running, however, you can do so by passing in that effect’s id with :with-id, and the same restriction will then be applied as is for temporary variables.

    -

    If a show is passed with the :show optional keyword argument, the effect is looked up in that show. Otherwise, it is looked up in the default show.

    remove-midi-control-to-cue-mapping

    deprecated in 0.2.0

    (remove-midi-control-to-cue-mapping device-filter channel kind note x y f)

    Deprecated in favor of the more accurately named remove-midi-to-cue-mapping.

    remove-midi-to-cue-mapping

    (remove-midi-to-cue-mapping device-filter channel kind note x y f)

    Stop triggering the specified cue from the *show* cue grid upon receipt of the specified note or controller-change message. The desired cue is identified by passing in its x and y coordinates within the show cue grid. f is the handler function that was returned by add-midi-to-cue-mapping when the mapping was established.

    set-cue-variable!

    (set-cue-variable! cue var-spec value & {:keys [show when-id]})

    Sets the current value of the supplied cue variable, which may be directly bound to a show variable, or may be a temporary variable introduced for the cue, whose name needs to be looked up in the running effect’s variable map. If a temporary variable, the id of the effect which is expected to be running for the cue must be passed with :when-id, and this id must match the id of the actual effect currently running under that key, or nothing will be set.

    +

    If a show is passed with the :show optional keyword argument, the effect is looked up in that show. Otherwise, it is looked up in the default show.

    remove-midi-control-to-cue-mapping

    deprecated in 0.2.0

    (remove-midi-control-to-cue-mapping device-filter channel kind note x y f)

    Deprecated in favor of the more accurately named remove-midi-to-cue-mapping.

    remove-midi-to-cue-mapping

    (remove-midi-to-cue-mapping device-filter channel kind note x y f)

    Stop triggering the specified cue from the *show* cue grid upon receipt of the specified note or controller-change message. The desired cue is identified by passing in its x and y coordinates within the show cue grid. f is the handler function that was returned by add-midi-to-cue-mapping when the mapping was established.

    set-cue-variable!

    (set-cue-variable! cue var-spec value & {:keys [show when-id]})

    Sets the current value of the supplied cue variable, which may be directly bound to a show variable, or may be a temporary variable introduced for the cue, whose name needs to be looked up in the running effect’s variable map. If a temporary variable, the id of the effect which is expected to be running for the cue must be passed with :when-id, and this id must match the id of the actual effect currently running under that key, or nothing will be set.

    Permanent variables associated with the cue can always be set by omitting :with-id. If you want to only affect the variable when a particular effect is running, however, you can do so by passing in that effect’s id with :with-id, and the same restriction will then be applied as is for temporary variables.

    -

    If a show is passed with the :show optional keyword argument, the effect is looked up in that. Otherwise, it is looked up in the default show.

    snapshot-cue-variables

    (snapshot-cue-variables cue when-id & {:keys [show]})

    Returns a map containing the keys and current values of all variables used by the specified cue, which is suitable for saving via save-cue-vars!. The id of the effect currently running the cue must be passed as when-id to ensure that the cue is still running. If it is not running (or ends while the variable values are being looked up), nil is returned.

    -

    If a show is passed with the :show optional keyword argument, the effect is looked up in that show. Otherwise, it is looked up in the default show.

    \ No newline at end of file +

    If a show is passed with the :show optional keyword argument, the effect is looked up in that. Otherwise, it is looked up in the default show.

    snapshot-cue-variables

    (snapshot-cue-variables cue when-id & {:keys [show]})

    Returns a map containing the keys and current values of all variables used by the specified cue, which is suitable for saving via save-cue-vars!. The id of the effect currently running the cue must be passed as when-id to ensure that the cue is still running. If it is not running (or ends while the variable values are being looked up), nil is returned.

    +

    If a show is passed with the :show optional keyword argument, the effect is looked up in that show. Otherwise, it is looked up in the default show.

    \ No newline at end of file diff --git a/api-doc/afterglow.effects.dimmer.html b/api-doc/afterglow.effects.dimmer.html index d4617508..f6897e81 100644 --- a/api-doc/afterglow.effects.dimmer.html +++ b/api-doc/afterglow.effects.dimmer.html @@ -1,8 +1,8 @@ -afterglow.effects.dimmer documentation

    afterglow.effects.dimmer

    Effects pipeline functions for working with dimmer channels for fixtures and heads. Dimmer effects are always tied to a master chain, which can scale back the maximum allowable value for that dimmer channel, as a percentage. Unless otherwise specified, the dimmer cue will be attached to the show grand master, but you can create other masters to adjust the brightness of groups of fixtures, perhaps because they are intrinsically brighter, or to adjust the balance of lighting for artistic reasons. Secondary masters can be chained to each other, and are always chained to the show grand master, so turning that down will dim the entire show; setting it to zero will black out the show.

    +afterglow.effects.dimmer documentation

    afterglow.effects.dimmer

    Effects pipeline functions for working with dimmer channels for fixtures and heads. Dimmer effects are always tied to a master chain, which can scale back the maximum allowable value for that dimmer channel, as a percentage. Unless otherwise specified, the dimmer cue will be attached to the show grand master, but you can create other masters to adjust the brightness of groups of fixtures, perhaps because they are intrinsically brighter, or to adjust the balance of lighting for artistic reasons. Secondary masters can be chained to each other, and are always chained to the show grand master, so turning that down will dim the entire show; setting it to zero will black out the show.

    This master scaling capability is so useful that you will almost always want a prominent fader on a MIDI controller tied to the show grand master, and possibly others to secondary masters. show/add-midi-control-to-master-mapping makes that easy, especially for the grand master, and for submasters stored in show variables, which can be referred to by their keywords.

    -

    Some fixtures have damping functions that slow down their dimmer response, so you may not get the kind of coordination you would like from oscillated dimmer cues. A potential workaround is to use the dimmer channels as a maximum brightness level to allow tweaking the overall brightness of an effect, and using the lightness attribute of a color cue to create time-varying brightness effects.

    ->Master

    (->Master level parent)

    Positional factory function for class afterglow.effects.dimmer.Master.

    dimmer-channel?

    (dimmer-channel? c)

    Returns true if the supplied channel is a dimmer.

    dimmer-effect

    (dimmer-effect level fixtures & {:keys [htp? master effect-name add-virtual-dimmers?], :or {htp? true, master (:grand-master *show*)}})

    Returns an effect which assigns a dynamic value to all the supplied dimmers. If a true value is passed for :htp?, applies highest-takes-precedence (i.e. compares the value to the previous assignment for the channel, and lets the highest value remain).

    +

    Some fixtures have damping functions that slow down their dimmer response, so you may not get the kind of coordination you would like from oscillated dimmer cues. A potential workaround is to use the dimmer channels as a maximum brightness level to allow tweaking the overall brightness of an effect, and using the lightness attribute of a color cue to create time-varying brightness effects.

    ->Master

    (->Master level parent)

    Positional factory function for class afterglow.effects.dimmer.Master.

    dimmer-channel?

    (dimmer-channel? c)

    Returns true if the supplied channel is a dimmer.

    dimmer-effect

    (dimmer-effect level fixtures & {:keys [htp? master effect-name add-virtual-dimmers?], :or {htp? true, master (:grand-master *show*)}})

    Returns an effect which assigns a dynamic value to all the supplied dimmers. If a true value is passed for :htp?, applies highest-takes-precedence (i.e. compares the value to the previous assignment for the channel, and lets the highest value remain).

    All dimmer cues are associated with a master chain which can scale down the values to which they are set. If none is supplied when creating the dimmer cue, the show’s grand master is used.

    Dimmers are either a channel fully dedicated to dimming, identified by the channel :type of :dimmer, or a dimmer function range defined over only part of a multi-purpose channel, where the function :type is :dimmer, and the channel :type must be something else. A single head cannot have both types of dimmer, since a function can only exist on one channel in a given head.

    -

    If you have any fixtures that are capable of RGB color mixing, but lack dedicated dimmer channels, you can have this effect simulate a dimmer channel for those fixtures by passing a true value with add-virtual-dimmers?. The virtual dimmer works by modifying any color effect that has already run for those fixtures, to reduce the brightness of the color being assigned. To do that, this dimmer effect needs to run at a higher effect priority than any color effect you want it to modify, so be sure to add it to your show with an appropriate priority value. Virtual dimmers are incompatible with hightest-takes-precedence dimming, because there is no actual previous dimmer value for them to work with, so you cannot use both htp? and add-virtual-dimmers at the same time.

    gather-dimmer-channels

    (gather-dimmer-channels fixtures)

    Finds all channels in the supplied fixture list which are dimmers, even if they are inside heads.

    gather-no-dimmer-rgb-heads

    (gather-no-dimmer-rgb-heads fixtures)

    Finds all the RGB heads from the supplied fixture list which have no dimmer capability at either the head or fixture level. These heads are suitable for creating virtual dimmer effects when desired.

    gather-partial-dimmer-function-heads

    (gather-partial-dimmer-function-heads fixtures)

    Find all heads in the supplied fixture list which contain multipurpose channels that are partially used for dimming, rather than full dedicated dimmer channels.

    IDimmerMaster

    protocol

    A chainable limiter of dimmer cues.

    members

    master-get-level

    (master-get-level master)

    Get the level of this master, as a percentage from 0 to 100. Any value less than 100 will cause the dimmer cues attached to this master to have their levels scaled back by that amount. If there are any parent masters attached to this one, they may further scale back the value in turn.

    master-scale

    (master-scale master value)

    Scale down the value being sent to a dimmer according to this master level, and any parent masters associated with it.

    master-set-level

    (master-set-level master new-level)

    Set the level of this master, as a percentage from 0 to 100. Any value less than 100 will cause the dimmer cues attached to this master to have their levels scaled back by that amount. If there are any parent masters attached to this one, they may further scale back the value in turn.

    map->Master

    (map->Master m__6522__auto__)

    Factory function for class afterglow.effects.dimmer.Master, taking a map of keywords to field values.

    master

    (master show & {:keys [level parent], :or {level 100, parent (:grand-master show)}})

    Create a master for scaling dimmer cues. If you set its level to less than 100 (interpreted as a percentage), all dimmer cues created with this master will be scaled back appropriately. If you supply a parent master, it will get a chance to scale them back as well. If you don’t, the show’s grand master is used as the parent master.

    \ No newline at end of file +

    If you have any fixtures that are capable of RGB color mixing, but lack dedicated dimmer channels, you can have this effect simulate a dimmer channel for those fixtures by passing a true value with add-virtual-dimmers?. The virtual dimmer works by modifying any color effect that has already run for those fixtures, to reduce the brightness of the color being assigned. To do that, this dimmer effect needs to run at a higher effect priority than any color effect you want it to modify, so be sure to add it to your show with an appropriate priority value. Virtual dimmers are incompatible with hightest-takes-precedence dimming, because there is no actual previous dimmer value for them to work with, so you cannot use both htp? and add-virtual-dimmers at the same time.

    gather-dimmer-channels

    (gather-dimmer-channels fixtures)

    Finds all channels in the supplied fixture list which are dimmers, even if they are inside heads.

    gather-no-dimmer-rgb-heads

    (gather-no-dimmer-rgb-heads fixtures)

    Finds all the RGB heads from the supplied fixture list which have no dimmer capability at either the head or fixture level. These heads are suitable for creating virtual dimmer effects when desired.

    gather-partial-dimmer-function-heads

    (gather-partial-dimmer-function-heads fixtures)

    Find all heads in the supplied fixture list which contain multipurpose channels that are partially used for dimming, rather than full dedicated dimmer channels.

    IDimmerMaster

    protocol

    A chainable limiter of dimmer cues.

    members

    master-get-level

    (master-get-level master)

    Get the level of this master, as a percentage from 0 to 100. Any value less than 100 will cause the dimmer cues attached to this master to have their levels scaled back by that amount. If there are any parent masters attached to this one, they may further scale back the value in turn.

    master-scale

    (master-scale master value)

    Scale down the value being sent to a dimmer according to this master level, and any parent masters associated with it.

    master-set-level

    (master-set-level master new-level)

    Set the level of this master, as a percentage from 0 to 100. Any value less than 100 will cause the dimmer cues attached to this master to have their levels scaled back by that amount. If there are any parent masters attached to this one, they may further scale back the value in turn.

    map->Master

    (map->Master m__6522__auto__)

    Factory function for class afterglow.effects.dimmer.Master, taking a map of keywords to field values.

    master

    (master show & {:keys [level parent], :or {level 100, parent (:grand-master show)}})

    Create a master for scaling dimmer cues. If you set its level to less than 100 (interpreted as a percentage), all dimmer cues created with this master will be scaled back appropriately. If you supply a parent master, it will get a chance to scale them back as well. If you don’t, the show’s grand master is used as the parent master.

    \ No newline at end of file diff --git a/api-doc/afterglow.effects.fun.html b/api-doc/afterglow.effects.fun.html index a4a2785e..d92f2e18 100644 --- a/api-doc/afterglow.effects.fun.html +++ b/api-doc/afterglow.effects.fun.html @@ -1,30 +1,30 @@ -afterglow.effects.fun documentation

    afterglow.effects.fun

    A collection of neat effects that are both useful in shows, and examples of how to create such things.

    adjust-strobe

    (adjust-strobe)

    An auxiliary effect which creates no assigners to directly affect lights, but adjusts show variables used by the strobe effect. It is designed to be run as a parallel cue to offer the user controls for adjusting the hue and saturation of any active strobes.

    aim-fan

    (aim-fan fixtures & {:keys [x y z x-scale y-scale effect-name], :or {x 0.0, y 0.0, z 5.0, x-scale 1.0, y-scale 1.0, effect-name "Aim Fan"}})

    Creates an aim effect which aims the lights outward around a reference point specified by :x, :y, and :z, which defaults to (0, 0, 5), by first aiming the lights at the reference point, and then adding on the distance within the x-y plane from the fixture to that point, multiplied by :x-scale and :y-scale, which each default to 1. A scale of 0 would aim the lights straight forward. Positive values fan them out, while negative values overshoot the reference point in the other direction, fanning them in. All parameters other than fixtures can be dynamic or keywords, which will be bound to show variables.

    -

    You can override the default effect name of Aim Fan by passing in another with :effect-name.

    bloom

    (bloom fixtures & {:keys [color fraction measure], :or {:color (colors/create-color :white), :fraction 0, :measure (transform/build-distance-measure 0 0 0)}})

    An effect which causes a color (which defaults to white) to spread from a point across a set of lights, controlled by a fraction from 0 to 1. The spread is defined by a distance measure (as created by build-distance-measure), which defaults to a sphere starting at the origin. For efficiency, the measure cannot be frame dynamic, and is evaluated when the effect is created.

    color-cycle-chase

    (color-cycle-chase fixtures measure & {:keys [color-cycle color-index-function transition-phase-function effect-name], :or {color-cycle default-color-cycle, color-index-function rhythm/snapshot-bar-within-phrase, transition-phase-function transition-during-down-beat, effect-name "Phrase Color Cycle"}})

    Returns an effect which moves through a color cycle over a period of time (by default changing each bar of a phrase), performing a transition as a new color is introduced, using the specified distance measure to determine when each light starts to participate. By default the transition occurs over the down beat (first beat) of the bar. See below for how these defaults can be changed.

    +afterglow.effects.fun documentation

    afterglow.effects.fun

    A collection of neat effects that are both useful in shows, and examples of how to create such things.

    adjust-strobe

    (adjust-strobe)

    An auxiliary effect which creates no assigners to directly affect lights, but adjusts show variables used by the strobe effect. It is designed to be run as a parallel cue to offer the user controls for adjusting the hue and saturation of any active strobes.

    aim-fan

    (aim-fan fixtures & {:keys [x y z x-scale y-scale effect-name], :or {x 0.0, y 0.0, z 5.0, x-scale 1.0, y-scale 1.0, effect-name "Aim Fan"}})

    Creates an aim effect which aims the lights outward around a reference point specified by :x, :y, and :z, which defaults to (0, 0, 5), by first aiming the lights at the reference point, and then adding on the distance within the x-y plane from the fixture to that point, multiplied by :x-scale and :y-scale, which each default to 1. A scale of 0 would aim the lights straight forward. Positive values fan them out, while negative values overshoot the reference point in the other direction, fanning them in. All parameters other than fixtures can be dynamic or keywords, which will be bound to show variables.

    +

    You can override the default effect name of Aim Fan by passing in another with :effect-name.

    bloom

    (bloom fixtures & {:keys [color fraction measure], :or {:color (colors/create-color :white), :fraction 0, :measure (transform/build-distance-measure 0 0 0)}})

    An effect which causes a color (which defaults to white) to spread from a point across a set of lights, controlled by a fraction from 0 to 1. The spread is defined by a distance measure (as created by build-distance-measure), which defaults to a sphere starting at the origin. For efficiency, the measure cannot be frame dynamic, and is evaluated when the effect is created.

    color-cycle-chase

    (color-cycle-chase fixtures measure & {:keys [color-cycle color-index-function transition-phase-function effect-name], :or {color-cycle default-color-cycle, color-index-function rhythm/snapshot-bar-within-phrase, transition-phase-function transition-during-down-beat, effect-name "Phrase Color Cycle"}})

    Returns an effect which moves through a color cycle over a period of time (by default changing each bar of a phrase), performing a transition as a new color is introduced, using the specified distance measure to determine when each light starts to participate. By default the transition occurs over the down beat (first beat) of the bar. See below for how these defaults can be changed.

    The distance measure supplied as the second argument is a function which accepts a fixture or head and returns a nonnegative value which controls the point during the transition when that head will change from the old color to the new color. A fixture returning a value of 0 will change as soon as transition has started, and the fixture(s) that return the largest value will change when the transition ends. A value halfway between zero and the largest value would mean the color of that fixture or head would change exactly at the midpoint of the transition. Many interesting looking transtitions can be created using distance measures constructed by calling afterglow.transform/build-distance-measure, as is done by iris-out-color-cycle-chase and several examples which follow it. There are lots of other kinds of functions which can created, though; at the opposite extreme you can do completely arbitrary things like assigning each head a random “distance” when the effect is created.

    The sequence of colors which are cycled through can be changed by passing in a vector with :color-cycle. Each value in the vector can either be a color object, or a dynamic parameter which resolves to a color object when the effect is running. As ususal, you can bind to show variables containing a color by passing the variable names as keywords within the vector.

    When the effect is being rendered, the current color index within :color-cycle is determined by calling a function with the snapshot obtained from the show metronome at the start of the rendering frame. The default function, afterglow.rhythm/snapshot-bar-within-phrase, will assign a different color for each bar of a phrase. (If there are not enough colors in :color-cycle the cycle is repeated as necessary.) You can pass another index function with :color-index-function to change how and when the cycle is traversed.

    The function supplied with :transition-phase-function determines precisely when the transition takes place and how quickly it occurs. It is also called with the show metronome snapshot, and if the value it returns is less than zero, the transition is considered not to have started yet, and no fixtures will be assigned the current color. Values between zero and one mean the transition is in progress, and lights whose distance measure divided by the largest distance measure is less than or equal to the current phase will change color. Once the transition phase reaches one (or greater), the transition is complete, and all lights will be assigned the color associated with the current cycle index. The default transition phase function, transition-during-down-beat, causes the transition to be spread over the down beat of each bar. Passing rhythm/snapshot-bar-phase instead would spread the transition over the entire bar, so that transitions would be feeding right into each other. Other possibilities are limited only by your imagination. The transition can run backwards; it can pause or reverse directions multiple times; it does not even necessarily have to happen only once during each index value. This means that if you want to reverse the direction of a transition which lasts for the entire duration of a cycle index value, you can do it by reversing either the distance measure or the phase function, whichever is easier. (If the transition is shorter than the time over which the :color-index-function changes, you will want to reverse the distance measure rather than the phase function, because otherwise the order in which the colors appear will be strange.)

    -

    To give your running effect a meaningful name within user interfaces, pass a short and descriptive value with :effect-name.

    confetti

    (confetti fixtures & {:keys [step min-added max-added min-duration max-duration min-saturation aim? min-x max-x min-y max-y min-z max-z], :or {min-x -5.0, aim? false, step (params/build-step-param), max-z 5.0, min-saturation 100.0, min-added 1, min-z 0.5, max-added 4, max-x 5.0, min-y 0.0, min-duration 2, max-duration 4, max-y 0.0}})

    A random color effect, which assigns a new random color to a random selection of the supplied fixture heads each time a step parameter changes value. That color lasts a random number of steps.

    +

    To give your running effect a meaningful name within user interfaces, pass a short and descriptive value with :effect-name.

    confetti

    (confetti fixtures & {:keys [step min-added max-added min-duration max-duration min-saturation aim? min-x max-x min-y max-y min-z max-z], :or {min-x -5.0, aim? false, step (params/build-step-param), max-z 5.0, min-saturation 100.0, min-added 1, min-z 0.5, max-added 4, max-x 5.0, min-y 0.0, min-duration 2, max-duration 4, max-y 0.0}})

    A random color effect, which assigns a new random color to a random selection of the supplied fixture heads each time a step parameter changes value. That color lasts a random number of steps.

    The step parameter defaults to one which changes each beat, buy you can supply your own with the optional keyword argument :step. Its value will be rounded to the nearest integer when checking for changes, so fades are ignored.

    The minimum and maximum number of heads to assign colors on each step default to 1 and 4, and can be adjusted with :min-added and :max-added. The minimum and maximum number of steps that each assignment will last default to 4 and 8, and can be adjusted with :min-duration and :max-duration.

    By default, colors chosen are always fully saturated, but you can pass a percentage with :min-saturation and a random saturation value between that and 100% will be chosen for each head.

    When generating a new set of confetti flakes, if more than one head is chosen, they will all be assigned a color of the same hue, but may each get individual random saturations. The duration of the flake on each head will also be individually randomly assigned.

    In addition to assigning colors, flakes can also aim the lights at a particular point. To activate this, pass a true value with :aim?. By default the aiming points will be randomly generated to be on the floor from half a meter to five meters in front of the rig, and with x values ranging from -5 to 5 meters, but you can adjust the space from which they are chosen by passing values with :min-x, :max-x, :min-y, :max-y, :min-z, and max-z.

    -

    All parameters after fixtures may be dynamic, including show variables with the standard shorthand of passing the variable name as a keyword. Since step, :min-added, :max-added, aim?, and the boundaries of the aiming space are not associated with a specific head, they cannot be spatial parameters. The other parameters can be, however, so saturations and durations can vary over the ligthing rig.

    default-color-cycle

    The default list of colors to cycle through for the color-cycle-chase.

    default-down-beat-color

    The default color for metronome-effect to flash on the down beats.

    default-other-beat-color

    The default color for metronome-effect to flash on beats that are not down beats.

    default-pinstripe-colors

    The set of colors that will be used by a pinstripe effect if no :colors parameter is supplied.

    default-sparkle-color

    The default color for the sparkle effect.

    dimmer-sparkle

    (dimmer-sparkle fixtures & {:keys [chance fade-time master include-rgb-fixtures?], :or {chance 0.001, fade-time 500, master (:grand-master *show*), include-rgb-fixtures? false}})

    A variation of the sparkle effect which uses dimmer channels, instead of RGB color mixing, for fixtures that lack such capability. Note that some fixtures may have dimmers that do not respond quickly enough for this to work well; you will have to try it and see.

    +

    All parameters after fixtures may be dynamic, including show variables with the standard shorthand of passing the variable name as a keyword. Since step, :min-added, :max-added, aim?, and the boundaries of the aiming space are not associated with a specific head, they cannot be spatial parameters. The other parameters can be, however, so saturations and durations can vary over the ligthing rig.

    default-color-cycle

    The default list of colors to cycle through for the color-cycle-chase.

    default-down-beat-color

    The default color for metronome-effect to flash on the down beats.

    default-other-beat-color

    The default color for metronome-effect to flash on beats that are not down beats.

    default-pinstripe-colors

    The set of colors that will be used by a pinstripe effect if no :colors parameter is supplied.

    default-sparkle-color

    The default color for the sparkle effect.

    dimmer-sparkle

    (dimmer-sparkle fixtures & {:keys [chance fade-time master include-rgb-fixtures?], :or {chance 0.001, fade-time 500, master (:grand-master *show*), include-rgb-fixtures? false}})

    A variation of the sparkle effect which uses dimmer channels, instead of RGB color mixing, for fixtures that lack such capability. Note that some fixtures may have dimmers that do not respond quickly enough for this to work well; you will have to try it and see.

    As each frame of DMX values generated, each participating fixture head has a chance of being assigned a sparkle (this chance is controlled by the optional keyword parameter :chance). Once a sparkle has been created, it will fade out over the number of milliseconds specified by the optional keyword parameter :fade-time.

    As with other dimmer effects, the maximum level to which the dimmer can be set is limited by a dimmer master chain. You can pass one in explicitly with :master. If you do not, the show’s grand master is used.

    -

    By default this effect ignores fixtures that can perform RGB color mixing, because you are better off using the regular sparkle effect with them. But if for some reason you want it to affect their dimmers as well, you can pass a true value with :include-rgb-fixtures?.

    iris-out-color-cycle-chase

    (iris-out-color-cycle-chase fixtures & {:keys [center color-cycle color-index-function transition-phase-function effect-name], :or {color-cycle default-color-cycle, color-index-function rhythm/snapshot-bar-within-phrase, transition-phase-function transition-during-down-beat, effect-name "Iris Out"}})

    Returns an effect which changes the color of a group of fixture heads on the down beat of each bar of a phrase, expanding the color from the center of the show x-y plane outwards during the down beat.

    +

    By default this effect ignores fixtures that can perform RGB color mixing, because you are better off using the regular sparkle effect with them. But if for some reason you want it to affect their dimmers as well, you can pass a true value with :include-rgb-fixtures?.

    iris-out-color-cycle-chase

    (iris-out-color-cycle-chase fixtures & {:keys [center color-cycle color-index-function transition-phase-function effect-name], :or {color-cycle default-color-cycle, color-index-function rhythm/snapshot-bar-within-phrase, transition-phase-function transition-during-down-beat, effect-name "Iris Out"}})

    Returns an effect which changes the color of a group of fixture heads on the down beat of each bar of a phrase, expanding the color from the center of the show x-y plane outwards during the down beat.

    Unless otherwise specified by passing an explicit pair of x and y coordinates with :center (e.g. :center [0.0 0.0]), the starting point of the transition will be the x-y center of the bounding box of the fixtures participating in it (the smallest box containing all of their heads).

    -

    You can change the colors used, and when transitions occur, by overriding the default values associated with the optional keyword arguments :color-cycle, :color-index-function, and :transition-phase-function. For details about how these are interpreted, see color-cycle-chase which is used to implement this chase.

    metronome-effect

    (metronome-effect fixtures & {:keys [down-beat-color other-beat-color metronome], :or {down-beat-color default-down-beat-color, other-beat-color default-other-beat-color, metronome (:metronome *show*)}})

    Returns an effect which flashes the supplied fixtures to the beats of the show metronome, emphasizing the down beat, which is a great way to test and understand metronome synchronization. The color of the flashes can be controlled by the :down-beat-color and :other-beat-color optional keyword arguments (defaulting to red with lightness 70, and yellow with lightness 20, respectively).

    -

    This is no longer as useful as it used to be before there were metronome adjustment interfaces in the Ableton Push and then web interfaces, but is still an example of how to write a metronome driven effect, and can be synchronized to metronomes other than the default show metronome by passing them in with optional keyword argument :metronome.

    pinstripes

    (pinstripes fixtures & {:keys [step tolerance colors], :or {step (params/build-step-param), tolerance 0, colors default-pinstripe-colors}})

    A color effect which divides the lights into alternating columns by their x positions (with configurable tolerance, defaulting to requiring exact equality), and assigns a color to each column. The colors rotate according to a step parameter.

    +

    You can change the colors used, and when transitions occur, by overriding the default values associated with the optional keyword arguments :color-cycle, :color-index-function, and :transition-phase-function. For details about how these are interpreted, see color-cycle-chase which is used to implement this chase.

    metronome-effect

    (metronome-effect fixtures & {:keys [down-beat-color other-beat-color metronome], :or {down-beat-color default-down-beat-color, other-beat-color default-other-beat-color, metronome (:metronome *show*)}})

    Returns an effect which flashes the supplied fixtures to the beats of the show metronome, emphasizing the down beat, which is a great way to test and understand metronome synchronization. The color of the flashes can be controlled by the :down-beat-color and :other-beat-color optional keyword arguments (defaulting to red with lightness 70, and yellow with lightness 20, respectively).

    +

    This is no longer as useful as it used to be before there were metronome adjustment interfaces in the Ableton Push and then web interfaces, but is still an example of how to write a metronome driven effect, and can be synchronized to metronomes other than the default show metronome by passing them in with optional keyword argument :metronome.

    pinstripes

    (pinstripes fixtures & {:keys [step tolerance colors], :or {step (params/build-step-param), tolerance 0, colors default-pinstripe-colors}})

    A color effect which divides the lights into alternating columns by their x positions (with configurable tolerance, defaulting to requiring exact equality), and assigns a color to each column. The colors rotate according to a step parameter.

    The step parameter defaults to one which changes abruptly on each beat, but you can supply your own with the optional keyword argument :step. Fades between colors can be achieved by passing a step parameter that fades.

    The tolerance used when grouping the heads into stripes is controlled by the optional parameter :tolerance, which defaults to zero, meaning the heads must have the exact same x value to get assigned to the same stripe. The assignment of heads into stripes is done when the effect is created, so if the tolerance changes after that, it will have no effect.

    The colors themselves are passed as a sequence with :colors and default to red and white. The list of colors you supply can be of any length. Although the colors within the list themselves can be dynamic parameters, the conntent of the list is evaluated when the effect is created, so the number of colors and the color parameters themselves are fixed at that time.

    -

    The :step, :tolerance, and :colors parameters may be dynamic, (and may be bound to show variables using the standard shorthand of passing the variable name as a keyword). Since :step and :tolerance are not associated with a specific head, they cannot be a spatial parameters. The colors can be, however, so for example saturations can vary over the rig.

    random-beat-number-param

    (random-beat-number-param & {:keys [min max min-change], :or {min 0, max 255, min-change 0}})

    Returns a dynamic number parameter which gets a new random value on each beat.

    sparkle

    (sparkle fixtures & {:keys [color chance fade-time], :or {color default-sparkle-color, chance 0.001, fade-time 500}})

    A random sparkling effect like a particle generator over the supplied fixture heads.

    -

    As each frame of DMX values generated, each participating fixture head has a chance of being assigned a sparkle (this chance is controlled by the optional keyword parameter :chance). Once a sparkle has been created, it will fade out over the number of milliseconds specified by the optional keyword parameter :fade-time. The initial color of each sparkle can be changed with the optional keyword parameter :color. All parameters may be dynamic, including show variables with the standard shorthand of passing the variable name as a keyword.

    strobe

    (strobe name fixtures level lightness)

    A compound effect which sets dimmers to the level determined by the show variable :strobe-dimmers (defaulting to 255), assigns a color based on the show variables :strobe-hue (with a default of 277, purple) :strobe-saturation (with a default of 100), and the specified lightness (which may be a dynamic parameter), with a default of 100, which would white out the hue until it was lowered. The effect then sets the fixtures’ strobe channel to the specified level, which may also be a dynamic parameter.

    -

    This is designed to be run as a high priority queue, ideally while held and with aftertouch adjusting a cue-introduced variable for level (which is used to control the strobe function of the affected fixtures, setting the strobe speed, and defaults to a middle value). The global strobe color can be adjusted via the show variables, either by aftertouch or by another effect with no assigners, like adjust-strobe.

    strobe-2

    (strobe-2 name fixtures level lightness)

    An updated version of strobe which takes advantage of the new ability to use color variables with rich user interfaces on the web and Ableton Push. A compound effect which sets dimmers to the level determined by the show variable :strobe-dimmers (defaulting to 255), assigns a color based on the show variable :strobe-color (with a default of a fully-saturated purple), and the specified lightness (which may be a dynamic parameter), with a default of 100, which would white out the hue until it was lowered. The effect then sets the fixtures’ strobe channel to the specified level, which may also be a dynamic parameter.

    -

    This is designed to be run as a high priority queue, ideally while held and with aftertouch adjusting a cue-introduced variable for level (which is used to control the strobe function of the affected fixtures, setting the strobe speed, and defaults to a middle value). The global strobe color can be adjusted via the show variables, either by aftertouch or by another effect with no assigners, like adjust-strobe.

    transition-during-down-beat

    (transition-during-down-beat snapshot)

    A transition phase function which causes the color cycle transition to occur during the down beat of each bar. See color-cycle-chase for how this is used.

    twirl

    (twirl fixtures & {:keys [x y z radius beats cycles effect-name], :or {x 0.0, y 0.0, z -2.0, radius 0.25, beats 4, cycles 1, effect-name "Twirl"}})

    Creates a direction movement effect which aims the lights outward from a point specified by :x, :y, and :z, which defaults to (0, 0, -2), then displaces the front of that vector by a distance of :radius in the x-y plane (defaulting to 0.25) in a direction which rotates around the plane driven by a sawtooth oscillator which defaults to a complete revolution every four beats, but whose beat ratio can be adjusted by the parameters :beats and :cycles, and whose phase is spread across the x axis as a spatial parameter over all fixtures. All parameters other than fixtures can be dynamic or keywords, which will be bound to show variables.

    -

    You can override the default effect name of Twirl by passing in another with :effect-name.

    wipe-right-color-cycle-chase

    (wipe-right-color-cycle-chase fixtures & {:keys [color-cycle color-index-function transition-phase-function effect-name], :or {color-cycle default-color-cycle, color-index-function rhythm/snapshot-bar-within-phrase, transition-phase-function transition-during-down-beat, effect-name "Wipe Right"}})

    Returns an effect which changes color on the down beat of each bar of a phrase, wiping the color from left to right across the show x axis.

    -

    You can change the colors used, and when transitions occur, by overriding the default values associated with the optional keyword arguments :color-cycle, :color-index-function, and :transition-phase-function. For details about how these are interpreted, see color-cycle-chase which is used to implement this chase.

    \ No newline at end of file +

    The :step, :tolerance, and :colors parameters may be dynamic, (and may be bound to show variables using the standard shorthand of passing the variable name as a keyword). Since :step and :tolerance are not associated with a specific head, they cannot be a spatial parameters. The colors can be, however, so for example saturations can vary over the rig.

    random-beat-number-param

    (random-beat-number-param & {:keys [min max min-change], :or {min 0, max 255, min-change 0}})

    Returns a dynamic number parameter which gets a new random value on each beat.

    sparkle

    (sparkle fixtures & {:keys [color chance fade-time], :or {color default-sparkle-color, chance 0.001, fade-time 500}})

    A random sparkling effect like a particle generator over the supplied fixture heads.

    +

    As each frame of DMX values generated, each participating fixture head has a chance of being assigned a sparkle (this chance is controlled by the optional keyword parameter :chance). Once a sparkle has been created, it will fade out over the number of milliseconds specified by the optional keyword parameter :fade-time. The initial color of each sparkle can be changed with the optional keyword parameter :color. All parameters may be dynamic, including show variables with the standard shorthand of passing the variable name as a keyword.

    strobe

    (strobe name fixtures level lightness)

    A compound effect which sets dimmers to the level determined by the show variable :strobe-dimmers (defaulting to 255), assigns a color based on the show variables :strobe-hue (with a default of 277, purple) :strobe-saturation (with a default of 100), and the specified lightness (which may be a dynamic parameter), with a default of 100, which would white out the hue until it was lowered. The effect then sets the fixtures’ strobe channel to the specified level, which may also be a dynamic parameter.

    +

    This is designed to be run as a high priority queue, ideally while held and with aftertouch adjusting a cue-introduced variable for level (which is used to control the strobe function of the affected fixtures, setting the strobe speed, and defaults to a middle value). The global strobe color can be adjusted via the show variables, either by aftertouch or by another effect with no assigners, like adjust-strobe.

    strobe-2

    (strobe-2 name fixtures level lightness)

    An updated version of strobe which takes advantage of the new ability to use color variables with rich user interfaces on the web and Ableton Push. A compound effect which sets dimmers to the level determined by the show variable :strobe-dimmers (defaulting to 255), assigns a color based on the show variable :strobe-color (with a default of a fully-saturated purple), and the specified lightness (which may be a dynamic parameter), with a default of 100, which would white out the hue until it was lowered. The effect then sets the fixtures’ strobe channel to the specified level, which may also be a dynamic parameter.

    +

    This is designed to be run as a high priority queue, ideally while held and with aftertouch adjusting a cue-introduced variable for level (which is used to control the strobe function of the affected fixtures, setting the strobe speed, and defaults to a middle value). The global strobe color can be adjusted via the show variables, either by aftertouch or by another effect with no assigners, like adjust-strobe.

    transition-during-down-beat

    (transition-during-down-beat snapshot)

    A transition phase function which causes the color cycle transition to occur during the down beat of each bar. See color-cycle-chase for how this is used.

    twirl

    (twirl fixtures & {:keys [x y z radius beats cycles effect-name], :or {x 0.0, y 0.0, z -2.0, radius 0.25, beats 4, cycles 1, effect-name "Twirl"}})

    Creates a direction movement effect which aims the lights outward from a point specified by :x, :y, and :z, which defaults to (0, 0, -2), then displaces the front of that vector by a distance of :radius in the x-y plane (defaulting to 0.25) in a direction which rotates around the plane driven by a sawtooth oscillator which defaults to a complete revolution every four beats, but whose beat ratio can be adjusted by the parameters :beats and :cycles, and whose phase is spread across the x axis as a spatial parameter over all fixtures. All parameters other than fixtures can be dynamic or keywords, which will be bound to show variables.

    +

    You can override the default effect name of Twirl by passing in another with :effect-name.

    wipe-right-color-cycle-chase

    (wipe-right-color-cycle-chase fixtures & {:keys [color-cycle color-index-function transition-phase-function effect-name], :or {color-cycle default-color-cycle, color-index-function rhythm/snapshot-bar-within-phrase, transition-phase-function transition-during-down-beat, effect-name "Wipe Right"}})

    Returns an effect which changes color on the down beat of each bar of a phrase, wiping the color from left to right across the show x axis.

    +

    You can change the colors used, and when transitions occur, by overriding the default values associated with the optional keyword arguments :color-cycle, :color-index-function, and :transition-phase-function. For details about how these are interpreted, see color-cycle-chase which is used to implement this chase.

    \ No newline at end of file diff --git a/api-doc/afterglow.effects.html b/api-doc/afterglow.effects.html index 9eda4649..a1e2f222 100644 --- a/api-doc/afterglow.effects.html +++ b/api-doc/afterglow.effects.html @@ -1,14 +1,14 @@ -afterglow.effects documentation

    afterglow.effects

    Support functions for building the effects pipeline.

    ->Assigner

    (->Assigner kind target-id target f)

    Positional factory function for class afterglow.effects.Assigner.

    ->Assignment

    (->Assignment kind target-id target value)

    Positional factory function for class afterglow.effects.Assignment.

    ->Effect

    (->Effect name active-fn gen-fn end-fn)

    Positional factory function for class afterglow.effects.Effect.

    always-active

    (always-active show snapshot)

    An implementation of still-active? which simply always returns true, useful for effects which run until you ask them to end.

    blank

    (blank)(blank effect-name)

    Create an effect which does nothing. This can be useful, for example, when you want to use fade to fade into an effect from a state where there was simply nothing happening (or where earlier and lower-priority effects can show through). If you want the blank effect to have a particular name, for example you are using it to set shared cue variables, you can pass a string argument.

    build-head-assigner

    (build-head-assigner kind head f)

    Returns an assigner of the specified type which applies the specified assignment function to the provided head or fixture.

    build-head-assigners

    (build-head-assigners kind heads f)

    Returns a list of assigners of the specified type which apply an assignment function to all the supplied heads or fixtures.

    build-head-parameter-assigner

    (build-head-parameter-assigner kind head param show snapshot)

    Returns an assigner of the specified kind which applies a parameter to the supplied head or fixture. If the parameter is not frame-dynamic, it gets resolved when creating this assigner. Otherwise, resolution is deferred to frame rendering time.

    build-head-parameter-assigners

    (build-head-parameter-assigners kind heads param show)

    Returns a list of assigners of the specified kind which apply a parameter to all the supplied heads or fixtures.

    chase

    (chase chase-name effects position & {:keys [beyond], :or {beyond :blank}})

    Create an effect which moves through a list of other effects based on the value of a position parameter. When position is 1, the first effect in effects is used, 2 results in the second effect, and so on. Intermediate values produce a fade between the corresponding effects. The interpretation of values less than one or greater than the number of effects in effects depends on the value passed with the optional keyword argument :beyond. The default behavior (when :beyond is omitted or passed with :blank) is to treat any numbers outside the range of elements in effects as if they refer to blank effects. This makes it easy to fade into the first effect by having position grow from 0 to 1, and to fade out of the last effect by having position grow from the number of elements in effects towards the next integer, at which point the final effect will be fully faded out. In this mode, when position resolves to a value less than zero, or greater than the number of effects in effects plus one, the chase will end. So a chase which fades in, fades between its effects, fades out, and ends, can be implemented by simply passing in a variable parameter for position which smoothly grows from zero as time goes on.

    +afterglow.effects documentation

    afterglow.effects

    Support functions for building the effects pipeline.

    ->Assigner

    (->Assigner kind target-id target f)

    Positional factory function for class afterglow.effects.Assigner.

    ->Assignment

    (->Assignment kind target-id target value)

    Positional factory function for class afterglow.effects.Assignment.

    ->Effect

    (->Effect name active-fn gen-fn end-fn)

    Positional factory function for class afterglow.effects.Effect.

    always-active

    (always-active show snapshot)

    An implementation of still-active? which simply always returns true, useful for effects which run until you ask them to end.

    blank

    (blank)(blank effect-name)

    Create an effect which does nothing. This can be useful, for example, when you want to use fade to fade into an effect from a state where there was simply nothing happening (or where earlier and lower-priority effects can show through). If you want the blank effect to have a particular name, for example you are using it to set shared cue variables, you can pass a string argument.

    build-head-assigner

    (build-head-assigner kind head f)

    Returns an assigner of the specified type which applies the specified assignment function to the provided head or fixture.

    build-head-assigners

    (build-head-assigners kind heads f)

    Returns a list of assigners of the specified type which apply an assignment function to all the supplied heads or fixtures.

    build-head-parameter-assigner

    (build-head-parameter-assigner kind head param show snapshot)

    Returns an assigner of the specified kind which applies a parameter to the supplied head or fixture. If the parameter is not frame-dynamic, it gets resolved when creating this assigner. Otherwise, resolution is deferred to frame rendering time.

    build-head-parameter-assigners

    (build-head-parameter-assigners kind heads param show)

    Returns a list of assigners of the specified kind which apply a parameter to all the supplied heads or fixtures.

    chase

    (chase chase-name effects position & {:keys [beyond], :or {beyond :blank}})

    Create an effect which moves through a list of other effects based on the value of a position parameter. When position is 1, the first effect in effects is used, 2 results in the second effect, and so on. Intermediate values produce a fade between the corresponding effects. The interpretation of values less than one or greater than the number of effects in effects depends on the value passed with the optional keyword argument :beyond. The default behavior (when :beyond is omitted or passed with :blank) is to treat any numbers outside the range of elements in effects as if they refer to blank effects. This makes it easy to fade into the first effect by having position grow from 0 to 1, and to fade out of the last effect by having position grow from the number of elements in effects towards the next integer, at which point the final effect will be fully faded out. In this mode, when position resolves to a value less than zero, or greater than the number of effects in effects plus one, the chase will end. So a chase which fades in, fades between its effects, fades out, and ends, can be implemented by simply passing in a variable parameter for position which smoothly grows from zero as time goes on.

    Of course position needs to be a dynamic parameter for the chase to progress over time; build-step-param is designed to conveniently create parameters for controlling chases in time with the show metronome. They can also be controlled by a dial on a physical controller that is bound to a show variable.

    Passing a value of :loop with the optional keyword argument :beyond causes the chase to treat effects as if it was an infinite list of copies of itself, so once the final effect is reached, the chase begins fading into the first effect again, and so on. Similarly, if position drops below 1, the chase starts fading in to the final effect. In this mode the chase continues until all of its underlying effects have ended (either on their own, or because they were asked to end by the operator), or position resolves to nil, which kills it instantly.

    Finally, passing :bounce with :beyond is similar to :loop, except that every other repetition of the list of effects is traversed in reverse order. In other words, if position keeps growing steadily in value, and there are three effects in effects, with a :beyond value of :loop you will see them in the order 1 → 2 → 3 → 1 → 2 → 3 → 1… while a value of :bounce would give you 1 → 2 → 3 → 2 → 1 → 2 → 3 → 2….

    -

    Any element of effects can be a scene, grouping many other effects, or blank, which will temporarily defer to whatever else was happening before the chase was activated.

    code

    (code f)

    An effect which simply calls a function, then ends immediately, to allow arbitrary code to be easily run from the cue grid, for example to reset the metronome if the controller mapping doesn’t have a dedicated button for that.

    +

    Any element of effects can be a scene, grouping many other effects, or blank, which will temporarily defer to whatever else was happening before the chase was activated.

    code

    (code f)

    An effect which simply calls a function, then ends immediately, to allow arbitrary code to be easily run from the cue grid, for example to reset the metronome if the controller mapping doesn’t have a dedicated button for that.

    f must be a function which takes two arguments. It will be called with the show and metronome snapshot a single time, when the effect is first launched. It must return immediately, because this is taking place on the effect rendering pipeline, so any lengthy operations must be performed on another thread.

    -

    The effect stays running until asked to end, so that grid controllers can give visual feedback that it was started, but it doesn’t do anyting more after calling the function once when it starts.

    conditional-effect

    (conditional-effect effect-name condition effect)

    Create an effect which makes the output of another effect conditional on whether a parameter has a non-zero value. Very useful when combined with variable-effect which can set that value to turn parts of a scene on or off independently. When condition has the value 0, this effect does nothing; when condition has any other value, this effect behaves exactly like the effect passed in as effect.

    end-immediately

    (end-immediately show snapshot)

    An implementation of end which just reports that the effect is now finished by returning true. Useful for effects which can simply be removed as soon as they are asked to end.

    fade

    (fade fade-name from-effect to-effect phase)

    Create an effect which fades between two other effects as the value of a parameter changes from zero to one. When phase is 0 (or less), this effect simply acts as if it were from-effect. When phase is 1 (or greater), this effect acts like to-effect. For values of phase between 0 and 1, a proportional linear blend between from-effect and to-effect is created, so that at 0.5 each effect contributes the same amount.

    +

    The effect stays running until asked to end, so that grid controllers can give visual feedback that it was started, but it doesn’t do anyting more after calling the function once when it starts.

    conditional-effect

    (conditional-effect effect-name condition effect)

    Create an effect which makes the output of another effect conditional on whether a parameter has a non-zero value. Very useful when combined with variable-effect which can set that value to turn parts of a scene on or off independently. When condition has the value 0, this effect does nothing; when condition has any other value, this effect behaves exactly like the effect passed in as effect.

    end-immediately

    (end-immediately show snapshot)

    An implementation of end which just reports that the effect is now finished by returning true. Useful for effects which can simply be removed as soon as they are asked to end.

    fade

    (fade fade-name from-effect to-effect phase)

    Create an effect which fades between two other effects as the value of a parameter changes from zero to one. When phase is 0 (or less), this effect simply acts as if it were from-effect. When phase is 1 (or greater), this effect acts like to-effect. For values of phase between 0 and 1, a proportional linear blend between from-effect and to-effect is created, so that at 0.5 each effect contributes the same amount.

    Of course phase can be a dynamic parameter; interesting results can be obtained with oscillated and variable parameters. And either or both of the effects being faded between can be a scene, grouping many other effects.

    -

    One of the effects may also be blank, which allows the other effect to be faded into or out of existence. When fading to or from a blank effect, the fade allows any previous or lower-priority effects to pass through as it approaches the blank effect. The same is true when fading between effects that do not include all the same fixtures, or affect different aspects of fixtures.

    fade-assignment

    (fade-assignment from-assignment to-assignment fraction show snapshot)

    Calculates an intermediate value between two attribute assignments of the same kind (e.g. color, direction, channel value) for an element of a light show. The values of from-assignment and to-assignment may either be instances of afterglow.effects.Assignment of the same :kind, or they may be nil, to indicate that the attribute is being faded to or from nothing. This function does the preparation and valiation needed in order to delegate safely to fade-between-assignments by promoting nil values to empty assignments of the appropriate :kind affecting the same target.

    -

    The amount contributed by each assignment is controlled by fraction, which can range from 0 (or less), meaning that only from-assignment is considered, to 1 (or greater), meaning that to-assignment is simply returned. Intermediate values will ideally result in a blend between the two assignments, with 0.5 representing an equal contribution from each. Since the value of the assignments may still be dynamic parameters, the show and snapshot might be needed to resolve them in order to calculate the blended value. Some kinds of assignment may not support blending, in which case the default implementation will simply switch from from-assignment to to-assignment once fraction reaches 0.5.

    fade-between-assignments

    multimethod

    Calculates an intermediate value between two attribute assignments of the same kind (e.g. color, direction, channel value) for an element of a light show. Most code will not call this directly, and will instead use the higher-level fade-assignment function to help set it up, or simply use a full-blown fade effect. This is the low-level mechanism which performs the fade calculations by dispatching to an appropriate implementation based on the :kind value of from-assignment, and it requires both from-assignment and to-assignment to be non-nil instances of afterglow.effects.Assignment of the same :kind.

    -

    The amount contributed by each assignment is controlled by fraction, which can range from 0 (or less), meaning that only from-assignment is considered, to 1 (or greater), meaning that to-assignment is simply returned. Intermediate values will ideally result in a blend between the two assignments, with 0.5 representing an equal contribution from each. Since the value of the assignments may still be dynamic parameters, the show and snapshot might be needed to resolve them in order to calculate the blended value. Some kinds of assignment may not support blending, in which case the default implementation will simply switch from from-assignment to to-assignment once fraction reaches 0.5.

    IAssigner

    protocol

    Assign some attribute (color, attitude, channel value) to an element of a light show at a given point in time. Any previous assignment to this element will be supplied as an argument, and may be tweaked or ignored as needs dictate. The target will be a subtree of the show’s fixtures, currently either a head or channel.

    members

    assign

    (assign this show snapshot target previous-assignment)

    Calculate the value the show element should have at this moment in time. Return a value appropriate for the kind of assignment, e.g. color object, channel value.

    IEffect

    protocol

    The effect is the basic building block of an Afterglow light show. It generates a list of assignments that should be in effect at a given moment in the show. It can end on its own, or be asked to end. When asked, it may end immediately, or after some final activity, such as a fade.

    members

    end

    (end this show snapshot)

    The effect has been asked to end. It should arrange to finish as soon as possible; return true if it can end immediately, and it will be removed from the show. Otherwise it will be allowed to continue running as it performs its graceful shutdown until still-active? reuthrns false. If the user asks to end the effect a second time during htis process, however, it will simply be removed from the show at that time.

    generate

    (generate this show snapshot)

    List the asignments needed to implement the desired effect at this moment in time. Must return a sequence of afterglow.effects.Assigner objects which will be merged into the current frame based on their kind, target, and the effect’s priority. If the effect currently has nothing to contribute, it may return an empty sequence.

    still-active?

    (still-active? this show snapshot)

    An inquiry about whether this effect is finished, and can be cleaned up. A false return value will remove the effect from the show.

    map->Assigner

    (map->Assigner m__6522__auto__)

    Factory function for class afterglow.effects.Assigner, taking a map of keywords to field values.

    map->Assignment

    (map->Assignment m__6522__auto__)

    Factory function for class afterglow.effects.Assignment, taking a map of keywords to field values.

    map->Effect

    (map->Effect m__6522__auto__)

    Factory function for class afterglow.effects.Effect, taking a map of keywords to field values.

    resolve-assignment

    multimethod

    Translates an attribute assignment (e.g. color, direction, channel value) for an element of a light show to the actual DMX values that will implement it. Since the value of the assignment may still be a dynamic parameter, the show and snapshot might be needed to resolve it.

    run-assigners

    (run-assigners show snapshot assigners)(run-assigners show snapshot assigners previous-assignment)

    Returns the final assignment value that results from iterating over an assigner list that was gathered for a particular kind and target ID, feeding each intermediate result to the next assigner in the chain.

    scene

    (scene scene-name & effects)

    Create an effect which combines multiple effects into one.

    -

    Scenes are a way to group a list of effects to run as a single effect. All of their assigners are combined into a single list, in the order in which the effects were added to the scene. Because of the way Afterglow evaluates assigners, that means that if any constituent effects try to assign to the same target, the later ones will have a chance to override or blend with the earlier ones.

    \ No newline at end of file +

    One of the effects may also be blank, which allows the other effect to be faded into or out of existence. When fading to or from a blank effect, the fade allows any previous or lower-priority effects to pass through as it approaches the blank effect. The same is true when fading between effects that do not include all the same fixtures, or affect different aspects of fixtures.

    fade-assignment

    (fade-assignment from-assignment to-assignment fraction show snapshot)

    Calculates an intermediate value between two attribute assignments of the same kind (e.g. color, direction, channel value) for an element of a light show. The values of from-assignment and to-assignment may either be instances of afterglow.effects.Assignment of the same :kind, or they may be nil, to indicate that the attribute is being faded to or from nothing. This function does the preparation and valiation needed in order to delegate safely to fade-between-assignments by promoting nil values to empty assignments of the appropriate :kind affecting the same target.

    +

    The amount contributed by each assignment is controlled by fraction, which can range from 0 (or less), meaning that only from-assignment is considered, to 1 (or greater), meaning that to-assignment is simply returned. Intermediate values will ideally result in a blend between the two assignments, with 0.5 representing an equal contribution from each. Since the value of the assignments may still be dynamic parameters, the show and snapshot might be needed to resolve them in order to calculate the blended value. Some kinds of assignment may not support blending, in which case the default implementation will simply switch from from-assignment to to-assignment once fraction reaches 0.5.

    fade-between-assignments

    multimethod

    Calculates an intermediate value between two attribute assignments of the same kind (e.g. color, direction, channel value) for an element of a light show. Most code will not call this directly, and will instead use the higher-level fade-assignment function to help set it up, or simply use a full-blown fade effect. This is the low-level mechanism which performs the fade calculations by dispatching to an appropriate implementation based on the :kind value of from-assignment, and it requires both from-assignment and to-assignment to be non-nil instances of afterglow.effects.Assignment of the same :kind.

    +

    The amount contributed by each assignment is controlled by fraction, which can range from 0 (or less), meaning that only from-assignment is considered, to 1 (or greater), meaning that to-assignment is simply returned. Intermediate values will ideally result in a blend between the two assignments, with 0.5 representing an equal contribution from each. Since the value of the assignments may still be dynamic parameters, the show and snapshot might be needed to resolve them in order to calculate the blended value. Some kinds of assignment may not support blending, in which case the default implementation will simply switch from from-assignment to to-assignment once fraction reaches 0.5.

    IAssigner

    protocol

    Assign some attribute (color, attitude, channel value) to an element of a light show at a given point in time. Any previous assignment to this element will be supplied as an argument, and may be tweaked or ignored as needs dictate. The target will be a subtree of the show’s fixtures, currently either a head or channel.

    members

    assign

    (assign this show snapshot target previous-assignment)

    Calculate the value the show element should have at this moment in time. Return a value appropriate for the kind of assignment, e.g. color object, channel value.

    IEffect

    protocol

    The effect is the basic building block of an Afterglow light show. It generates a list of assignments that should be in effect at a given moment in the show. It can end on its own, or be asked to end. When asked, it may end immediately, or after some final activity, such as a fade.

    members

    end

    (end this show snapshot)

    The effect has been asked to end. It should arrange to finish as soon as possible; return true if it can end immediately, and it will be removed from the show. Otherwise it will be allowed to continue running as it performs its graceful shutdown until still-active? reuthrns false. If the user asks to end the effect a second time during htis process, however, it will simply be removed from the show at that time.

    generate

    (generate this show snapshot)

    List the asignments needed to implement the desired effect at this moment in time. Must return a sequence of afterglow.effects.Assigner objects which will be merged into the current frame based on their kind, target, and the effect’s priority. If the effect currently has nothing to contribute, it may return an empty sequence.

    still-active?

    (still-active? this show snapshot)

    An inquiry about whether this effect is finished, and can be cleaned up. A false return value will remove the effect from the show.

    map->Assigner

    (map->Assigner m__6522__auto__)

    Factory function for class afterglow.effects.Assigner, taking a map of keywords to field values.

    map->Assignment

    (map->Assignment m__6522__auto__)

    Factory function for class afterglow.effects.Assignment, taking a map of keywords to field values.

    map->Effect

    (map->Effect m__6522__auto__)

    Factory function for class afterglow.effects.Effect, taking a map of keywords to field values.

    resolve-assignment

    multimethod

    Translates an attribute assignment (e.g. color, direction, channel value) for an element of a light show to the actual DMX values that will implement it. Since the value of the assignment may still be a dynamic parameter, the show and snapshot might be needed to resolve it.

    run-assigners

    (run-assigners show snapshot assigners)(run-assigners show snapshot assigners previous-assignment)

    Returns the final assignment value that results from iterating over an assigner list that was gathered for a particular kind and target ID, feeding each intermediate result to the next assigner in the chain.

    scene

    (scene scene-name & effects)

    Create an effect which combines multiple effects into one.

    +

    Scenes are a way to group a list of effects to run as a single effect. All of their assigners are combined into a single list, in the order in which the effects were added to the scene. Because of the way Afterglow evaluates assigners, that means that if any constituent effects try to assign to the same target, the later ones will have a chance to override or blend with the earlier ones.

    \ No newline at end of file diff --git a/api-doc/afterglow.effects.movement.html b/api-doc/afterglow.effects.movement.html index d9b52e62..b3d36048 100644 --- a/api-doc/afterglow.effects.movement.html +++ b/api-doc/afterglow.effects.movement.html @@ -1,5 +1,5 @@ -afterglow.effects.movement documentation

    afterglow.effects.movement

    Effects pipeline functions for working with direction assignments to fixtures and heads.

    aim-effect

    (aim-effect name target-point fixtures)

    Returns an effect which assigns an aim parameter (most easily created by build-aim-param) to all moving heads of the fixtures supplied when invoked. The direction is a point in the frame of reference of the show, so standing in the audience facing the show, x increases to the left, y away from the ground, and z towards the audience, and the origin is the center of the show. If a pan-tilt-effect or direction-effect is simultaneously running on the same fixture, this effect will win and override whatever the other effect was trying to do, because this one runs later.

    current-rotation

    (current-rotation head pan tilt)

    Given a head and DMX pan and tilt values, calculate a transformation that represents the current orientation of the head as compared to the default orientation of facing directly towards the positive Z axis.

    default-direction

    (default-direction head)

    Determine the default aiming vector for a head, in other words the direction it aims when sent zero values for its DMX pan and tilt channels.

    direction-effect

    (direction-effect name direction fixtures)

    Returns an effect which assigns a direction parameter (most easily created by build-direction-param) to all moving heads of the fixtures supplied when invoked. The direction is a vector in the frame of reference of the show, so standing in the audience facing the show, x increases to the left, y away from the ground, and z towards the audience. If an aim-effect is simultaneously running on the same fixture, it will win and override whatever this effect was trying to do, because it runs later. However, if a pan-tilt-effect is running, it will run before this one, so this one will win.

    find-moving-heads

    (find-moving-heads fixtures)

    Returns all heads of the supplied fixtures which are capable of movement, in other words they have either a pan or tilt channel.

    pan-tilt-effect

    (pan-tilt-effect name pan-tilt fixtures)

    Returns an effect which assigns a pan/tilt parameter (most easily created by build-pan-tilt-param) to all moving heads of the fixtures supplied when invoked. The pan and tilt values represent angles in the frame of reference of the show, telling how far the head should move away from facing directly along the z axis. (see show space for a diagram of the axes).

    +afterglow.effects.movement documentation

    afterglow.effects.movement

    Effects pipeline functions for working with direction assignments to fixtures and heads.

    aim-effect

    (aim-effect name target-point fixtures)

    Returns an effect which assigns an aim parameter (most easily created by build-aim-param) to all moving heads of the fixtures supplied when invoked. The direction is a point in the frame of reference of the show, so standing in the audience facing the show, x increases to the left, y away from the ground, and z towards the audience, and the origin is the center of the show. If a pan-tilt-effect or direction-effect is simultaneously running on the same fixture, this effect will win and override whatever the other effect was trying to do, because this one runs later.

    current-rotation

    (current-rotation head pan tilt)

    Given a head and DMX pan and tilt values, calculate a transformation that represents the current orientation of the head as compared to the default orientation of facing directly towards the positive Z axis.

    default-direction

    (default-direction head)

    Determine the default aiming vector for a head, in other words the direction it aims when sent zero values for its DMX pan and tilt channels.

    direction-effect

    (direction-effect name direction fixtures)

    Returns an effect which assigns a direction parameter (most easily created by build-direction-param) to all moving heads of the fixtures supplied when invoked. The direction is a vector in the frame of reference of the show, so standing in the audience facing the show, x increases to the left, y away from the ground, and z towards the audience. If an aim-effect is simultaneously running on the same fixture, it will win and override whatever this effect was trying to do, because it runs later. However, if a pan-tilt-effect is running, it will run before this one, so this one will win.

    find-moving-heads

    (find-moving-heads fixtures)

    Returns all heads of the supplied fixtures which are capable of movement, in other words they have either a pan or tilt channel.

    pan-tilt-effect

    (pan-tilt-effect name pan-tilt fixtures)

    Returns an effect which assigns a pan/tilt parameter (most easily created by build-pan-tilt-param) to all moving heads of the fixtures supplied when invoked. The pan and tilt values represent angles in the frame of reference of the show, telling how far the head should move away from facing directly along the z axis. (see show space for a diagram of the axes).

    If a direction-effect or aim-effect is simultaneously running on the same fixture, they will win and override whatever this effect was trying to do, because they run later.

    -

    If you simply want to set the pan or tilt channels of some fixtures to specific values, without regard to the orientation at which the fixture was hung with respect to show space, you want to use a lower level function-effect with the :pan or :tilt keyword, rather than this effect.

    \ No newline at end of file +

    If you simply want to set the pan or tilt channels of some fixtures to specific values, without regard to the orientation at which the fixture was hung with respect to show space, you want to use a lower level function-effect with the :pan or :tilt keyword, rather than this effect.

    \ No newline at end of file diff --git a/api-doc/afterglow.effects.oscillators.html b/api-doc/afterglow.effects.oscillators.html index 0222346a..f3f4741f 100644 --- a/api-doc/afterglow.effects.oscillators.html +++ b/api-doc/afterglow.effects.oscillators.html @@ -1,7 +1,7 @@ -afterglow.effects.oscillators documentation

    afterglow.effects.oscillators

    Provide a variety of waveforms at frequencies related to the show metronome to facilitate building visually and musically pleasing effects.

    build-oscillated-param

    (build-oscillated-param osc & {:keys [min max metronome frame-dynamic], :or {min 0, max 255, frame-dynamic true}})

    Returns a number parameter that is driven by an oscillator. By default will be frame-dynamic, since it oscillates, but if you pass a false value for :frame-dynamic, the value will be fixed once it is assigned to an effect, acting like a random number generator with the oscillator’s range. If you don’t specify a :metronome to use, the main metronome in *show* will be used.

    -

    The values returned by the oscillator will be mapped onto the range from 0 to 255. If you would like to use a different range, you can pass in alternate numbers with the optional keyword arguments :min and :max. If the values you supply result in a maximum that is less than or equal to the minimum, the oscillated parameter will be stuck at the value you gave with :min.

    build-oscillator

    (build-oscillator shape-fn & {:keys [interval interval-ratio phase], :or {interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a waveform relative to the phase of the current beat, bar, or phrase. The shape of the wave is determined by the first argument, shape-fn.

    +afterglow.effects.oscillators documentation

    afterglow.effects.oscillators

    Provide a variety of waveforms at frequencies related to the show metronome to facilitate building visually and musically pleasing effects.

    build-oscillated-param

    (build-oscillated-param osc & {:keys [min max metronome frame-dynamic], :or {min 0, max 255, frame-dynamic true}})

    Returns a number parameter that is driven by an oscillator. By default will be frame-dynamic, since it oscillates, but if you pass a false value for :frame-dynamic, the value will be fixed once it is assigned to an effect, acting like a random number generator with the oscillator’s range. If you don’t specify a :metronome to use, the main metronome in *show* will be used.

    +

    The values returned by the oscillator will be mapped onto the range from 0 to 255. If you would like to use a different range, you can pass in alternate numbers with the optional keyword arguments :min and :max. If the values you supply result in a maximum that is less than or equal to the minimum, the oscillated parameter will be stuck at the value you gave with :min.

    build-oscillator

    (build-oscillator shape-fn & {:keys [interval interval-ratio phase], :or {interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a waveform relative to the phase of the current beat, bar, or phrase. The shape of the wave is determined by the first argument, shape-fn.

    In the simplest case, shape-fn is a function that takes a single argument, the curent phase of the oscillator, which ranges from 0 to 1, and returns what the value fo the oscillator should be at that phase in its waveform. The value returned by shape-fn must also range from 0 to 1.

    If the shape of the oscillator needs to be able to change over time depending on the value of a dynamic parameter, then shape-fn will instead implement IVariableShape in order to be able to resolve those parameters.

    All of the standard oscillators provided by Afterglow are built in this way. For example, an upwards-sloping sawtooth wave would be created by passing a shape-fn that simply returns its argument:

    @@ -12,18 +12,18 @@

    With no additional arguments, the waveform is defined by calling shape-fn with a phase argument that ramps upward from 0 to 1 over the course of each beat.

    Passing the value :bar or :phrase with the optional keyword argument :interval makes the wave cycle over a bar or phrase instead.

    Supplying a value with :interval-ratio will run the oscillator at the specified fraction or multiple of the chosen interval (beat, bar, or phrase), and supplying a :phase will offset the oscillator from the underlying metronome phase by that amount. (See the documentation for an expanded explanation illustrated with graphs.)

    -

    The arguments after shape-fn can be dynamic parameters.

    IOscillator

    protocol

    A waveform generator for building effects that vary at frequencies related to a show metronome.

    members

    evaluate

    (evaluate this show snapshot head)

    Determine the value of this oscillator at a given moment of the show. In addition to the metronome snapshot, the show and (if applicable) fixture head must be passed in case any oscillator configuration arguments rely on dynamic or spatial parameters.

    resolve-non-frame-dynamic-elements

    (resolve-non-frame-dynamic-elements this show snapshot head)

    Called when an effect is created using this oscillator. Returns a version of itself where any non frame-dynamic input parameters have been resolved.

    IVariableShape

    protocol

    Shape functions which can change over time (depending on the value of dynamic parameters) use this protocol rather than being a simple function, so they can get the context needed for evaluating their dynamic parameters.

    members

    simplify-unless-frame-dynamic

    (simplify-unless-frame-dynamic this show snapshot head)

    If none of the dynamic parameters used by the shape function are dynamic to the level of individual frames, return a simple shape function based on their current values which can replace this variable shape function but run faster. Otherwise returns itself.

    value-for-phase

    (value-for-phase this phase show snapshot head)

    Calculate the value of the oscillator’s waveform at the specified phase, with support for resolving dynamic parameters that it may depend on. [phase] ranges from 0 to 1, and so must the return value from this function.

    sawtooth

    (sawtooth & {:keys [down? interval interval-ratio phase], :or {down? false, interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a sawtooth wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a sawtooth wave that ramps upward from 0 to 1 over the course of each beat.

    +

    The arguments after shape-fn can be dynamic parameters.

    IOscillator

    protocol

    A waveform generator for building effects that vary at frequencies related to a show metronome.

    members

    evaluate

    (evaluate this show snapshot head)

    Determine the value of this oscillator at a given moment of the show. In addition to the metronome snapshot, the show and (if applicable) fixture head must be passed in case any oscillator configuration arguments rely on dynamic or spatial parameters.

    resolve-non-frame-dynamic-elements

    (resolve-non-frame-dynamic-elements this show snapshot head)

    Called when an effect is created using this oscillator. Returns a version of itself where any non frame-dynamic input parameters have been resolved.

    IVariableShape

    protocol

    Shape functions which can change over time (depending on the value of dynamic parameters) use this protocol rather than being a simple function, so they can get the context needed for evaluating their dynamic parameters.

    members

    simplify-unless-frame-dynamic

    (simplify-unless-frame-dynamic this show snapshot head)

    If none of the dynamic parameters used by the shape function are dynamic to the level of individual frames, return a simple shape function based on their current values which can replace this variable shape function but run faster. Otherwise returns itself.

    value-for-phase

    (value-for-phase this phase show snapshot head)

    Calculate the value of the oscillator’s waveform at the specified phase, with support for resolving dynamic parameters that it may depend on. [phase] ranges from 0 to 1, and so must the return value from this function.

    sawtooth

    (sawtooth & {:keys [down? interval interval-ratio phase], :or {down? false, interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a sawtooth wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a sawtooth wave that ramps upward from 0 to 1 over the course of each beat.

    Passing true with :down? creates an inverse sawtooth wave (one that ramps downward from 1 to 0 over the course of the interval).

    Passing the value :bar or :phrase with the optional keyword argument :interval makes the wave cycle over a bar or phrase instead.

    Supplying a value with :interval-ratio will run the oscillator at the specified fraction or multiple of the chosen interval (beat, bar, or phrase), and supplying a :phase will offset the oscillator from the underlying metronome phase by that amount. (See the documentation for an expanded explanation illustrated with graphs.)

    -

    The arguments can be dynamic parameters.

    sine

    (sine & {:keys [interval interval-ratio phase], :or {interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a sine wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a sine wave that curves upward from 0 to 1 over the first half of each beat, then back down to 0 through the end of the beat.

    +

    The arguments can be dynamic parameters.

    sine

    (sine & {:keys [interval interval-ratio phase], :or {interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a sine wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a sine wave that curves upward from 0 to 1 over the first half of each beat, then back down to 0 through the end of the beat.

    Passing the value :bar or :phrase with the optional keyword argument :interval makes the wave cycle over a bar or phrase instead.

    Supplying a value with :interval-ratio will run the oscillator at the specified fraction or multiple of th chosen interval (beat, bar, or phrase), and supplying a :phase will offset the oscillator from the underlying metronome phase by that amount. (See the documentation for an expanded explanation illustrated with graphs.)

    -

    All the arguments can be dynamic parameters.

    square

    (square & {:keys [width interval interval-ratio phase], :or {width 0.5, interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a square wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a square wave that starts at 1 at the start of each beat, and drops to 0 at the midpoint.

    +

    All the arguments can be dynamic parameters.

    square

    (square & {:keys [width interval interval-ratio phase], :or {width 0.5, interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a square wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a square wave that starts at 1 at the start of each beat, and drops to 0 at the midpoint.

    Specifying a value with :width adjusts how much of the time the wave is on (high); the default is 0.5, lower values cause it to turn off sooner, larger values later. In any case the width must be within the range 0.0 to 1.0. A value of zero means the oscillator is always off, and a value of one means it is always on.

    Passing the value :bar or :phrase with the optional keyword argument :interval makes the wave cycle over a bar or phrase instead.

    Supplying a value with :interval-ratio will run the oscillator at the specified fraction or multiple of a beat, and supplying a :phase will offset the oscillator from the underlying metronome phase by that amount. (See the documentation for an expanded explanation illustrated with graphs.)

    -

    The arguments can be dynamic parameters.

    triangle

    (triangle & {:keys [interval interval-ratio phase], :or {interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a triangle wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a triangle wave that ramps upward from 0 to 1 over the first half of each beat, then back down to 0 through the end of the beat.

    +

    The arguments can be dynamic parameters.

    triangle

    (triangle & {:keys [interval interval-ratio phase], :or {interval :beat, interval-ratio 1, phase 0.0}})

    Returns an oscillator which generates a triangle wave relative to the phase of the current beat, bar, or phrase. With no arguments, it creates a triangle wave that ramps upward from 0 to 1 over the first half of each beat, then back down to 0 through the end of the beat.

    Passing the value :bar or :phrase with the optional keyword argument :interval makes the wave cycle over a bar or phrase instead.

    Supplying a value with :interval-ratio will run the oscillator at the specified fraction or multiple of the chosen interval (beat, bar, or phrase), and supplying a :phase will offset the oscillator from the underlying metronome phase by that amount. (See the documentation for an expanded explanation illustrated with graphs.)

    -

    All the arguments can be dynamic parameters.

    \ No newline at end of file +

    All the arguments can be dynamic parameters.

    \ No newline at end of file diff --git a/api-doc/afterglow.effects.params.html b/api-doc/afterglow.effects.params.html index a87d83b8..4c463d71 100644 --- a/api-doc/afterglow.effects.params.html +++ b/api-doc/afterglow.effects.params.html @@ -1,29 +1,29 @@ -afterglow.effects.params documentation

    afterglow.effects.params

    A general mechanism for passing dynamic parameters to effect functions and assigners allowing for dynamic values to be computed either when an effect creates its assigners, or when the assigners are resolving DMX values. Parameters can be calculated based on the show metronome snapshot, show variables (which can be bound to OSC and MIDI mappings), and other, not-yet-imagined things.

    bind-keyword-param

    macro

    (bind-keyword-param value type-expected default)(bind-keyword-param value type-expected default param-name)

    If an input to a dynamic parameter has been passed as a keyword, treat that as a reference to a variable in *show*. If that variable currently holds a dynamic parameter, try to bind it directly (throw an exception if the types do not match). Otherwise, build a new variable param to bind to future values of that show variable, and return that, logging a warning if the current value (if any) of the show variable is of an incompatible type for the parameter being bound. If the input parameter is not a keyword, simply validate its type.

    bind-keyword-param*

    (bind-keyword-param* param type-expected default param-name)

    Helper function that does the work of the bind-keyword-param macro, which passes it the name of the parameter being bound for nice error messages.

    build-aim-param

    (build-aim-param & {:keys [x y z frame-dynamic], :or {x 0, y 0, z 2, frame-dynamic :default}})

    Returns a dynamic aiming parameter for use with aim-effect. If no arguments are supplied, returns a static direction aiming towards a spot on the floor two meters towards the audience from the center of the light show. Keywords :x, :y, and :z can be used to specify a target point in the frame of reference of the light show.

    +afterglow.effects.params documentation

    afterglow.effects.params

    A general mechanism for passing dynamic parameters to effect functions and assigners allowing for dynamic values to be computed either when an effect creates its assigners, or when the assigners are resolving DMX values. Parameters can be calculated based on the show metronome snapshot, show variables (which can be bound to OSC and MIDI mappings), and other, not-yet-imagined things.

    bind-keyword-param

    macro

    (bind-keyword-param value type-expected default)(bind-keyword-param value type-expected default param-name)

    If an input to a dynamic parameter has been passed as a keyword, treat that as a reference to a variable in *show*. If that variable currently holds a dynamic parameter, try to bind it directly (throw an exception if the types do not match). Otherwise, build a new variable param to bind to future values of that show variable, and return that, logging a warning if the current value (if any) of the show variable is of an incompatible type for the parameter being bound. If the input parameter is not a keyword, simply validate its type.

    bind-keyword-param*

    (bind-keyword-param* param type-expected default param-name)

    Helper function that does the work of the bind-keyword-param macro, which passes it the name of the parameter being bound for nice error messages.

    build-aim-param

    (build-aim-param & {:keys [x y z frame-dynamic], :or {x 0, y 0, z 2, frame-dynamic :default}})

    Returns a dynamic aiming parameter for use with aim-effect. If no arguments are supplied, returns a static direction aiming towards a spot on the floor two meters towards the audience from the center of the light show. Keywords :x, :y, and :z can be used to specify a target point in the frame of reference of the light show.

    All incoming parameter values may be literal or dynamic, and may be keywords, which will be dynamically bound to variables in *show*.

    -

    If you do not specify an explicit value for :frame-dynamic, this aim parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-aim-transformer

    (build-aim-transformer aim transform & {:keys [frame-dynamic], :or {frame-dynamic :default}})

    Returns a dynamic aiming parameter for use with aim-effect which evaluates an incoming aiming parameter and transforms it according to a Transform3D parameter.

    +

    If you do not specify an explicit value for :frame-dynamic, this aim parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-aim-transformer

    (build-aim-transformer aim transform & {:keys [frame-dynamic], :or {frame-dynamic :default}})

    Returns a dynamic aiming parameter for use with aim-effect which evaluates an incoming aiming parameter and transforms it according to a Transform3D parameter.

    All incoming parameter values may be literal or dynamic, and may be keywords, which will be dynamically bound to variables in *show*.

    -

    If you do not specify an explicit value for :frame-dynamic, this aim parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-color-param

    (build-color-param & {:keys [color r g b h s l adjust-hue adjust-saturation adjust-lightness frame-dynamic], :or {color default-color, frame-dynamic :default}})

    Returns a dynamic color parameter. If supplied, :color is passed to interpret-color to establish the base color to which other arguments are applied. The default base color is black, in the form of all zero values for r, g, b, h, s, and l. To this base it will then assign values passed in for individual color parameters.

    +

    If you do not specify an explicit value for :frame-dynamic, this aim parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-color-param

    (build-color-param & {:keys [color r g b h s l adjust-hue adjust-saturation adjust-lightness frame-dynamic], :or {color default-color, frame-dynamic :default}})

    Returns a dynamic color parameter. If supplied, :color is passed to interpret-color to establish the base color to which other arguments are applied. The default base color is black, in the form of all zero values for r, g, b, h, s, and l. To this base it will then assign values passed in for individual color parameters.

    All incoming parameter values may be literal or dynamic, and may be keywords, which will be dynamically bound to variables in *show*.

    Not all parameter combinations make sense, of course: you will probably want to stick with either some of :h, :s, and :l, or some of :r, :g, and :b. If values from both are supplied, the :r, :g, and/or :b assignments will occur first, then then any :h, :s, and :l assignments will be applied to the resulting color.

    Finally, if any adjustment values have been supplied for hue, saturation or lightness, they will be added to the corresponding values (rotating around the hue circle, clamped to the legal range for the others).

    -

    If you do not specify an explicit value for :frame-dynamic, this color parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-direction-param

    (build-direction-param & {:keys [x y z frame-dynamic], :or {x 0, y 0, z 1, frame-dynamic :default}})

    Returns a dynamic direction parameter for use with direction-effect. If no arguments are supplied, returns a static direction facing directly out towards the audience. Keywords :x, :y, and :z can be used to specify a vector in the frame of reference of the light show.

    +

    If you do not specify an explicit value for :frame-dynamic, this color parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-direction-param

    (build-direction-param & {:keys [x y z frame-dynamic], :or {x 0, y 0, z 1, frame-dynamic :default}})

    Returns a dynamic direction parameter for use with direction-effect. If no arguments are supplied, returns a static direction facing directly out towards the audience. Keywords :x, :y, and :z can be used to specify a vector in the frame of reference of the light show.

    All incoming parameter values may be literal or dynamic, and may be keywords, which will be dynamically bound to variables in *show*.

    -

    If you do not specify an explicit value for :frame-dynamic, this direction parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-direction-param-from-pan-tilt

    (build-direction-param-from-pan-tilt & {:keys [pan tilt radians frame-dynamic], :or {pan 0, tilt 0, frame-dynamic :default}})

    An alternative to build-direction-param for cases in which angles are more convenient than a vector, but when you still want to use a direction-effect, probably because you want to be able to fade to or from another direction-effect. (In cases where you don’t need to do that, it is simpler to use a pan-tilt-effect with build-pan-tilt-param and actually have the effect work with pan and tilt angles, the way most lighting software does.)

    +

    If you do not specify an explicit value for :frame-dynamic, this direction parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-direction-param-from-pan-tilt

    (build-direction-param-from-pan-tilt & {:keys [pan tilt radians frame-dynamic], :or {pan 0, tilt 0, frame-dynamic :default}})

    An alternative to build-direction-param for cases in which angles are more convenient than a vector, but when you still want to use a direction-effect, probably because you want to be able to fade to or from another direction-effect. (In cases where you don’t need to do that, it is simpler to use a pan-tilt-effect with build-pan-tilt-param and actually have the effect work with pan and tilt angles, the way most lighting software does.)

    Returns a dynamic direction parameter specified in terms of pan and tilt angles away from facing directly out towards the audience. If no arguments are supplied, returns a static direction facing directly out towards the audience. Keywords :pan and :tilt can be used to specify angles to turn around the Y and X axes respectively (see show space for a diagram of these axes). For human friendliness, the angles are assumed to be in degrees unless keyword :radians is supplied with a true value.

    The values passed for :pan and :tilt may be dynamic, or may be keywords, which will be dynamically bound to variables in *show*.

    -

    If you do not specify an explicit value for :frame-dynamic, the resulting direction parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-direction-transformer

    (build-direction-transformer direction transform & {:keys [frame-dynamic], :or {frame-dynamic :default}})

    Returns a dynamic direction parameter for use with direction-effect which evaluates an incoming direction parameter and transforms it according to a Transform3D parameter.

    +

    If you do not specify an explicit value for :frame-dynamic, the resulting direction parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-direction-transformer

    (build-direction-transformer direction transform & {:keys [frame-dynamic], :or {frame-dynamic :default}})

    Returns a dynamic direction parameter for use with direction-effect which evaluates an incoming direction parameter and transforms it according to a Transform3D parameter.

    All incoming parameter values may be literal or dynamic, and may be keywords, which will be dynamically bound to variables in *show*.

    -

    If you do not specify an explicit value for :frame-dynamic, this direction parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-pan-tilt-param

    (build-pan-tilt-param & {:keys [pan tilt radians frame-dynamic], :or {pan 0, tilt 0, frame-dynamic :default}})

    Returns a dynamic pan/tilt parameter for use with pan-tilt-effect, specified in terms of pan and tilt angles away from facing directly out towards the audience. If no arguments are supplied, returns a static orientation facing directly out towards the audience. Keywords :pan and :tilt can be used to specify angles to turn around the Y and X axes respectively (see show space for a diagram of these axes). For human friendliness, the angles are assumed to be in degrees unless keyword :radians is supplied with a true value.

    +

    If you do not specify an explicit value for :frame-dynamic, this direction parameter will be frame dynamic if it has any incoming parameters which themselves are.

    build-pan-tilt-param

    (build-pan-tilt-param & {:keys [pan tilt radians frame-dynamic], :or {pan 0, tilt 0, frame-dynamic :default}})

    Returns a dynamic pan/tilt parameter for use with pan-tilt-effect, specified in terms of pan and tilt angles away from facing directly out towards the audience. If no arguments are supplied, returns a static orientation facing directly out towards the audience. Keywords :pan and :tilt can be used to specify angles to turn around the Y and X axes respectively (see show space for a diagram of these axes). For human friendliness, the angles are assumed to be in degrees unless keyword :radians is supplied with a true value.

    The values passed for :pan and :tilt may be dynamic, or may be keywords, which will be dynamically bound to variables in *show*.

    If you do not specify an explicit value for :frame-dynamic, the resulting pan/tilt parameter will be frame dynamic if it has any incoming parameters which themselves are.

    -

    Note that if you want to be able to fade the effect you are creating to or from a direction-effect, you need to create a direction-effect rather than a pan-tilt-effect, and you can instead use build-direction-param-from-pan-tilt to set its direction.

    build-param-formula

    (build-param-formula param-type calc-fn & input-params)

    A helper function to create a dynamic parameter that involves some sort of calculation based on the values of another group of dynamic parameters. The result type reported by the resulting parameter will be param-type.

    +

    Note that if you want to be able to fade the effect you are creating to or from a direction-effect, you need to create a direction-effect rather than a pan-tilt-effect, and you can instead use build-direction-param-from-pan-tilt to set its direction.

    build-param-formula

    (build-param-formula param-type calc-fn & input-params)

    A helper function to create a dynamic parameter that involves some sort of calculation based on the values of another group of dynamic parameters. The result type reported by the resulting parameter will be param-type.

    Whenever the parameter’s value is needed, it will evaluate all of the parameters passed as input-params, and call calc-fn with their current values, returning its result, which must have the type specified by param-type.

    -

    The compound dynamic parameter will be frame dynamic if any of its input parameters are.

    build-spatial-param

    (build-spatial-param fixtures-or-heads f & {:keys [min max frame-dynamic], :or {frame-dynamic :default}})

    Returns a dynamic number parameter related to the physical arrangement of the supplied fixtures or heads. First the heads of any fixtures passed in fixtures-or-heads are included. Then function f is called for all fixtures or heads, passing in the fixture or head. It must return a literal number or dynamic number parameter.

    +

    The compound dynamic parameter will be frame dynamic if any of its input parameters are.

    build-spatial-param

    (build-spatial-param fixtures-or-heads f & {:keys [min max frame-dynamic], :or {frame-dynamic :default}})

    Returns a dynamic number parameter related to the physical arrangement of the supplied fixtures or heads. First the heads of any fixtures passed in fixtures-or-heads are included. Then function f is called for all fixtures or heads, passing in the fixture or head. It must return a literal number or dynamic number parameter.

    If you pass a value with either :max or :min as optional keyword parameters, this activates result scaling. (If you pass only a :max value, :min defaults to zero; if you pass only :min, then :max defaults to 255. If you pass neither, scaling is not performed, and the results from f are returned unchanged.) With scaling active, when it comes time to evaluate this spatial parameter, any dynamic number parameters are evaluated, and the resulting numbers are scaled as a group (after evaluating f for every participating head or fixture) so they fall within the range [:start-:end].

    Useful things that f can do include calculating the distance of the head from some point, either in 3D or along an axis, its angle from some line, and so on. These can allow the creation of lighting gradients across all or part of a show. Spatial parameters make excellent building blocks for color, direction and aim parameters, as shown in the effect examples.

    -

    If you do not specify an explicit value for :frame-dynamic, this spatial parameter will be frame dynamic if any values returned by f are dynamic parameters which themselves are frame dynamic.

    build-step-param

    (build-step-param & {:keys [interval interval-ratio fade-fraction fade-curve starting], :or {interval :beat, interval-ratio 1, fade-fraction 0, fade-curve :linear, starting (when *show* (metro-snapshot (:metronome *show*)))}})

    Returns a number parameter that increases over time, ideal for convenient control of chases.

    +

    If you do not specify an explicit value for :frame-dynamic, this spatial parameter will be frame dynamic if any values returned by f are dynamic parameters which themselves are frame dynamic.

    build-step-param

    (build-step-param & {:keys [interval interval-ratio fade-fraction fade-curve starting], :or {interval :beat, interval-ratio 1, fade-fraction 0, fade-curve :linear, starting (when *show* (metro-snapshot (:metronome *show*)))}})

    Returns a number parameter that increases over time, ideal for convenient control of chases.

    With no arguments, the parameter will evaluate to one at the beat closest when it was created, and will increase by one for each beat that passes, with no fades (fractional states).

    The optional keyword argument :interval can be supplied with the value :bar or :phrase to change the timing so that it instead relates to bars or phrases. Supplying a value with :interval-ratio will run the step parameter at the specified fraction or multiple of the chosen interval (beat, bar, or phrase), as illustrated in the Ratios section of the Oscillator documentation.

    If fading between steps is desired, the optional keyword argument :fade-fraction can be supplied with a non-zero value (up to but no greater than 1). This specifies what fraction of each interval is involved in fading to or from the next value.

    @@ -33,7 +33,7 @@

    A fade fraction of 0 provides the default behavior of an instant jump between values with no fading. A fade fraction of 1 means that each value continually fades into the next, and is never steady. A fade fraction of 0.5 would mean that the value is stable half the time, and fading for the other half: during the middle of the interval, the value is steady at its assigned value; once the final quarter of the interval begins, the value starts fading up, reaching the halfway point as the interval ends, and the fade continues through the first quarter of the next interval, finally stabilizing for the next middle section. Smaller fade fractions mean shorter periods of stability and slower fades, while larger fractions yield longer periods of steady values, and quicker fades.

    A smoother look can be obtained by using a sine curve to smooth the start and end of each fade, by passing the optional keyword argument :fade-curve with the value :sine. (Again, see the graphs to get a visual feel for what this does.)

    If the timing should start at an instant other than when the step parameter was created, a metronome snapshot containing the desired start point can be passed with the optional keyword argument :starting.

    -

    All incoming parameters may be dynamic. Step parameters are always frame-dynamic.

    build-variable-param

    (build-variable-param variable & {:keys [frame-dynamic type default transform-fn], :or {frame-dynamic true, type Number, default 0}})

    Create a dynamic parameter whose value is determined by the value held in a variable of *show* at the time evaluation is performed. Unless :frame-dynamic is passed a false value, this evaluation will happen every frame.

    +

    All incoming parameters may be dynamic. Step parameters are always frame-dynamic.

    build-variable-param

    (build-variable-param variable & {:keys [frame-dynamic type default transform-fn], :or {frame-dynamic true, type Number, default 0}})

    Create a dynamic parameter whose value is determined by the value held in a variable of *show* at the time evaluation is performed. Unless :frame-dynamic is passed a false value, this evaluation will happen every frame.

    If no type-compatible value is found in the show variable, a default value is returned. That will be the number zero, unless otherwise specified by :default. The type expected (and returned) by this parameter will be numeric, unless a different value is passed for :type, (in which case a new type-compatible :default value must be specified).

    -

    If the named show variable already holds a dyamic parameter at the time this variable parameter is created, the binding is short-circuited to return that existing parameter rather than creating a new one, so the type must be compatible. If :transform-fn is supplied, it will be called with the value of the variable and its return value will be used as the value of the dynamic parameter. It must return a compatible type or its result will be discarded.

    check-type

    (check-type value type-expected name)

    Ensure that a parameter is of a particular type, or that it satisfies IParam and, when evaluated, returns that type, throwing an exception otherwise. Used by the validate-param-type macros to do the actual type checking.

    frame-dynamic-param?

    (frame-dynamic-param? arg)

    Checks whether the argument is an IParam which is dynamic to the frame level.

    interpret-color

    (interpret-color color)

    Accept a color as either a jolby/colors object, an IParam which will produce a color, a keyword, which will be bound to a show variable by the caller, or a string which is passed to the jolby/colors create-color function.

    IParam

    protocol

    A dynamic parameter which gets evaluated during the run of a light show, with access to the show and its metronome snapshot.

    members

    evaluate

    (evaluate this show snapshot head)

    Determine the value of this parameter at a given moment (identified by snapshot) of the show. If the parameter is being evaluated for a specific fixture head, that will be passed in head. If no fixure context is available, head will be nil.

    frame-dynamic?

    (frame-dynamic? this)

    If true, this parameter varies at every frame of the show, and must be invoked by effect assigners for each frame of DMX data generated. If false, the value can be determined at the time an effect is created, and passed as a constant to the assigners.

    resolve-non-frame-dynamic-elements

    (resolve-non-frame-dynamic-elements this show snapshot head)

    Called when an effect is created using this parameter. If the parameter is not frame-dynamic, this function should return the parameter’s final resolution to a constant of the type returned by result-type; otherwise, it should return a version of the parameter where any of its own non frame-dynamic input parameters have been resolved.

    -

    If the parameter is being evaluated for a specific fixture head, that will be passed in head. If no fixure context is available, head will be nil.

    result-type

    (result-type this)

    The type of value that will be returned when this parameter is resolved.

    param?

    (param? arg)

    Checks whether the argument is an IParam.

    resolve-param

    (resolve-param arg show snapshot)(resolve-param arg show snapshot head)

    Takes an argument which may be a raw value, or may be an IParam. If it is the latter, evaluates it and returns the resulting value. Otherwise just returns the value that was passed in.

    resolve-unless-frame-dynamic

    (resolve-unless-frame-dynamic arg show snapshot)(resolve-unless-frame-dynamic arg show snapshot head)

    If the first argument is an IParam which is not dynamic all the way to the frame level, return the result of resolving it now. If it is dynamic to the frame level, ask it to resolve any non frame-dynamic elements. Otherwise return it unchanged. If head is supplied, and the parameter can use it at resolution time, then pass it along.

    validate-optional-param-type

    macro

    (validate-optional-param-type value type-expected)(validate-optional-param-type value type-expected name)

    Ensure that a parameter, if not nil, satisfies a predicate, or that it satisfies IParam and, when evaluated, returns a type that passes that predicate, throwing an exception otherwise.

    validate-param-type

    macro

    (validate-param-type value type-expected)(validate-param-type value type-expected name)

    Ensure that a parameter satisfies a predicate, or that it satisfies IParam and, when evaluated, returns a type that passes that predicate, throwing an exception otherwise.

    vector-from-pan-tilt

    (vector-from-pan-tilt pan tilt)

    Convert a pan and tilt value (angles in radians away from facing directly out towards the audience) to the corresponding aiming vector.

    \ No newline at end of file +

    If the named show variable already holds a dyamic parameter at the time this variable parameter is created, the binding is short-circuited to return that existing parameter rather than creating a new one, so the type must be compatible. If :transform-fn is supplied, it will be called with the value of the variable and its return value will be used as the value of the dynamic parameter. It must return a compatible type or its result will be discarded.

    check-type

    (check-type value type-expected name)

    Ensure that a parameter is of a particular type, or that it satisfies IParam and, when evaluated, returns that type, throwing an exception otherwise. Used by the validate-param-type macros to do the actual type checking.

    frame-dynamic-param?

    (frame-dynamic-param? arg)

    Checks whether the argument is an IParam which is dynamic to the frame level.

    interpret-color

    (interpret-color color)

    Accept a color as either a jolby/colors object, an IParam which will produce a color, a keyword, which will be bound to a show variable by the caller, or a string which is passed to the jolby/colors create-color function.

    IParam

    protocol

    A dynamic parameter which gets evaluated during the run of a light show, with access to the show and its metronome snapshot.

    members

    evaluate

    (evaluate this show snapshot head)

    Determine the value of this parameter at a given moment (identified by snapshot) of the show. If the parameter is being evaluated for a specific fixture head, that will be passed in head. If no fixure context is available, head will be nil.

    frame-dynamic?

    (frame-dynamic? this)

    If true, this parameter varies at every frame of the show, and must be invoked by effect assigners for each frame of DMX data generated. If false, the value can be determined at the time an effect is created, and passed as a constant to the assigners.

    resolve-non-frame-dynamic-elements

    (resolve-non-frame-dynamic-elements this show snapshot head)

    Called when an effect is created using this parameter. If the parameter is not frame-dynamic, this function should return the parameter’s final resolution to a constant of the type returned by result-type; otherwise, it should return a version of the parameter where any of its own non frame-dynamic input parameters have been resolved.

    +

    If the parameter is being evaluated for a specific fixture head, that will be passed in head. If no fixure context is available, head will be nil.

    result-type

    (result-type this)

    The type of value that will be returned when this parameter is resolved.

    param?

    (param? arg)

    Checks whether the argument is an IParam.

    resolve-param

    (resolve-param arg show snapshot)(resolve-param arg show snapshot head)

    Takes an argument which may be a raw value, or may be an IParam. If it is the latter, evaluates it and returns the resulting value. Otherwise just returns the value that was passed in.

    resolve-unless-frame-dynamic

    (resolve-unless-frame-dynamic arg show snapshot)(resolve-unless-frame-dynamic arg show snapshot head)

    If the first argument is an IParam which is not dynamic all the way to the frame level, return the result of resolving it now. If it is dynamic to the frame level, ask it to resolve any non frame-dynamic elements. Otherwise return it unchanged. If head is supplied, and the parameter can use it at resolution time, then pass it along.

    validate-optional-param-type

    macro

    (validate-optional-param-type value type-expected)(validate-optional-param-type value type-expected name)

    Ensure that a parameter, if not nil, satisfies a predicate, or that it satisfies IParam and, when evaluated, returns a type that passes that predicate, throwing an exception otherwise.

    validate-param-type

    macro

    (validate-param-type value type-expected)(validate-param-type value type-expected name)

    Ensure that a parameter satisfies a predicate, or that it satisfies IParam and, when evaluated, returns a type that passes that predicate, throwing an exception otherwise.

    vector-from-pan-tilt

    (vector-from-pan-tilt pan tilt)

    Convert a pan and tilt value (angles in radians away from facing directly out towards the audience) to the corresponding aiming vector.

    \ No newline at end of file diff --git a/api-doc/afterglow.effects.show-variable.html b/api-doc/afterglow.effects.show-variable.html index 27126f4c..f81d2f7e 100644 --- a/api-doc/afterglow.effects.show-variable.html +++ b/api-doc/afterglow.effects.show-variable.html @@ -1,3 +1,3 @@ -afterglow.effects.show-variable documentation

    afterglow.effects.show-variable

    Virtual effects which set a value in a show variable while they are running. Pair well with conditional-effect to modify the behavior of scenes based on the activation of other cues.

    bind

    (bind binding)

    Establishes the association with the show, so that effects created based on this structure will be able to set variables in the show.

    create-for-show

    (create-for-show show)

    Creates the structures needed for adjusting variables in a show, and establishes the binding to the show.

    unbind

    (unbind binding)

    Removes the association with the show. Once this has been called, effects created based on this structure will no longer have any effect on the variables of the show.

    variable-effect

    (variable-effect binding k v)

    An effect which sets the show variable with the specified key to match the parameter passed in, and restores its original value when ended. Often combined with conditional-effect to enable cross-effect relationships.

    \ No newline at end of file +afterglow.effects.show-variable documentation

    afterglow.effects.show-variable

    Virtual effects which set a value in a show variable while they are running. Pair well with conditional-effect to modify the behavior of scenes based on the activation of other cues.

    bind

    (bind binding)

    Establishes the association with the show, so that effects created based on this structure will be able to set variables in the show.

    create-for-show

    (create-for-show show)

    Creates the structures needed for adjusting variables in a show, and establishes the binding to the show.

    unbind

    (unbind binding)

    Removes the association with the show. Once this has been called, effects created based on this structure will no longer have any effect on the variables of the show.

    variable-effect

    (variable-effect binding k v)

    An effect which sets the show variable with the specified key to match the parameter passed in, and restores its original value when ended. Often combined with conditional-effect to enable cross-effect relationships.

    \ No newline at end of file diff --git a/api-doc/afterglow.examples.html b/api-doc/afterglow.examples.html index 53c8fe10..ebfeeb4a 100644 --- a/api-doc/afterglow.examples.html +++ b/api-doc/afterglow.examples.html @@ -1,15 +1,17 @@ -afterglow.examples documentation

    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. The set up so incoming OSC messages update the value of that variable.

    +afterglow.examples documentation

    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.

    \ No newline at end of file +

    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 add-beyond?], :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.

    +

    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?.

    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.

    \ No newline at end of file diff --git a/api-doc/afterglow.fixtures.american-dj.html b/api-doc/afterglow.fixtures.american-dj.html index b5573482..5ceb400b 100644 --- a/api-doc/afterglow.fixtures.american-dj.html +++ b/api-doc/afterglow.fixtures.american-dj.html @@ -1,3 +1,3 @@ -afterglow.fixtures.american-dj documentation

    afterglow.fixtures.american-dj

    Definitions for fixtures provided by American DJ.

    hypnotic-rgb

    (hypnotic-rgb)

    Hypnotic RGB Laser. Red, green, and blue lasers with a web-like diffraction grating providing very pretty effects for the price.

    \ No newline at end of file +afterglow.fixtures.american-dj documentation

    afterglow.fixtures.american-dj

    Definitions for fixtures provided by American DJ.

    hypnotic-rgb

    (hypnotic-rgb)

    Hypnotic RGB Laser. Red, green, and blue lasers with a web-like diffraction grating providing very pretty effects for the price.

    \ No newline at end of file diff --git a/api-doc/afterglow.fixtures.blizzard.html b/api-doc/afterglow.fixtures.blizzard.html index d71548b5..5889d88f 100644 --- a/api-doc/afterglow.fixtures.blizzard.html +++ b/api-doc/afterglow.fixtures.blizzard.html @@ -1,15 +1,15 @@ -afterglow.fixtures.blizzard documentation

    afterglow.fixtures.blizzard

    Definitions for fixtures provided by Blizzard Lighting.

    blade-rgbw

    (blade-rgbw)(blade-rgbw mode & {:keys [hung version-2], :or {hung 0}})

    Blade RGBW moving head. The default patching orientation is sitting on its feet with the LCD and control panel right side up and facing the audience. In this orientation, at a pan of 0, the beam is straight into the audience.

    +afterglow.fixtures.blizzard documentation

    afterglow.fixtures.blizzard

    Definitions for fixtures provided by Blizzard Lighting.

    blade-rgbw

    (blade-rgbw)(blade-rgbw mode & {:keys [hung version-2], :or {hung 0}})

    Blade RGBW moving head. The default patching orientation is sitting on its feet with the LCD and control panel right side up and facing the audience. In this orientation, at a pan of 0, the beam is straight into the audience.

    The origin of the light is, as for all moving heads, at the intersection of the pan and tilt axes. That is the point that you need to reference when patching the fixture and telling Afterglow where it has been hung within show space. The image below shows this default orientation, and the axes, for the fixture. If it is hung with this side of the base facing the audience, right side up, then you do not need to specify any rotations when you patch it. Otherwise, tell Afterglow how far it has been rotated around each of the axes when hanging:

    Blade axes

    If you are hanging the light at an odd angle, or for any reason it is harder to measure the exact axis location given where where you are hanging it, you can supply an optional argument :hung after the mode argument, containing the distance in meters from the origin in the photo to the point at which it was hung (the center of the bar it is clamped to), and Afterglow will calculate where the head is based on that distance and the orientation at which you reported it hung. With the standard clamp mount and a standard O-clamp that distance seems to be twelve inches.

    The center pan value (aimed straight at the audience when hung in the default orientation described above), is defined as 84, a half revolution around from that, so that it has room to move in both directions from its resting point. It takes a change of +84 in the pan channel to rotate a half circle counterclockwise around the Y axis.

    At the center pan setting of 84, the center tilt value is 8, aiming the head straight out at the audience. At this position, it takes a change of -214 in the tilt channel to rotate a half circle counterclockwise around the X axis. (In other words, it can essentially only tilt clockwise from here.)

    This fixture can be configured to use either 11 or 15 DMX channels. If you do not specify a mode when patching it, :15-channel is assumed; you can pass a value of :11-channel for mode if you are using it that way.

    -

    The way these fixtures respond to pan and tilt values seems to have changed in a major revision in 2015. If you have a more recent model, you can pass a true value with the optional keyword argument :version-2 after mode, in which case the center pan value is 82, the center tilt value is 25, and it takes a change of -230 in the tilt channel to rotate half a circle counterclockwise around the Y axis.

    pixellicious

    (pixellicious)

    4x40 LED pixel tile in 480 channel mode.

    pixellicious-2

    (pixellicious-2)

    12x12 LED pixel tile in 432 channel mode.

    puck-fab5

    (puck-fab5)(puck-fab5 mode & {:keys [mix-amber], :or {mix-amber true}})

    Puck Fab5 RGBAW LED.

    +

    The way these fixtures respond to pan and tilt values seems to have changed in a major revision in 2015. If you have a more recent model, you can pass a true value with the optional keyword argument :version-2 after mode, in which case the center pan value is 82, the center tilt value is 25, and it takes a change of -230 in the tilt channel to rotate half a circle counterclockwise around the Y axis.

    pixellicious

    (pixellicious)

    4x40 LED pixel tile in 480 channel mode.

    pixellicious-2

    (pixellicious-2)

    12x12 LED pixel tile in 432 channel mode.

    puck-fab5

    (puck-fab5)(puck-fab5 mode & {:keys [mix-amber], :or {mix-amber true}})

    Puck Fab5 RGBAW LED.

    This fixture can be configured to use either 3, 5 or 12 DMX channels. If you do not specify a mode when patching it, :12-channel is assumed; you can pass a value of :3-channel or :5-channel for mode if you are using it that way.

    -

    When you pass a mode, you can also control whether the amber channel is mixed in when creating colors by passing a boolean value with :mix-amber. The default is true.

    snowball

    (snowball)

    Snowball multi-beam moonflower effect light.

    snowbank

    (snowbank)(snowbank mode)

    Snow Bank RGB Blinder / LED Pixel Effect.

    torrent-f3

    (torrent-f3)

    Torrent F3 moving head effects spotlight. The default patching orientation is sitting on its feet with the LCD and control panel right side up and facing the audience. In this orientation, at a pan of 0, the beam is straight into the audience.

    +

    When you pass a mode, you can also control whether the amber channel is mixed in when creating colors by passing a boolean value with :mix-amber. The default is true.

    snowball

    (snowball)

    Snowball multi-beam moonflower effect light.

    snowbank

    (snowbank)(snowbank mode)

    Snow Bank RGB Blinder / LED Pixel Effect.

    torrent-f3

    (torrent-f3)

    Torrent F3 moving head effects spotlight. The default patching orientation is sitting on its feet with the LCD and control panel right side up and facing the audience. In this orientation, at a pan of 0, the beam is straight into the audience.

    The origin of the light is, as for all moving heads, at the intersection of the pan and tilt axes. That is the point that you need to reference when patching the fixture and telling Afterglow where it has been hung within show space. The image below shows this default orientation, and the axes, for the fixture. If it is hung with this side of the base facing the audience, right side up, then you do not need to specify any rotations when you patch it. Otherwise, tell Afterglow how far it has been rotated around each of the axes when hanging:

    F3  axes

    The center pan value (aimed straight at the audience when hung in the default orientation described above), is defined as 85.5, half a revolution around from that, so that it has room to move in both directions from its resting point. It takes a change of -85.5 in the pan channel to rotate a half circle counterclockwise around the Y axis.

    @@ -19,7 +19,7 @@ (afterglow.effects.channel/function-effect "Torrents Open" :shutter-open 50 (show/fixtures-named "torrent"))) -

    weather-system

    (weather-system)(weather-system mode)

    Weather System 8-fixture LED bar. Even though this fixture does not move, it is important to patch it at the correct orientation, so Afterglow can properly reason about the spatial relationships between the eight individual heads.

    +

    weather-system

    (weather-system)(weather-system mode)

    Weather System 8-fixture LED bar. Even though this fixture does not move, it is important to patch it at the correct orientation, so Afterglow can properly reason about the spatial relationships between the eight individual heads.

    The fixture origin is right between the fourth and fifth head, at the level of the lenses. The default orientation is with the bar parallel to the X axis, and the LED display and sockets all facing away from the audience.

    Weather System axes

    -

    This fixture can be configured to use either 7 or 26 DMX channels. If you do not specify a mode when patching it, :26-channel is assumed; you can pass a value of :7-channel for mode if you are using it that way.

    \ No newline at end of file +

    This fixture can be configured to use either 7 or 26 DMX channels. If you do not specify a mode when patching it, :26-channel is assumed; you can pass a value of :7-channel for mode if you are using it that way.

    \ No newline at end of file diff --git a/api-doc/afterglow.fixtures.chauvet.html b/api-doc/afterglow.fixtures.chauvet.html index a3ddecd4..c73ca56d 100644 --- a/api-doc/afterglow.fixtures.chauvet.html +++ b/api-doc/afterglow.fixtures.chauvet.html @@ -1,27 +1,27 @@ -afterglow.fixtures.chauvet documentation

    afterglow.fixtures.chauvet

    Models for fixtures provided by Chauvet Lighting.

    color-strip

    (color-strip)

    ColorStrip LED fixture. Also works with the ColorStrip Mini.

    +afterglow.fixtures.chauvet documentation

    afterglow.fixtures.chauvet

    Models for fixtures provided by Chauvet Lighting.

    color-strip

    (color-strip)

    ColorStrip LED fixture. Also works with the ColorStrip Mini.

    This was created by Afterglow from the QLC+ Fixture Definintion (.qxf) file, and revised by James Elliott.

    The original fixture defintition was created by JL Griffin using Q Light Controller version 3.1.0.

    -

    QLC+ Fixture Type: Color Changer.

    geyser-rgb

    (geyser-rgb)

    Geyser RGB illuminated effect fogger.

    hurricane-1800-flex

    (hurricane-1800-flex)

    intimidator-scan-led-300

    (intimidator-scan-led-300)(intimidator-scan-led-300 mode)

    Intimidator Scan LED 300 compact scanner.

    +

    QLC+ Fixture Type: Color Changer.

    geyser-rgb

    (geyser-rgb)

    Geyser RGB illuminated effect fogger.

    hurricane-1800-flex

    (hurricane-1800-flex)

    intimidator-scan-led-300

    (intimidator-scan-led-300)(intimidator-scan-led-300 mode)

    Intimidator Scan LED 300 compact scanner.

    This fixture can be configured to use either 8 or 11 DMX channels. If you do not specify a mode when patching it, :11-channel is assumed; you can pass a value of :8-channel for mode if you are using it that way.

    The standard orientation to hang this fixture is with the Chauvet logo and LED upright and facing the audience, but tilted up and away from them at a 45 degree angle.

    This was created by Afterglow from the QLC+ Fixture Definintion (.qxf) file, and heavily revised by James Elliott.

    The original fixture defintition was created by Craig Cudmore using Q Light Controller Plus version 4.7.0 GIT.

    -

    QLC+ Fixture Type: Scanner.

    intimidator-spot-led-150

    (intimidator-spot-led-150)(intimidator-spot-led-150 mode)

    Intimidator Spot LED 150 moving yoke.

    +

    QLC+ Fixture Type: Scanner.

    intimidator-spot-led-150

    (intimidator-spot-led-150)(intimidator-spot-led-150 mode)

    Intimidator Spot LED 150 moving yoke.

    This fixture can be configured to use either 6 or 11 DMX channels. If you do not specify a mode when patching it, :11-channel is assumed; you can pass a value of :6-channel for mode if you are using it that way.

    The standard orientation for this fixture is hung with the Chauvet label and LED indicator upside-down and facing towards the audience.

    This was created by Afterglow from the QLC+ Fixture Definintion (.qxf) file, and heavily revised by James Elliott.

    The original fixture defintition was created by Tavon Markov using Q Light Controller Plus version 4.8.3 GIT.

    -

    QLC+ Fixture Type: Moving Head.

    kinta-x

    (kinta-x)

    Kinta X derby effect.

    led-techno-strobe

    (led-techno-strobe)

    LED Techno Strobe strobe light.

    led-techno-strobe-rgb

    (led-techno-strobe-rgb)

    LED Techno Strobe RGB color mixing strobe light.

    +

    QLC+ Fixture Type: Moving Head.

    kinta-x

    (kinta-x)

    Kinta X derby effect.

    led-techno-strobe

    (led-techno-strobe)

    LED Techno Strobe strobe light.

    led-techno-strobe-rgb

    (led-techno-strobe-rgb)

    LED Techno Strobe RGB color mixing strobe light.

    This was created by Afterglow from the QLC+ Fixture Definintion (.qxf) file, and revised by James Elliott.

    The original fixture defintition was created by Davey D using Q Light Controller Plus version 4.6.0.

    -

    QLC+ Fixture Type: Color Changer.

    q-spot-160

    (q-spot-160)(q-spot-160 mode)

    Q Spot 160 moving yoke.

    +

    QLC+ Fixture Type: Color Changer.

    q-spot-160

    (q-spot-160)(q-spot-160 mode)

    Q Spot 160 moving yoke.

    This fixture can be configured to use either 9 or 12 DMX channels. If you do not specify a mode when patching it, :12-channel is assumed; you can pass a value of :9-channel for mode if you are using it that way.

    -

    The standard hanging orientation is with the Chauvet label and LED panel upside-down and facing the house-right wall (the positive X axis direction).

    scorpion-storm-fx-rgb

    (scorpion-storm-fx-rgb)(scorpion-storm-fx-rgb mode)

    Scorpion Storm FX RGB grid effect laser.

    +

    The standard hanging orientation is with the Chauvet label and LED panel upside-down and facing the house-right wall (the positive X axis direction).

    scorpion-storm-fx-rgb

    (scorpion-storm-fx-rgb)(scorpion-storm-fx-rgb mode)

    Scorpion Storm FX RGB grid effect laser.

    This fixture can be patched to use either 7 or 2 DMX channels. If you do not specify a mode when patching it, :7-channel is assumed; you can pass a value of :2-channel for mode if you are using it that way. Although there are two different modes in which you can patch it, its behavior is controlled by the value you send in channel 1: If that value is between 0 and 50, the laser responds to all 7 channels as described by :7-channel mode; if channel 1 is set to 51 or higher, it looks only at the first two channels, as described by :2-channel mode.

    This was created by Afterglow from the QLC+ Fixture Definintion (.qxf) file, and revised by James Elliott.

    The original fixture defintition was created by Frédéric Combe using Q Light Controller Plus version 5.0.0 GIT.

    -

    QLC+ Fixture Type: Laser.

    scorpion-storm-rgx

    (scorpion-storm-rgx)

    Scorpion Storm RGX grid effect laser.

    slimpar-hex3-irc

    (slimpar-hex3-irc)(slimpar-hex3-irc mode & {:keys [mix-amber mix-uv], :or {mix-amber true, mix-uv true}})

    SlimPAR HEX 3 IRC six-color low-profile LED PAR.

    +

    QLC+ Fixture Type: Laser.

    scorpion-storm-rgx

    (scorpion-storm-rgx)

    Scorpion Storm RGX grid effect laser.

    slimpar-hex3-irc

    (slimpar-hex3-irc)(slimpar-hex3-irc mode & {:keys [mix-amber mix-uv], :or {mix-amber true, mix-uv true}})

    SlimPAR HEX 3 IRC six-color low-profile LED PAR.

    This fixture can be configured to use either 6, 8 or 12 DMX channels. If you do not specify a mode when patching it, :12-channel is assumed; you can pass a value of :6-channel or :8-channel for mode if you are using it that way.

    -

    When you pass a mode, you can also control whether the amber and UV channels are mixed in when creating colors by passing a boolean value with :mix-amber and :mix-uv. The default for each is true.

    \ No newline at end of file +

    When you pass a mode, you can also control whether the amber and UV channels are mixed in when creating colors by passing a boolean value with :mix-amber and :mix-uv. The default for each is true.

    \ No newline at end of file diff --git a/api-doc/afterglow.fixtures.html b/api-doc/afterglow.fixtures.html index 233775ec..60e1611b 100644 --- a/api-doc/afterglow.fixtures.html +++ b/api-doc/afterglow.fixtures.html @@ -1,3 +1,3 @@ -afterglow.fixtures documentation

    afterglow.fixtures

    Utility functions common to fixture definitions.

    generic-dimmmer

    (generic-dimmmer)

    A fixture definition where a single channel controls the power level of a socket to which an incandescent light source can be connected. If you are using a product such as the Chauvet DMX-4, its channels can be patched as four of these, or four generic-switch, or some combination.

    generic-switch

    (generic-switch)

    A fixture definition where a single channel turns on or off the power at a socket to which an incandescent light source or other non-DMX-enabled equipment can be connected. If you are using a product such as the Chauvet DMX-4, its channels can be patched as four of these, or four generic-dimmer, or some combination.

    index-color-wheel-hues

    (index-color-wheel-hues fixture)

    Associates color wheel hue maps with the fixture and all its heads, for easy lookup when assigning color at the end of a color effect chain.

    index-functions

    (index-functions fixture)

    Associates function maps with the fixture and all its heads, for easy lookup by function-oriented effects.

    printable

    (printable fixture-or-fixture-list)

    Strips a mapped fixture (or fixture list) of keys which make it a pain to print, such as the back links from the heads to the entire fixture, and the function maps.

    visualizer-relevant

    (visualizer-relevant fixtures-or-heads)

    Returns all the fixtures or heads which might appear in the visualizer. If the fixture or head has an explicit :visualizer-visible boolean, that is honored, otherwise it is assumed that fixtures without heads are themselves relevant, while for fixtures with heads, only the heads are relevant.

    \ No newline at end of file +afterglow.fixtures documentation

    afterglow.fixtures

    Utility functions common to fixture definitions.

    generic-dimmmer

    (generic-dimmmer)

    A fixture definition where a single channel controls the power level of a socket to which an incandescent light source can be connected. If you are using a product such as the Chauvet DMX-4, its channels can be patched as four of these, or four generic-switch, or some combination.

    generic-switch

    (generic-switch)

    A fixture definition where a single channel turns on or off the power at a socket to which an incandescent light source or other non-DMX-enabled equipment can be connected. If you are using a product such as the Chauvet DMX-4, its channels can be patched as four of these, or four generic-dimmer, or some combination.

    index-color-wheel-hues

    (index-color-wheel-hues fixture)

    Associates color wheel hue maps with the fixture and all its heads, for easy lookup when assigning color at the end of a color effect chain.

    index-functions

    (index-functions fixture)

    Associates function maps with the fixture and all its heads, for easy lookup by function-oriented effects.

    printable

    (printable fixture-or-fixture-list)

    Strips a mapped fixture (or fixture list) of keys which make it a pain to print, such as the back links from the heads to the entire fixture, and the function maps.

    visualizer-relevant

    (visualizer-relevant fixtures-or-heads)

    Returns all the fixtures or heads which might appear in the visualizer. If the fixture or head has an explicit :visualizer-visible boolean, that is honored, otherwise it is assumed that fixtures without heads are themselves relevant, while for fixtures with heads, only the heads are relevant.

    \ No newline at end of file diff --git a/api-doc/afterglow.fixtures.qxf.html b/api-doc/afterglow.fixtures.qxf.html index f6e6322b..7f2ca540 100644 --- a/api-doc/afterglow.fixtures.qxf.html +++ b/api-doc/afterglow.fixtures.qxf.html @@ -1,3 +1,3 @@ -afterglow.fixtures.qxf documentation

    afterglow.fixtures.qxf

    Functions to work with Fixture Definition Files from the QLC+ open-source lighting controller project. While these do not contain all of the information Afterglow needs to fully control a fixture with its geometric reasoning, they can form a good starting point and save you a lot of tedious capability translation. You can find the available .qxf files on Github.

    convert-qxf

    (convert-qxf path)

    Read a fixture definition file in the format (.qxf) used by QLC+, and write a Clojure file based on it that can be used as the starting point of an Afterglow fixture definition. Returns an exit status and message for the user.

    parse-qxf

    (parse-qxf source)

    Read a fixture definition file in the format (.qxf) used by QLC+, and create a map from which it can conveniently be translated into an Afterglow fixture definition.

    sanitize-name

    (sanitize-name s)

    Removes non-alphanumeric characters in a string, then turns it into a suitable Clojure identifier.

    translate-definition

    (translate-definition qxf)

    Converts a map read by convert-qxf into an Afterglow fixture definition.

    \ No newline at end of file +afterglow.fixtures.qxf documentation

    afterglow.fixtures.qxf

    Functions to work with Fixture Definition Files from the QLC+ open-source lighting controller project. While these do not contain all of the information Afterglow needs to fully control a fixture with its geometric reasoning, they can form a good starting point and save you a lot of tedious capability translation. You can find the available .qxf files on Github.

    convert-qxf

    (convert-qxf path)

    Read a fixture definition file in the format (.qxf) used by QLC+, and write a Clojure file based on it that can be used as the starting point of an Afterglow fixture definition. Returns an exit status and message for the user.

    parse-qxf

    (parse-qxf source)

    Read a fixture definition file in the format (.qxf) used by QLC+, and create a map from which it can conveniently be translated into an Afterglow fixture definition.

    sanitize-name

    (sanitize-name s)

    Removes non-alphanumeric characters in a string, then turns it into a suitable Clojure identifier.

    translate-definition

    (translate-definition qxf)

    Converts a map read by convert-qxf into an Afterglow fixture definition.

    \ No newline at end of file diff --git a/api-doc/afterglow.init.html b/api-doc/afterglow.init.html index 77993b2e..722027a7 100644 --- a/api-doc/afterglow.init.html +++ b/api-doc/afterglow.init.html @@ -1,3 +1,3 @@ -afterglow.init documentation

    afterglow.init

    This namespace is the context in which any init-files specified on the command line will be loaded during startup, in case they forget to establish their own namespaces.

    \ No newline at end of file +afterglow.init documentation

    afterglow.init

    This namespace is the context in which any init-files specified on the command line will be loaded during startup, in case they forget to establish their own namespaces.

    \ No newline at end of file diff --git a/api-doc/afterglow.midi.html b/api-doc/afterglow.midi.html index d2816730..fbd17474 100644 --- a/api-doc/afterglow.midi.html +++ b/api-doc/afterglow.midi.html @@ -1,11 +1,11 @@ -afterglow.midi documentation

    afterglow.midi

    Handles MIDI communication, including syncing a show metronome to MIDI clock pulses.

    ->ClockSync

    (->ClockSync metronome midi-clock-source timestamps means traktor-info)

    Positional factory function for class afterglow.midi.ClockSync.

    abs-tolerance

    If we are going to adjust the BPM, the adjustment we are going to make needs to represent at least this many milliseconds per MIDI clock tick (to reduce jitter).

    add-aftertouch-mapping

    (add-aftertouch-mapping device-filter channel note f)

    Register a handler function f to be called whenever a MIDI aftertouch (polyphonic key pressure) message is received from the specified device, on the specified channel and note number. Any subsequent MIDI message which matches will be passed to f as its single argument.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-control-mapping

    (add-control-mapping device-filter channel control-number f)

    Register a handler function f to be called whenever a MIDI controller change message is received from the specified device, on the specified channel and controller number. Any subsequent MIDI message which matches will be passed to f as its single argument.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-device-mapping

    (add-device-mapping device-filter f)

    Register a handler function f to be called whenever any MIDI message is received from the specified device. Any subsequent MIDI message which matches will be passed to f as its single argument.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-disconnected-device-handler!

    (add-disconnected-device-handler! device f)

    Add a function to be called whenever the specified device disappears from the MIDI environment. The device argument is a :midi-device map from overtone.midi representing device whose removal is of interest. The function must return quickly so as not to stall the delay of other MIDI events; lengthy operations must be performed on another thread.

    add-global-handler!

    (add-global-handler! f)

    Add a function to be called whenever any MIDI message is received. The function will be called with the message, and must return quickly, so as to not block delivery to other recipients.

    add-new-device-handler!

    (add-new-device-handler! f)

    Add a function to be called whenever a new device appears in the MIDI environment. It will be passed a single argument, the :midi-device map from overtone.midi representing the new device. It must return quickly so as not to stall the delay of other MIDI events; lengthy operations must be performed on another thread.

    add-note-mapping

    (add-note-mapping device-filter channel note f)

    Register a handler function f to be called whenever a MIDI note message is received from the specified device, on the specified channel and note number. Any subsequent MIDI message which matches will be passed to f as its single argument.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-sysex-mapping

    (add-sysex-mapping device-filter f)

    Register a handler function f to be called whenever a MIDI System Exclusive message is received from the specified device. Any subsequent MIDI message which matches will be passed to f as its single argument.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    bpm-to-interval

    (bpm-to-interval bpm)

    Given a BPM, calculate the interval between MIDI clock pulses in milliseconds.

    cm4j-device?

    (cm4j-device? device)

    Checks whether a MIDI device was returned by the CoreMIDI4J MIDI extension.

    cm4j-installed?

    (cm4j-installed?)

    Return true if the CoreMIDI4J MIDI extension is present.

    create-tempo-tap-handler

    (create-tempo-tap-handler metronome)

    Returns a function which implements a simple tempo-tap algorithm on the supplied metronome.

    current-clock-sources

    (current-clock-sources)

    Returns the set of MIDI input ports which are currently delivering MIDI clock messages.

    current-traktor-beat-phase-sources

    (current-traktor-beat-phase-sources)

    Returns the set of MIDI input ports which are currently delivering beat phase information in the format provided by the Afterglow Traktor controller mapping.

    describe-device-filter

    (describe-device-filter device-filter)

    Returns a description of a filter used to narrow down MIDI devices, if one was supplied, or the empty string if none was.

    dev-tolerance

    If we are going to adjust the BPM, the adjustment must be at least this many times the standard deviation in observed clock pulse timings, so we can avoid jitter due to unstable timing.

    filter-devices

    (filter-devices device-filter devices)

    Return only those devices matching the supplied device-filter.

    +afterglow.midi documentation

    afterglow.midi

    Handles MIDI communication, including syncing a show metronome to MIDI clock pulses.

    ->ClockSync

    (->ClockSync metronome midi-clock-source timestamps means traktor-info)

    Positional factory function for class afterglow.midi.ClockSync.

    abs-tolerance

    If we are going to adjust the BPM, the adjustment we are going to make needs to represent at least this many milliseconds per MIDI clock tick (to reduce jitter).

    add-aftertouch-mapping

    (add-aftertouch-mapping device-filter channel note f)

    Register a handler function f to be called whenever a MIDI aftertouch (polyphonic key pressure) message is received from the specified device, on the specified channel and note number. Any subsequent MIDI message which matches will be passed to f as its single argument.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-control-mapping

    (add-control-mapping device-filter channel control-number f)

    Register a handler function f to be called whenever a MIDI controller change message is received from the specified device, on the specified channel and controller number. Any subsequent MIDI message which matches will be passed to f as its single argument.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-device-mapping

    (add-device-mapping device-filter f)

    Register a handler function f to be called whenever any MIDI message is received from the specified device. Any subsequent MIDI message which matches will be passed to f as its single argument.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-disconnected-device-handler!

    (add-disconnected-device-handler! device f)

    Add a function to be called whenever the specified device disappears from the MIDI environment. The device argument is a :midi-device map from overtone.midi representing device whose removal is of interest. The function must return quickly so as not to stall the delay of other MIDI events; lengthy operations must be performed on another thread.

    add-global-handler!

    (add-global-handler! f)

    Add a function to be called whenever any MIDI message is received. The function will be called with the message, and must return quickly, so as to not block delivery to other recipients.

    add-new-device-handler!

    (add-new-device-handler! f)

    Add a function to be called whenever a new device appears in the MIDI environment. It will be passed a single argument, the :midi-device map from overtone.midi representing the new device. It must return quickly so as not to stall the delay of other MIDI events; lengthy operations must be performed on another thread.

    add-note-mapping

    (add-note-mapping device-filter channel note f)

    Register a handler function f to be called whenever a MIDI note message is received from the specified device, on the specified channel and note number. Any subsequent MIDI message which matches will be passed to f as its single argument.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    add-sysex-mapping

    (add-sysex-mapping device-filter f)

    Register a handler function f to be called whenever a MIDI System Exclusive message is received from the specified device. Any subsequent MIDI message which matches will be passed to f as its single argument.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    bpm-to-interval

    (bpm-to-interval bpm)

    Given a BPM, calculate the interval between MIDI clock pulses in milliseconds.

    cm4j-device?

    (cm4j-device? device)

    Checks whether a MIDI device was returned by the CoreMIDI4J MIDI extension.

    cm4j-installed?

    (cm4j-installed?)

    Return true if the CoreMIDI4J MIDI extension is present.

    create-tempo-tap-handler

    (create-tempo-tap-handler metronome)

    Returns a function which implements a simple tempo-tap algorithm on the supplied metronome.

    current-clock-sources

    (current-clock-sources)

    Returns the set of MIDI input ports which are currently delivering MIDI clock messages.

    current-traktor-beat-phase-sources

    (current-traktor-beat-phase-sources)

    Returns the set of MIDI input ports which are currently delivering beat phase information in the format provided by the Afterglow Traktor controller mapping.

    describe-device-filter

    (describe-device-filter device-filter)

    Returns a description of a filter used to narrow down MIDI devices, if one was supplied, or the empty string if none was.

    dev-tolerance

    If we are going to adjust the BPM, the adjustment must be at least this many times the standard deviation in observed clock pulse timings, so we can avoid jitter due to unstable timing.

    filter-devices

    (filter-devices device-filter devices)

    Return only those devices matching the supplied device-filter.

    The elements of devices must all be :midi-device maps as returned by overtone.midi.

    If device-filter is nil or an empty string, devices is returned unfiltered. Otherwise it can be one of the following things:

      @@ -22,7 +22,7 @@
    • A function, which will be called with each device, and the device will be included if the function returns a true value.

    -

    Anything else will be converted to a string and matched as above.

    find-midi-in

    (find-midi-in device-filter)(find-midi-in device-filter required)

    Find the first MIDI input port matching the specified device-filter using filter-devices, or throw an exception if no matches can be found. The exception can be suppressed by passing a false value for the optional second argument required.

    find-midi-out

    (find-midi-out device-filter)(find-midi-out device-filter required)

    Find the first MIDI output port matching the specified device-filter using filter-devices, or throw an exception if no matches can be found. The exception can be suppressed by passing a false value for the optional second argument required.

    IClockSync

    protocol

    A simple protocol for our clock sync object, allowing it to be started and stopped, and the status checked.

    members

    sync-start

    (sync-start this)

    Start synchronizing your metronome.

    sync-status

    (sync-status this)

    Report on how well synchronization is working. Returns a map with keys :type (a keyword that uniquely identifies the kind of sync in effect, currently chosen from :manual, :midi, and :dj-link), :current (true if sync appears to be working at the present time), :level (a keyword that indicates how strong of a sync is being performed; :bpm means basic BPM following, :beat adds tracking of beat locations, :bar adds tracking of bar starts (down beats), and :phrase would add tracking of phrase starts, if any sync mechanism ever offers that), and :status, which is a human-oriented summmary of the status.

    sync-stop

    (sync-stop this)

    Stop synchronizing your metronome.

    identify-mapping

    (identify-mapping)(identify-mapping timeout)

    Report on the next MIDI control or note message received, to aid in setting up a mapping to a button, fader, or knob. Call this, then twiddle the knob, press the button, or move the fader, and see what Afterglow received. Pass a timeout in ms to control how long it will wait for a message (the default is ten seconds). This is an upper limit; if a message is received before the timeout, it will be reported immediately.

    interval-to-bpm

    (interval-to-bpm interval)

    Given an interval between MIDI clock pulses in milliseconds, calculate the implied beats per minute value, to the nearest hundredth of a beat.

    mac?

    (mac?)

    Return true if we seem to be running on a Mac.

    map->ClockSync

    (map->ClockSync m__6522__auto__)

    Factory function for class afterglow.midi.ClockSync, taking a map of keywords to field values.

    midi-device-key

    Contains a function which returns the key by which an overtone.midi :midi-device map should be indexed in a map. This must be a value which is unique to each device, and stable over time as long as that device is present in the MIDI environment. The first time midi-device-key is dereferenced, the function is created. The same function is returned whenever it is dereferenced in the future.

    midi-port-filter

    Contains a filter which selects midi inputs and outputs we actually want to use. The first time the value is dereferenced, a filter appropriate to the current environment will be created, and that filter will be returned whenever the value is dereferenced again.

    +

    Anything else will be converted to a string and matched as above.

    find-midi-in

    (find-midi-in device-filter)(find-midi-in device-filter required)

    Find the first MIDI input port matching the specified device-filter using filter-devices, or throw an exception if no matches can be found. The exception can be suppressed by passing a false value for the optional second argument required.

    find-midi-out

    (find-midi-out device-filter)(find-midi-out device-filter required)

    Find the first MIDI output port matching the specified device-filter using filter-devices, or throw an exception if no matches can be found. The exception can be suppressed by passing a false value for the optional second argument required.

    IClockSync

    protocol

    A simple protocol for our clock sync object, allowing it to be started and stopped, and the status checked.

    members

    sync-start

    (sync-start this)

    Start synchronizing your metronome.

    sync-status

    (sync-status this)

    Report on how well synchronization is working. Returns a map with keys :type (a keyword that uniquely identifies the kind of sync in effect, currently chosen from :manual, :midi, and :dj-link), :current (true if sync appears to be working at the present time), :level (a keyword that indicates how strong of a sync is being performed; :bpm means basic BPM following, :beat adds tracking of beat locations, :bar adds tracking of bar starts (down beats), and :phrase would add tracking of phrase starts, if any sync mechanism ever offers that), and :status, which is a human-oriented summmary of the status.

    sync-stop

    (sync-stop this)

    Stop synchronizing your metronome.

    identify-mapping

    (identify-mapping)(identify-mapping timeout)

    Report on the next MIDI control or note message received, to aid in setting up a mapping to a button, fader, or knob. Call this, then twiddle the knob, press the button, or move the fader, and see what Afterglow received. Pass a timeout in ms to control how long it will wait for a message (the default is ten seconds). This is an upper limit; if a message is received before the timeout, it will be reported immediately.

    interval-to-bpm

    (interval-to-bpm interval)

    Given an interval between MIDI clock pulses in milliseconds, calculate the implied beats per minute value, to the nearest hundredth of a beat.

    mac?

    (mac?)

    Return true if we seem to be running on a Mac.

    map->ClockSync

    (map->ClockSync m__6522__auto__)

    Factory function for class afterglow.midi.ClockSync, taking a map of keywords to field values.

    midi-device-key

    Contains a function which returns the key by which an overtone.midi :midi-device map should be indexed in a map. This must be a value which is unique to each device, and stable over time as long as that device is present in the MIDI environment. The first time midi-device-key is dereferenced, the function is created. The same function is returned whenever it is dereferenced in the future.

    midi-port-filter

    Contains a filter which selects midi inputs and outputs we actually want to use. The first time the value is dereferenced, a filter appropriate to the current environment will be created, and that filter will be returned whenever the value is dereferenced again.

    • If this is a Mac, and the CoreMIDI4J MIDI extension is present and working, the filter will accept only its devices.

    • @@ -30,14 +30,14 @@

      Otherwise, if the Humatic MMJ extension is operating (also on a Mac), the filter which will accept only MMJ’s versions of ports which it offers in parallel with the standard implementation, but will accept the standard SPI’s implementation of ports which MMJ does not offer.

    • Otherwise, the filter accepts all ports.

    • -

    mmj-device?

    (mmj-device? device)

    Checks whether a MIDI device was returned by the Humatic mmj MIDI extension.

    mmj-installed?

    (mmj-installed?)

    Return true if the Humatic mmj MIDI extension is present.

    open-inputs-if-needed!

    (open-inputs-if-needed!)

    Make sure the MIDI input ports are open and ready to distribute events. Returns the :midi-device maps returned by overtone.midi representing the opened inputs.

    open-outputs-if-needed!

    (open-outputs-if-needed!)

    Make sure the MIDI output ports are open and ready to receive events. Returns the :midi-device maps returned by overtone.midi representing the opened outputs.

    remove-aftertouch-mapping

    (remove-aftertouch-mapping device-filter channel note f)

    Unregister a handler previously registered with add-aftertouch-mapping.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-control-mapping

    (remove-control-mapping device-filter channel control-number f)

    Unregister a handler previously registered with add-control-mapping.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-device-mapping

    (remove-device-mapping device-filter f)

    Unregister a handler previously registered with add-device-mapping.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-disconnected-device-handler!

    (remove-disconnected-device-handler! device f)

    No longer call the specified function if specified device disappears from the MIDI environment. The device argument is a :midi-device map from overtone.midi representing device whose removal is no longer of interest.

    remove-global-handler!

    (remove-global-handler! f)

    Remove a function that was being called whenever any MIDI message is received.

    remove-new-device-handler!

    (remove-new-device-handler! f)

    Stop calling the specified function to be called whenever a new device appears in the MIDI environment.

    remove-note-mapping

    (remove-note-mapping device-filter channel note f)

    Unregister a handler previously registered with add-note-mapping.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-sysex-mapping

    (remove-sysex-mapping device-filter f)

    Unregister a handler previously registered with add-sysex-mapping.

    -

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    same-device?

    (same-device? a b)

    Checks whether two :midi-device maps seem to refer to the same device, in a slightly more efficient way than comparing the entire map.

    scan-interval

    How often should we scan for changes in the MIDI environment (devices that have been disconnected, or new devices which have connected). This is used only when CoreMIDI4J is not installed, sine CoreMIDI4J gives us proactive notification of changes to the MIDI environment. The value is in milliseconds, so the default means to check every two seconds. Changes to this value will take effect after the next scan completes.

    scan-midi-environment

    (scan-midi-environment)

    Called either periodically to check for changes, or, if CoreMidi4J is installed, proactively in response to a reported change in the MIDI environment. Updates our notion of what MIDI devices are available, and notifies registered listeners of any changes.

    -

    Also sets up the thread used to process incoming MIDI events if that is not already running, and arranges for this function to be called as needed to keep up with future changes in the MIDI environment.

    std-dev

    (std-dev samples)(std-dev samples n mean)

    Calculate the standard deviation of a set of samples.

    sync-to-midi-clock

    (sync-to-midi-clock)(sync-to-midi-clock device-filter)

    Returns a sync function that will cause the beats-per-minute setting of the supplied metronome to track the MIDI clock messages received from the named MIDI source. This is intended for use with afterglow.show/sync-to-external-clock.

    -

    The device-filter argument is only needed if there is more than one connected device sending MIDI clock messages when this function is invoked; it will be used to filter the eligible devices using filter-devices. An exception will be thrown if there is not exactly one matching eligible MIDI clock source.

    watch-for

    (watch-for device-filter found-fn & {:keys [lost-fn sleep-time], :or {sleep-time 1000}})

    Watches for a device that matches device-filter (using filter-devices). If it is present when this function is called, or whenever a matching device is connected in the future (as long as none already was), found-fn will be called, with no arguments. This is useful for setting up MIDI mappings to the device whenever it is present. If the device is disconnected and later reconnected, found-fn will be called again, so those bindings can be counted on to be present whenver the device is available.

    +

    mmj-device?

    (mmj-device? device)

    Checks whether a MIDI device was returned by the Humatic mmj MIDI extension.

    mmj-installed?

    (mmj-installed?)

    Return true if the Humatic mmj MIDI extension is present.

    open-inputs-if-needed!

    (open-inputs-if-needed!)

    Make sure the MIDI input ports are open and ready to distribute events. Returns the :midi-device maps returned by overtone.midi representing the opened inputs.

    open-outputs-if-needed!

    (open-outputs-if-needed!)

    Make sure the MIDI output ports are open and ready to receive events. Returns the :midi-device maps returned by overtone.midi representing the opened outputs.

    remove-aftertouch-mapping

    (remove-aftertouch-mapping device-filter channel note f)

    Unregister a handler previously registered with add-aftertouch-mapping.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-control-mapping

    (remove-control-mapping device-filter channel control-number f)

    Unregister a handler previously registered with add-control-mapping.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-device-mapping

    (remove-device-mapping device-filter f)

    Unregister a handler previously registered with add-device-mapping.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-disconnected-device-handler!

    (remove-disconnected-device-handler! device f)

    No longer call the specified function if specified device disappears from the MIDI environment. The device argument is a :midi-device map from overtone.midi representing device whose removal is no longer of interest.

    remove-global-handler!

    (remove-global-handler! f)

    Remove a function that was being called whenever any MIDI message is received.

    remove-new-device-handler!

    (remove-new-device-handler! f)

    Stop calling the specified function to be called whenever a new device appears in the MIDI environment.

    remove-note-mapping

    (remove-note-mapping device-filter channel note f)

    Unregister a handler previously registered with add-note-mapping.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    remove-sysex-mapping

    (remove-sysex-mapping device-filter f)

    Unregister a handler previously registered with add-sysex-mapping.

    +

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    same-device?

    (same-device? a b)

    Checks whether two :midi-device maps seem to refer to the same device, in a slightly more efficient way than comparing the entire map.

    scan-interval

    How often should we scan for changes in the MIDI environment (devices that have been disconnected, or new devices which have connected). This is used only when CoreMIDI4J is not installed, sine CoreMIDI4J gives us proactive notification of changes to the MIDI environment. The value is in milliseconds, so the default means to check every two seconds. Changes to this value will take effect after the next scan completes.

    scan-midi-environment

    (scan-midi-environment)

    Called either periodically to check for changes, or, if CoreMidi4J is installed, proactively in response to a reported change in the MIDI environment. Updates our notion of what MIDI devices are available, and notifies registered listeners of any changes.

    +

    Also sets up the thread used to process incoming MIDI events if that is not already running, and arranges for this function to be called as needed to keep up with future changes in the MIDI environment.

    std-dev

    (std-dev samples)(std-dev samples n mean)

    Calculate the standard deviation of a set of samples.

    sync-to-midi-clock

    (sync-to-midi-clock)(sync-to-midi-clock device-filter)

    Returns a sync function that will cause the beats-per-minute setting of the supplied metronome to track the MIDI clock messages received from the named MIDI source. This is intended for use with afterglow.show/sync-to-external-clock.

    +

    The device-filter argument is only needed if there is more than one connected device sending MIDI clock messages when this function is invoked; it will be used to filter the eligible devices using filter-devices. An exception will be thrown if there is not exactly one matching eligible MIDI clock source.

    watch-for

    (watch-for device-filter found-fn & {:keys [lost-fn sleep-time], :or {sleep-time 1000}})

    Watches for a device that matches device-filter (using filter-devices). If it is present when this function is called, or whenever a matching device is connected in the future (as long as none already was), found-fn will be called, with no arguments. This is useful for setting up MIDI mappings to the device whenever it is present. If the device is disconnected and later reconnected, found-fn will be called again, so those bindings can be counted on to be present whenver the device is available.

    If there is any cleanup that you need to perform when the device is disconnected, you can pass the optional keyword argument :lost-fn along with a function to be called (also with no arguments) whenever a device reported by found-fn has disappeared. You do not need to use :lost-fn to clean up MIDI bindings created by found-fn, because Afterglow automatically cleans up any MIDI bindings for devices which have been disconnected. But if you have your own data structures or state that you want to update, you can use :lost-fn to do that.

    In order to give the newly-attached device time to stabilize before trying to send messages to it, watch-for waits for a second after it is seen before calling found-fn. If your device needs more (or less) time to stabilize, you can pass a number of milliseconds after the optional keyword argument :sleep-time to configure this delay.

    -

    The return value of watch-for is a function that you can call to cancel the watcher if you no longer need it.

    \ No newline at end of file +

    The return value of watch-for is a function that you can call to cancel the watcher if you no longer need it.

    \ No newline at end of file diff --git a/api-doc/afterglow.rhythm.html b/api-doc/afterglow.rhythm.html index 336d98aa..b034c66c 100644 --- a/api-doc/afterglow.rhythm.html +++ b/api-doc/afterglow.rhythm.html @@ -1,3 +1,3 @@ -afterglow.rhythm documentation

    afterglow.rhythm

    Functions to help work with musical time, evolved from the original version in Overtone.

    ->Metronome

    (->Metronome start bpm bpb bpp)

    Positional factory function for class afterglow.rhythm.Metronome.

    ->MetronomeSnapshot

    (->MetronomeSnapshot start bpm bpb bpp instant beat bar phrase beat-phase bar-phase phrase-phase)

    Positional factory function for class afterglow.rhythm.MetronomeSnapshot.

    beat-ms

    (beat-ms b bpm)

    Convert b beats to milliseconds at the given bpm.

    enhanced-phase

    (enhanced-phase marker phase desired-ratio)

    Calculate a phase with respect to multiples or fractions of a marker (beat, bar, or phrase), given the phase with respect to that marker, the number of that marker, and the desired ratio. A desired-ratio of 1 returns the phase unchanged; 1/2 oscillates twice as fast, 3/4 oscillates 4 times every three markers…

    IMetronome

    protocol

    A time-keeping tool for music-related systems.

    members

    metro-add-bpm-watch

    (metro-add-bpm-watch metro key f)

    Register a function to be called whenever the metronome’s BPM changes. The key and function arguments are the same as found in clojure.core/add-watch, and in fact are passed on to it.

    metro-adjust

    (metro-adjust metro ms)

    Adds a number of milliseconds to the start time of the metronome.

    metro-bar

    (metro-bar metro)(metro-bar metro bar)

    Returns the next bar number or the timestamp (in milliseconds) of the given bar.

    metro-bar-phase

    (metro-bar-phase metro)(metro-bar-phase metro phase)

    Returns the distance traveled into the current bar as a phase number ranging from [0.0, 1.0), or adjusts the phase to match the one supplied.

    metro-bar-start

    (metro-bar-start metro start-bar)

    Restarts the metronome at start-bar, keeping the beat phase unchanged in case it is being synced to an external source.

    metro-beat

    (metro-beat metro)(metro-beat metro beat)

    Returns the next beat number or the timestamp (in milliseconds) of the given beat.

    metro-beat-phase

    (metro-beat-phase metro)(metro-beat-phase metro phase)

    Returns the distance traveled into the current beat as a phase number ranging from [0.0, 1.0), or adjusts the phase to match the one supplied.

    metro-bpb

    (metro-bpb metro)(metro-bpb metro new-bpb)

    Get the current beats per bar or change it to new-bpb

    metro-bpm

    (metro-bpm metro)(metro-bpm metro new-bpm)

    Get the current bpm or change the bpm to new-bpm.

    metro-bpp

    (metro-bpp metro)(metro-bpp metro new-bpp)

    Get the current bars per phrase, or change it to new-bpp

    metro-ding

    (metro-ding metro)

    Returns the duration of one phrase in milliseconds.

    metro-marker

    (metro-marker metro)

    Returns the current time as "phrase.bar.beat"

    metro-phrase

    (metro-phrase metro)(metro-phrase metro phrase)

    Returns the next phrase number or the timestamp (in milliseconds) of the given phrase.

    metro-phrase-phase

    (metro-phrase-phase metro)(metro-phrase-phase metro phase)

    Returns the distance traveled into the current phrase as a phase number ranging from [0.0, 1.0), or adjusts the phase to match the one supplied.

    metro-phrase-start

    (metro-phrase-start metro start-phrase)

    Restarts the metronome at start-phrase, keeping the beat phase unchanged in case it is being synced to an external source.

    metro-remove-bpm-watch

    (metro-remove-bpm-watch metro key)

    Stop calling the function which was registered with the specified key.

    metro-snapshot

    (metro-snapshot metro)(metro-snapshot metro instant)

    Take a snapshot of the current beat, bar, phrase, and phase state. If instant is supplied, calculates a snapshot for the corresponding time rather than the current time.

    metro-start

    (metro-start metro)(metro-start metro start-beat)

    Returns the start time of the metronome. Also restarts the metronome at start-beat if given.

    metro-tick

    (metro-tick metro)

    Returns the duration of one beat in milleseconds.

    metro-tock

    (metro-tock metro)

    Returns the duration of one bar in milliseconds.

    ISnapshot

    protocol

    A snapshot to support a series of beat and phase calculations with respect to a given instant in time. Used by Afterglow so that all phase computations performed when updating a frame of DMX data have a consistent sense of when they are being run, to avoid, for example, half the lights acting as if they are at the very end of a beat while the rest are at the beginning of the next beat, due to a fluke in timing as their evaluation occurs over time. Snapshots also extend the notions of beat phase to enable oscillators with frequencies that are fractions or multiples of a beat.

    members

    snapshot-bar-phase

    (snapshot-bar-phase snapshot)(snapshot-bar-phase snapshot bar-ratio)

    Determine the metronome’s phase at the time of the snapshot with respect to a multiple or fraction of bars. Calling this with a bar-ratio of 1 (the default if not provided) is equivalent to metro-bar-phase, calling with a bar-ratio equal to metro-bpp is equivalent to metro-phrase-phase, 1/2 oscillates twice as fast as 1, 3/4 oscillates 4 times every three bars… Phases range from [0-1).

    snapshot-bar-within-phrase

    (snapshot-bar-within-phrase snapshot)

    Returns the bar number within the snapshot relative to the start of the phrase: Ranges from 1 to the value returned by metro-bpp for the metronome.

    snapshot-beat-phase

    (snapshot-beat-phase snapshot)(snapshot-beat-phase snapshot beat-ratio)

    Determine the metronome’s phase at the time of the snapshot with respect to a multiple or fraction of beats. Calling this with a beat-ratio of 1 (the default if not provided) is equivalent to metro-beat-phase, calling with a beat-ratio equal to metro-bpb is equivalent to metro-bar-phase, 1/2 oscillates twice as fast as 1, 3/4 oscillates 4 times every three beats… Phases range from [0-1).

    snapshot-beat-within-bar

    (snapshot-beat-within-bar snapshot)

    Returns the beat number within the snapshot relative to the start of the bar: The down beat is 1, and the range goes up to the value returned by metro-bpb for the metronome.

    snapshot-beat-within-phrase

    (snapshot-beat-within-phrase snapshot)

    Returns the beat number within the snapshot relative to the start of the phrase: The first beat is 1, and the range goes up to the values returned by metro-bpb times metro-bpp for the metronome.

    snapshot-down-beat?

    (snapshot-down-beat? snapshot)

    True if the current beat at the time of the snapshot was the first beat in its bar.

    snapshot-marker

    (snapshot-marker snapshot)

    Returns the time represented by the snapshot as "phrase.bar.beat

    snapshot-phrase-phase

    (snapshot-phrase-phase snapshot)(snapshot-phrase-phase snapshot phrase-ratio)

    Determine the metronome’s phase at the time of the snapshot with respect to a multiple or fraction of phrases. Calling this with a phrase-ratio of 1 (the default if not provided) is equivalent to metro-phrase-phase, 1/2 oscillates twice as fast as 1, 3/4 oscillates 4 times every three bars… Phases range from [0-1).

    snapshot-phrase-start?

    (snapshot-phrase-start? snapshot)

    True if the current beat at the time of the snapshot wass the first beat in its phrase.

    map->Metronome

    (map->Metronome m__6522__auto__)

    Factory function for class afterglow.rhythm.Metronome, taking a map of keywords to field values.

    map->MetronomeSnapshot

    (map->MetronomeSnapshot m__6522__auto__)

    Factory function for class afterglow.rhythm.MetronomeSnapshot, taking a map of keywords to field values.

    marker-number

    (marker-number instant start interval)

    Helper function to calculate the beat, bar, or phrase number in effect at a given instant (in milliseconds), given a starting point (start, also in milliseconds), and the interval (also in milliseconds) between beats, bars, or phrases.

    marker-phase

    (marker-phase instant start interval)

    Helper function to calculate the beat, bar, or phrase phase at a given instant (in millseconds), given a start time (also in milliseconds) and interval (in milliseconds).

    metronome

    (metronome bpm & {:keys [bpb bpp], :or {bpb 4, bpp 8}})

    A metronome is a beat management tool. Tell it what BPM you want, and it will compute beat, bar, and phrase timestamps accordingly. See the IMetronome interface for full details.

    normalize-phase

    (normalize-phase phase)

    Makes sure a phase value is in the range [0.0,1.0)

    \ No newline at end of file +afterglow.rhythm documentation

    afterglow.rhythm

    Functions to help work with musical time, evolved from the original version in Overtone.

    ->Metronome

    (->Metronome start bpm bpb bpp)

    Positional factory function for class afterglow.rhythm.Metronome.

    ->MetronomeSnapshot

    (->MetronomeSnapshot start bpm bpb bpp instant beat bar phrase beat-phase bar-phase phrase-phase)

    Positional factory function for class afterglow.rhythm.MetronomeSnapshot.

    beat-ms

    (beat-ms b bpm)

    Convert b beats to milliseconds at the given bpm.

    enhanced-phase

    (enhanced-phase marker phase desired-ratio)

    Calculate a phase with respect to multiples or fractions of a marker (beat, bar, or phrase), given the phase with respect to that marker, the number of that marker, and the desired ratio. A desired-ratio of 1 returns the phase unchanged; 1/2 oscillates twice as fast, 3/4 oscillates 4 times every three markers…

    IMetronome

    protocol

    A time-keeping tool for music-related systems.

    members

    metro-add-bpm-watch

    (metro-add-bpm-watch metro key f)

    Register a function to be called whenever the metronome’s BPM changes. The key and function arguments are the same as found in clojure.core/add-watch, and in fact are passed on to it.

    metro-adjust

    (metro-adjust metro ms)

    Adds a number of milliseconds to the start time of the metronome.

    metro-bar

    (metro-bar metro)(metro-bar metro bar)

    Returns the next bar number or the timestamp (in milliseconds) of the given bar.

    metro-bar-phase

    (metro-bar-phase metro)(metro-bar-phase metro phase)

    Returns the distance traveled into the current bar as a phase number ranging from [0.0, 1.0), or adjusts the phase to match the one supplied.

    metro-bar-start

    (metro-bar-start metro start-bar)

    Restarts the metronome at start-bar, keeping the beat phase unchanged in case it is being synced to an external source.

    metro-beat

    (metro-beat metro)(metro-beat metro beat)

    Returns the next beat number or the timestamp (in milliseconds) of the given beat.

    metro-beat-phase

    (metro-beat-phase metro)(metro-beat-phase metro phase)

    Returns the distance traveled into the current beat as a phase number ranging from [0.0, 1.0), or adjusts the phase to match the one supplied.

    metro-bpb

    (metro-bpb metro)(metro-bpb metro new-bpb)

    Get the current beats per bar or change it to new-bpb

    metro-bpm

    (metro-bpm metro)(metro-bpm metro new-bpm)

    Get the current bpm or change the bpm to new-bpm.

    metro-bpp

    (metro-bpp metro)(metro-bpp metro new-bpp)

    Get the current bars per phrase, or change it to new-bpp

    metro-ding

    (metro-ding metro)

    Returns the duration of one phrase in milliseconds.

    metro-marker

    (metro-marker metro)

    Returns the current time as "phrase.bar.beat"

    metro-phrase

    (metro-phrase metro)(metro-phrase metro phrase)

    Returns the next phrase number or the timestamp (in milliseconds) of the given phrase.

    metro-phrase-phase

    (metro-phrase-phase metro)(metro-phrase-phase metro phase)

    Returns the distance traveled into the current phrase as a phase number ranging from [0.0, 1.0), or adjusts the phase to match the one supplied.

    metro-phrase-start

    (metro-phrase-start metro start-phrase)

    Restarts the metronome at start-phrase, keeping the beat phase unchanged in case it is being synced to an external source.

    metro-remove-bpm-watch

    (metro-remove-bpm-watch metro key)

    Stop calling the function which was registered with the specified key.

    metro-snapshot

    (metro-snapshot metro)(metro-snapshot metro instant)

    Take a snapshot of the current beat, bar, phrase, and phase state. If instant is supplied, calculates a snapshot for the corresponding time rather than the current time.

    metro-start

    (metro-start metro)(metro-start metro start-beat)

    Returns the start time of the metronome. Also restarts the metronome at start-beat if given.

    metro-tick

    (metro-tick metro)

    Returns the duration of one beat in milleseconds.

    metro-tock

    (metro-tock metro)

    Returns the duration of one bar in milliseconds.

    ISnapshot

    protocol

    A snapshot to support a series of beat and phase calculations with respect to a given instant in time. Used by Afterglow so that all phase computations performed when updating a frame of DMX data have a consistent sense of when they are being run, to avoid, for example, half the lights acting as if they are at the very end of a beat while the rest are at the beginning of the next beat, due to a fluke in timing as their evaluation occurs over time. Snapshots also extend the notions of beat phase to enable oscillators with frequencies that are fractions or multiples of a beat.

    members

    snapshot-bar-phase

    (snapshot-bar-phase snapshot)(snapshot-bar-phase snapshot bar-ratio)

    Determine the metronome’s phase at the time of the snapshot with respect to a multiple or fraction of bars. Calling this with a bar-ratio of 1 (the default if not provided) is equivalent to metro-bar-phase, calling with a bar-ratio equal to metro-bpp is equivalent to metro-phrase-phase, 1/2 oscillates twice as fast as 1, 3/4 oscillates 4 times every three bars… Phases range from [0-1).

    snapshot-bar-within-phrase

    (snapshot-bar-within-phrase snapshot)

    Returns the bar number within the snapshot relative to the start of the phrase: Ranges from 1 to the value returned by metro-bpp for the metronome.

    snapshot-beat-phase

    (snapshot-beat-phase snapshot)(snapshot-beat-phase snapshot beat-ratio)

    Determine the metronome’s phase at the time of the snapshot with respect to a multiple or fraction of beats. Calling this with a beat-ratio of 1 (the default if not provided) is equivalent to metro-beat-phase, calling with a beat-ratio equal to metro-bpb is equivalent to metro-bar-phase, 1/2 oscillates twice as fast as 1, 3/4 oscillates 4 times every three beats… Phases range from [0-1).

    snapshot-beat-within-bar

    (snapshot-beat-within-bar snapshot)

    Returns the beat number within the snapshot relative to the start of the bar: The down beat is 1, and the range goes up to the value returned by metro-bpb for the metronome.

    snapshot-beat-within-phrase

    (snapshot-beat-within-phrase snapshot)

    Returns the beat number within the snapshot relative to the start of the phrase: The first beat is 1, and the range goes up to the values returned by metro-bpb times metro-bpp for the metronome.

    snapshot-down-beat?

    (snapshot-down-beat? snapshot)

    True if the current beat at the time of the snapshot was the first beat in its bar.

    snapshot-marker

    (snapshot-marker snapshot)

    Returns the time represented by the snapshot as "phrase.bar.beat

    snapshot-phrase-phase

    (snapshot-phrase-phase snapshot)(snapshot-phrase-phase snapshot phrase-ratio)

    Determine the metronome’s phase at the time of the snapshot with respect to a multiple or fraction of phrases. Calling this with a phrase-ratio of 1 (the default if not provided) is equivalent to metro-phrase-phase, 1/2 oscillates twice as fast as 1, 3/4 oscillates 4 times every three bars… Phases range from [0-1).

    snapshot-phrase-start?

    (snapshot-phrase-start? snapshot)

    True if the current beat at the time of the snapshot wass the first beat in its phrase.

    map->Metronome

    (map->Metronome m__6522__auto__)

    Factory function for class afterglow.rhythm.Metronome, taking a map of keywords to field values.

    map->MetronomeSnapshot

    (map->MetronomeSnapshot m__6522__auto__)

    Factory function for class afterglow.rhythm.MetronomeSnapshot, taking a map of keywords to field values.

    marker-number

    (marker-number instant start interval)

    Helper function to calculate the beat, bar, or phrase number in effect at a given instant (in milliseconds), given a starting point (start, also in milliseconds), and the interval (also in milliseconds) between beats, bars, or phrases.

    marker-phase

    (marker-phase instant start interval)

    Helper function to calculate the beat, bar, or phrase phase at a given instant (in millseconds), given a start time (also in milliseconds) and interval (in milliseconds).

    metronome

    (metronome bpm & {:keys [bpb bpp], :or {bpb 4, bpp 8}})

    A metronome is a beat management tool. Tell it what BPM you want, and it will compute beat, bar, and phrase timestamps accordingly. See the IMetronome interface for full details.

    normalize-phase

    (normalize-phase phase)

    Makes sure a phase value is in the range [0.0,1.0)

    \ No newline at end of file diff --git a/api-doc/afterglow.show-context.html b/api-doc/afterglow.show-context.html index f84631e8..5f401b57 100644 --- a/api-doc/afterglow.show-context.html +++ b/api-doc/afterglow.show-context.html @@ -1,4 +1,4 @@ -afterglow.show-context documentation

    afterglow.show-context

    Establishes a notion of the current show using the dynamic var *show*, to save having to pass it as a parameter to dozens of functions in the Afterglow API. This needs to be bound to a value for many Afterglow functions to work.

    -

    The current show can be set locally using with-show, which is what you should do when you have multiple light shows active. However, in the extremely common case of defining and running only a single lighr show, you can also establish a default show, using set-default-show!, and omit even the with-show wrappers.

    *show*

    dynamic

    The light show on which Afterglow functions should operate, defined as a dynamic variable so it does not need to be passed as an argument to dozens of functions. The current show can be established locally using with-show, or, if you are only creating and using a single light show, which is a very common situation, you can globally establish a default value by calling set-default-show!.

    set-default-show!

    (set-default-show! show)

    Establish the specified show as the default, so that functions that have not been wrapped inside with-show contexts will act on it. This makes sense when you are only working with one light show and do not want to have to use with-show all the time.

    with-show

    macro

    (with-show show & body)

    Execute the body in the context of the specified light show, so Afterglow knows what show should be affected by its statements.

    \ No newline at end of file +afterglow.show-context documentation

    afterglow.show-context

    Establishes a notion of the current show using the dynamic var *show*, to save having to pass it as a parameter to dozens of functions in the Afterglow API. This needs to be bound to a value for many Afterglow functions to work.

    +

    The current show can be set locally using with-show, which is what you should do when you have multiple light shows active. However, in the extremely common case of defining and running only a single lighr show, you can also establish a default show, using set-default-show!, and omit even the with-show wrappers.

    *show*

    dynamic

    The light show on which Afterglow functions should operate, defined as a dynamic variable so it does not need to be passed as an argument to dozens of functions. The current show can be established locally using with-show, or, if you are only creating and using a single light show, which is a very common situation, you can globally establish a default value by calling set-default-show!.

    set-default-show!

    (set-default-show! show)

    Establish the specified show as the default, so that functions that have not been wrapped inside with-show contexts will act on it. This makes sense when you are only working with one light show and do not want to have to use with-show all the time.

    with-show

    macro

    (with-show show & body)

    Execute the body in the context of the specified light show, so Afterglow knows what show should be affected by its statements.

    \ No newline at end of file diff --git a/api-doc/afterglow.show.html b/api-doc/afterglow.show.html index d92332c4..90e8d4cb 100644 --- a/api-doc/afterglow.show.html +++ b/api-doc/afterglow.show.html @@ -1,30 +1,30 @@ -afterglow.show documentation

    afterglow.show

    Encapsulates a synchronized light show, executing a varying collection of effects with output to a number of DMX universes. Assumes control of the assigned universes, so only one show at a time should be assigned a given universe. Of course, you can stack as many effects as you’d like in that show.

    +afterglow.show documentation

    afterglow.show

    Encapsulates a synchronized light show, executing a varying collection of effects with output to a number of DMX universes. Assumes control of the assigned universes, so only one show at a time should be assigned a given universe. Of course, you can stack as many effects as you’d like in that show.

    The effects are maintained in a priority queue, with higher-priority effects running after lower-priority ones, so they can adjust or simply replace the channel assignments established by earlier effects. Some may choose to implement traditional channel-oriented highest-takes-prority or latest-takes-priority semantics, others do more sophisticated color blending or position averageing. The default priority when adding an effect is zero, but you can assign it any integer, and it will be inserted into the queue after any existing effects with the same priority.

    -

    All effects are assigned a keyword when they are added, and adding a new effect with the same key as an existing effect will replace the former one.

    active-effect-keys

    (active-effect-keys show)

    Returns a set of the keywords assigned to all currently-active effects.

    add-effect!

    (add-effect! key effect & {:keys [priority from-cue x y var-map], :or {priority 0}})

    Add an effect to the active set which are affecting DMX outputs for show-context/*show*. If no priority is specified, zero is used. This effect is added after all existing effects with equal or lower priority, and replaces any existing effect with the same key. Since the effects are executed in order, ones which come later will win when setting DMX values for the same channel if that channel uses latest-takes-priority mode; for channels using highest-takes priority, the order does not matter. Effects can also use more sophisticated strategies for adjusting the results of earlier effects, but the later one always gets to decide what to do.

    +

    All effects are assigned a keyword when they are added, and adding a new effect with the same key as an existing effect will replace the former one.

    active-effect-keys

    (active-effect-keys show)

    Returns a set of the keywords assigned to all currently-active effects.

    add-effect!

    (add-effect! key effect & {:keys [priority from-cue x y var-map], :or {priority 0}})

    Add an effect to the active set which are affecting DMX outputs for show-context/*show*. If no priority is specified, zero is used. This effect is added after all existing effects with equal or lower priority, and replaces any existing effect with the same key. Since the effects are executed in order, ones which come later will win when setting DMX values for the same channel if that channel uses latest-takes-priority mode; for channels using highest-takes priority, the order does not matter. Effects can also use more sophisticated strategies for adjusting the results of earlier effects, but the later one always gets to decide what to do.

    Returns the unique id assigned to this particular effect activation, so that user interfaces can detect whether it is still active.

    -

    The :from-cue keyword argument is used, along with :x and :y, to keep track of effects which were launched from the cue grid, to help provide feedback on control surfaces and in the web interface. :var-map is used to supply a map of variable bindings associated with the cue, also for use by interfaces which support them.

    add-effect-from-cue-grid!

    (add-effect-from-cue-grid! x y & {:keys [velocity var-overrides], :or {velocity 127}})

    Finds the cue, if any, at the specified grid coordinates, and activates its effect with the designated key and priority, after ending any effects whose keys are specified in the cue’s :end-keys. Returns the id of the new effect, or nil if no cue was found.

    +

    The :from-cue keyword argument is used, along with :x and :y, to keep track of effects which were launched from the cue grid, to help provide feedback on control surfaces and in the web interface. :var-map is used to supply a map of variable bindings associated with the cue, also for use by interfaces which support them.

    add-effect-from-cue-grid!

    (add-effect-from-cue-grid! x y & {:keys [velocity var-overrides], :or {velocity 127}})

    Finds the cue, if any, at the specified grid coordinates, and activates its effect with the designated key and priority, after ending any effects whose keys are specified in the cue’s :end-keys. Returns the id of the new effect, or nil if no cue was found.

    Any cue variables which are configured to be responsive to MIDI velocity will be set according to the velocity value passed in with :velocity. If no velocity is specified, then a default velocity of 127 is assumed.

    -

    A map of variable keywords to values can be supplied with :var-overrides, and the corresponding value will be used rather than the :start value specified in the cue for that variable when it is introduced as a cue variable. This is used by compound cues to launch their nested cues with customized values, and by afterglow-max to start cues with alternate values if its patchers have been configured to do so. If a :var-override is specified for a variable which is also configured as velocity sensitive, the override will win.

    add-empty-buffer-fn!

    (add-empty-buffer-fn! f)

    Arranges for the supplied function to be called when the Afterglow rendering loop is clearing its DMX buffers in order to calculate a frame of lighting effects. The function must take no arguments.

    -

    This is how custom assigner types which do not result in DMX data, such as the Pangolin beyond-server laser show integration, register their extension functions to participate in the rendering loop.

    add-frame-fn!

    (add-frame-fn! f)

    Arranges for the supplied function to be called when the Afterglow rendering loop is going to sleep prior to rendering the next frame of lighting effects. The function will be given the metronome snapshot that will be in effect when the next frame gets rendered, so that it can preconfigure anything needed for the rendering process. This is used, for example, to allow afterglow-max patchers to set show variables for the next frame, since they cannot be queried directly during the rendering process.

    add-midi-control-metronome-align-bar-mapping

    (add-midi-control-metronome-align-bar-mapping device-filter channel control-number & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Adjust a metronome so the closest beat is considered the first in the current measure, without moving the beat, when a control-change message with non-zero value is received from the specified device, channel, and control-number.

    +

    A map of variable keywords to values can be supplied with :var-overrides, and the corresponding value will be used rather than the :start value specified in the cue for that variable when it is introduced as a cue variable. This is used by compound cues to launch their nested cues with customized values, and by afterglow-max to start cues with alternate values if its patchers have been configured to do so. If a :var-override is specified for a variable which is also configured as velocity sensitive, the override will win.

    add-empty-buffer-fn!

    (add-empty-buffer-fn! f)

    Arranges for the supplied function to be called when the Afterglow rendering loop is clearing its DMX buffers in order to calculate a frame of lighting effects. The function must take no arguments.

    +

    This is how custom assigner types which do not result in DMX data, such as the Pangolin beyond-server laser show integration, register their extension functions to participate in the rendering loop.

    add-frame-fn!

    (add-frame-fn! f)

    Arranges for the supplied function to be called when the Afterglow rendering loop is going to sleep prior to rendering the next frame of lighting effects. The function will be given the metronome snapshot that will be in effect when the next frame gets rendered, so that it can preconfigure anything needed for the rendering process. This is used, for example, to allow afterglow-max patchers to set show variables for the next frame, since they cannot be queried directly during the rendering process.

    add-midi-control-metronome-align-bar-mapping

    (add-midi-control-metronome-align-bar-mapping device-filter channel control-number & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Adjust a metronome so the closest beat is considered the first in the current measure, without moving the beat, when a control-change message with non-zero value is received from the specified device, channel, and control-number.

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    If keyword parameter :metronome is supplied, its value can either be a rhythm/metronome object, or a keyword naming a show variable containing such an object. If not supplied, the main metronome attached to *show* is unmapped.

    -

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the metronome from being affected by these MIDI messages.

    add-midi-control-metronome-align-phrase-mapping

    (add-midi-control-metronome-align-phrase-mapping device-filter channel control-number & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Adjust a metronome so the closest beat is considered the first in the current phrase, without moving the beat, when a control-change message with non-zero value is received from the specified device, channel, and control-number.

    +

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the metronome from being affected by these MIDI messages.

    add-midi-control-metronome-align-phrase-mapping

    (add-midi-control-metronome-align-phrase-mapping device-filter channel control-number & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Adjust a metronome so the closest beat is considered the first in the current phrase, without moving the beat, when a control-change message with non-zero value is received from the specified device, channel, and control-number.

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    If keyword parameter :metronome is supplied, its value can either be a rhythm/metronome object, or a keyword naming a show variable containing such an object. If not supplied, the main metronome attached to *show* is mapped.

    -

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the metronome from being affected by these MIDI messages.

    add-midi-control-metronome-reset-mapping

    (add-midi-control-metronome-reset-mapping device-filter channel control-number & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Cause a metronome to be reset to beat 1, bar 1, phrase 1 when a control-change message with non-zero value is received from the specified device, channel, and control-number.

    +

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the metronome from being affected by these MIDI messages.

    add-midi-control-metronome-reset-mapping

    (add-midi-control-metronome-reset-mapping device-filter channel control-number & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Cause a metronome to be reset to beat 1, bar 1, phrase 1 when a control-change message with non-zero value is received from the specified device, channel, and control-number.

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    If keyword parameter :metronome is supplied, its value can either be a rhythm/metronome object, or a keyword naming a show variable containing such an object. If not supplied, the main metronome attached to *show* is mapped.

    -

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the metronome from being affected by these MIDI messages.

    add-midi-control-to-master-mapping

    (add-midi-control-to-master-mapping device-filter channel control-number & {:keys [master min max], :or {master (:grand-master *show*), min 0, max 100}})

    Cause the specified dimmer/master in *show* to be updated by any MIDI controller-change messages from the specified device sent on the specified channel and control-number.

    +

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the metronome from being affected by these MIDI messages.

    add-midi-control-to-master-mapping

    (add-midi-control-to-master-mapping device-filter channel control-number & {:keys [master min max], :or {master (:grand-master *show*), min 0, max 100}})

    Cause the specified dimmer/master in *show* to be updated by any MIDI controller-change messages from the specified device sent on the specified channel and control-number.

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    If :min and/or :max are specified, they will be used instead of the normal master range of 0 to 100. If given, both :min and :max must be valid percentages (in the range 0 to 100). If no :master is supplied, the show’s grand master is mapped. If the value supplied with :master is a keyword, it is resolved as a show variable containing a dimmer master.

    -

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the dimmer master from being affected by these MIDI messages.

    add-midi-control-to-var-mapping

    (add-midi-control-to-var-mapping device-filter channel control-number variable & {:keys [min max transform-fn], :or {min 0, max 127}})

    Cause the specified variable in *show* to be updated by any MIDI controller-change messages from the specified device sent on the specified channel and control-number.

    +

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the dimmer master from being affected by these MIDI messages.

    add-midi-control-to-var-mapping

    (add-midi-control-to-var-mapping device-filter channel control-number variable & {:keys [min max transform-fn], :or {min 0, max 127}})

    Cause the specified variable in *show* to be updated by any MIDI controller-change messages from the specified device sent on the specified channel and control-number.

    The first MIDI input source whose device matches the device-filter (using filter-devices) will be chosen.

    If :min and/or :max are specified, the normal MIDI range from 0 to 127 will be scaled to the supplied range instead.

    If :transform-fn is specified, it will be called with the MIDI value (after scaling, if any was specified), and its return value will be stored in the variable.

    -

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the variable from responding to these MIDI messages.

    add-send-buffer-fn!

    (add-send-buffer-fn! f)

    Arranges for the supplied function to be called when the Afterglow rendering loop is sending the DMX data for a frame of lighting effects. The function must take no arguments.

    -

    This is how custom assigner types which do not result in DMX data, such as the Pangolin beyond-server laser show integration, register their extension functions to participate in the rendering loop.

    add-variable-set-fn!

    (add-variable-set-fn! key f)

    Arranges for the supplied function to be called when the the show variable with the specified keyword is set. The function will be called with two arguments: the keyword, and the new value which is being set.

    address-map

    (address-map)

    Returns a sorted map whose keys are the IDs of the universes managed by *show*, and whose values are address maps for the corresponding universe. The address maps have keys for every channel in use by the show in that universe, and the value is the key of the fixture using that address.

    all-fixtures

    (all-fixtures)

    Returns all fixtures patched into *show*.

    blackout-show

    (blackout-show)

    Sends zero to every channel of every universe associated with *show*. Will quickly be overwritten if the show is running and there are any active effects, so this is mostly useful when a show has been suspended and you want to darken the lights it left on.

    blackout-universe

    (blackout-universe universe)

    Sends zero to every channel of the specified universe. Will be quickly overwritten if there are any active shows transmitting to that universe.

    clear-cue!

    (clear-cue! x y)

    Removes any cue which existed at the specified coordinates in the default show’s cue grid, by delegating to afterglow.controllers/clear-cue! (see that function for details).

    clear-effects!

    (clear-effects!)

    Remove all effects currently active in *show*, leading to a blackout state in all controlled universes (if the show is running) until new effects are added.

    clear-empty-buffer-fn!

    (clear-empty-buffer-fn! f)

    Ceases calling the supplied function during the buffer clearing phase of the rendering loop.

    clear-frame-fn!

    (clear-frame-fn! f)

    Ceases calling the supplied function from the rendering loop.

    clear-send-buffer-fn!

    (clear-send-buffer-fn! f)

    Ceases calling the supplied function during the data sending phase of the rendering loop.

    clear-variable-set-fn!

    (clear-variable-set-fn! key f)

    Ceases calling the supplied function when the show variable with the specified keyword is set.

    current-load

    (current-load)

    Returns a sense of how much headroom there is running the current effects, in the form of the fraction of the available refresh interval that was used calculating and sending the last several frames.

    default-refresh-interval

    How often should frames of DMX data be sent out; this should be a supported frame rate for your interface. The default here is 40 Hz, forty frames per second.

    end-effect!

    (end-effect! key & {:keys [force when-id]})

    Shut down an effect that is running in *show*. Unless a true value is passed for :force, this is done by asking the effect to end (and waiting until it reports completion); forcibly stopping it simply immediately removes it from the show. If an id is specified with :when-id, the effect will only be ended if the id of the currently-running effect matches the one supplied. If it was created from a cue grid, notify any controllers that might be tracking the cue state.

    find-cue-grid-active-effect

    (find-cue-grid-active-effect show x y)

    Find the cue at a particular cue grid location. If it is marked as active, check whether there is still an effect running under that key with the same id. If so, return a vector containing both the cue and the effect. If not, mark the cue as inactive, and return a vector containing the cue and nil. If no cue was found at all, simply returns nil.

    find-effect

    (find-effect key)

    Looks up the specified effect keyword in the list of active effects for *show*. Returns a map of the effect metadata, with the effect itself under the key :effect. If the effect is in the process of ending, the keyword :ending will have a true value.

    fixtures-named

    (fixtures-named n)

    Returns all fixtures patched into *show* whose key matches the specified name, with an optional number following it, as would be assigned to a fixture group by patch-fixtures!

    get-cue-effect

    (get-cue-effect effect-fn var-map)

    Sets up a cue as though it is about to run, in order to test that its effect function returns an effect. Used in validating the cue when it is created.

    get-variable

    (get-variable key)

    Get the value of a variable associated with *show*.

    ola-failure-description

    (ola-failure-description)

    If the last attempt to communicate with the OLA daemon failed, returns a description of the problem, otherwise returns nil.

    patch-fixture!

    (patch-fixture! key fixture universe start-address & {:keys [x y z x-rotation y-rotation z-rotation relative-rotations rotation-matrix], :or {x 0.0, y 0.0, z 0.0, x-rotation 0.0, y-rotation 0.0, z-rotation 0.0}})

    Patch a fixture to a universe in *show* at a starting DMX channel address, at a particular point in space, with a particular orientation.

    +

    Returns a MIDI mapping function which can be passed to remove-control-mapping if you later want to stop the variable from responding to these MIDI messages.

    add-send-buffer-fn!

    (add-send-buffer-fn! f)

    Arranges for the supplied function to be called when the Afterglow rendering loop is sending the DMX data for a frame of lighting effects. The function must take no arguments.

    +

    This is how custom assigner types which do not result in DMX data, such as the Pangolin beyond-server laser show integration, register their extension functions to participate in the rendering loop.

    add-variable-set-fn!

    (add-variable-set-fn! key f)

    Arranges for the supplied function to be called when the the show variable with the specified keyword is set. The function will be called with two arguments: the keyword, and the new value which is being set.

    address-map

    (address-map)

    Returns a sorted map whose keys are the IDs of the universes managed by *show*, and whose values are address maps for the corresponding universe. The address maps have keys for every channel in use by the show in that universe, and the value is the key of the fixture using that address.

    all-fixtures

    (all-fixtures)

    Returns all fixtures patched into *show*.

    blackout-show

    (blackout-show)

    Sends zero to every channel of every universe associated with *show*. Will quickly be overwritten if the show is running and there are any active effects, so this is mostly useful when a show has been suspended and you want to darken the lights it left on.

    blackout-universe

    (blackout-universe universe)

    Sends zero to every channel of the specified universe. Will be quickly overwritten if there are any active shows transmitting to that universe.

    clear-cue!

    (clear-cue! x y)

    Removes any cue which existed at the specified coordinates in the default show’s cue grid, by delegating to afterglow.controllers/clear-cue! (see that function for details).

    clear-effects!

    (clear-effects!)

    Remove all effects currently active in *show*, leading to a blackout state in all controlled universes (if the show is running) until new effects are added.

    clear-empty-buffer-fn!

    (clear-empty-buffer-fn! f)

    Ceases calling the supplied function during the buffer clearing phase of the rendering loop.

    clear-frame-fn!

    (clear-frame-fn! f)

    Ceases calling the supplied function from the rendering loop.

    clear-send-buffer-fn!

    (clear-send-buffer-fn! f)

    Ceases calling the supplied function during the data sending phase of the rendering loop.

    clear-variable-set-fn!

    (clear-variable-set-fn! key f)

    Ceases calling the supplied function when the show variable with the specified keyword is set.

    current-load

    (current-load)

    Returns a sense of how much headroom there is running the current effects, in the form of the fraction of the available refresh interval that was used calculating and sending the last several frames.

    default-refresh-interval

    How often should frames of DMX data be sent out; this should be a supported frame rate for your interface. The default here is 40 Hz, forty frames per second.

    end-effect!

    (end-effect! key & {:keys [force when-id]})

    Shut down an effect that is running in *show*. Unless a true value is passed for :force, this is done by asking the effect to end (and waiting until it reports completion); forcibly stopping it simply immediately removes it from the show. If an id is specified with :when-id, the effect will only be ended if the id of the currently-running effect matches the one supplied. If it was created from a cue grid, notify any controllers that might be tracking the cue state.

    find-cue-grid-active-effect

    (find-cue-grid-active-effect show x y)

    Find the cue at a particular cue grid location. If it is marked as active, check whether there is still an effect running under that key with the same id. If so, return a vector containing both the cue and the effect. If not, mark the cue as inactive, and return a vector containing the cue and nil. If no cue was found at all, simply returns nil.

    find-effect

    (find-effect key)

    Looks up the specified effect keyword in the list of active effects for *show*. Returns a map of the effect metadata, with the effect itself under the key :effect. If the effect is in the process of ending, the keyword :ending will have a true value.

    fixtures-named

    (fixtures-named n)

    Returns all fixtures patched into *show* whose key matches the specified name, with an optional number following it, as would be assigned to a fixture group by patch-fixtures!

    get-cue-effect

    (get-cue-effect effect-fn var-map)

    Sets up a cue as though it is about to run, in order to test that its effect function returns an effect. Used in validating the cue when it is created.

    get-variable

    (get-variable key)

    Get the value of a variable associated with *show*.

    ola-failure-description

    (ola-failure-description)

    If the last attempt to communicate with the OLA daemon failed, returns a description of the problem, otherwise returns nil.

    patch-fixture!

    (patch-fixture! key fixture universe start-address & {:keys [x y z x-rotation y-rotation z-rotation relative-rotations rotation-matrix], :or {x 0.0, y 0.0, z 0.0, x-rotation 0.0, y-rotation 0.0, z-rotation 0.0}})

    Patch a fixture to a universe in *show* at a starting DMX channel address, at a particular point in space, with a particular orientation.

    key is a keyword identifying the fixture. If you need to remove the fixture later, or re-patch it with different parameters, you can do that by passing the same keyword to remove-fixture! or patch-fixture!. If you have a set of fixtures that you want to be able to easily group, give them keywords that start with the same name, followed by a hyphen and uniqe numbers. That way, if you pass the name portion (everthing before the final hyphen and number) to fixtures-named, you will get back a list of all those fixtures.

    fixture is a Fixture Definition map which specifies all the capabilities of the fixture and how Afterglow can control it.

    universe identifies which DMX universe the fixture is attached to, and must be one of the universe numbers that was passed in the universes argument to show when creating the show. start-address identifies the DMX address of the first channel the fixture is listening to in that universe (it will be displayed on the fixture’s configuration panel or DIP switches), and is an integer ranging from 1 to 512, the legal DMX addresses in a universe. The attempt to patch will fail if there are more channels in the fixture definition than fit within the 512-channel address space starting at that address, or if any of the addresses used by the fixture have already been assigned to other patched fixtures.

    @@ -32,16 +32,16 @@

    When you specify a fixture rotation using the :x-rotation, :y-rotation, and :z-rotation arguments, this represents a set of Euler angles within the fixed frame of reference of show space, as implemented by transform-fixture-euler, which uses the setEuler method of the Java3D Transform3D object. It can sometimes be very challenging, when looking at a fixture, to figure out how to calculate the Euler angles representing how it was hung. In those situations, you can use an alternate method to specify its rotations:

    If you pass in the optional keyword argument :relative-rotations, you can follow it with a vector of paired rotation keywords and angles of any length, and Afterglow will interpret them using transform-fixture-relative. Starting with the fixture at its default orientation, Afterglow will perform all the rotations you list, in order, from the perspective of the transfomed fixture at each step. This can be a lot easier to think about. For example, if the fixture was first rotated 90 degrees counterclockwise on its y axis, then 45 degrees clockwise on its (new) z axis, you would specify:

    :relative-rotations [[:y-rotation (tf/degrees 90)] [:z-rotation (tf/degrees -45)]]

    -

    Finally, if you happen to have a Transform3D object which specifies the rotation applied to the fixture (perhaps from some other program), you can simply pass that using the optional keyword argument :rotation-matrix.

    patch-fixture-group!

    deprecated in 0.1.2

    (patch-fixture-group! key fixture universe start-address count)(patch-fixture-group! key fixture universe start-address count offset)

    Deprecated until it supports positioning each fixture.

    -

    Patch a fixture group to a universe in *show* at a starting DMX channel address. Names will be assigned by adding a hyphen and numeric suffix, starting with 1, to the key supplied. If an offset is supplied, it will be added to the starting address for each subsequent fixture; if not, the largest offset used by the fixture will be used to calculate a suitable offset.

    profile-show

    (profile-show & {:keys [iterations serial?], :or {iterations 100, serial? true}})

    Gather statistics about the performance of generating and sending a frame of DMX data to the universes *show*. The show must be stopped to run this function since it manipulates the thread pool atom to run the kind of test requested.

    -

    Specify the number of iterations of the rendering loop that should be profiled with the optional keyword argument :iterations (which defaults to 100). Assumes you want to profile without the use of a thread pool to look for worst-case performance unless you pass false with the optional keyword argument :serial?.

    register-grid-controller

    (register-grid-controller controller)

    Add a cue grid controller to the list available for linking in the web interface. The argument must implement the IGridController protocol.

    register-show

    (register-show show description)

    Add a show to the list of available shows in the web interface.

    remove-fixture!

    (remove-fixture! key)

    Remove a fixture from thosed patched into *show*.

    remove-midi-control-metronome-mapping

    deprecated in 0.2.0

    (remove-midi-control-metronome-mapping device-filter channel control-number f & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Deprecated: There is no reason to use this function, it is simpler to call remove-control-mapping directly.

    +

    Finally, if you happen to have a Transform3D object which specifies the rotation applied to the fixture (perhaps from some other program), you can simply pass that using the optional keyword argument :rotation-matrix.

    patch-fixture-group!

    deprecated in 0.1.2

    (patch-fixture-group! key fixture universe start-address count)(patch-fixture-group! key fixture universe start-address count offset)

    Deprecated until it supports positioning each fixture.

    +

    Patch a fixture group to a universe in *show* at a starting DMX channel address. Names will be assigned by adding a hyphen and numeric suffix, starting with 1, to the key supplied. If an offset is supplied, it will be added to the starting address for each subsequent fixture; if not, the largest offset used by the fixture will be used to calculate a suitable offset.

    profile-show

    (profile-show & {:keys [iterations serial?], :or {iterations 100, serial? true}})

    Gather statistics about the performance of generating and sending a frame of DMX data to the universes *show*. The show must be stopped to run this function since it manipulates the thread pool atom to run the kind of test requested.

    +

    Specify the number of iterations of the rendering loop that should be profiled with the optional keyword argument :iterations (which defaults to 100). Assumes you want to profile without the use of a thread pool to look for worst-case performance unless you pass false with the optional keyword argument :serial?.

    register-grid-controller

    (register-grid-controller controller)

    Add a cue grid controller to the list available for linking in the web interface. The argument must implement the IGridController protocol.

    register-show

    (register-show show description)

    Add a show to the list of available shows in the web interface.

    remove-fixture!

    (remove-fixture! key)

    Remove a fixture from thosed patched into *show*.

    remove-midi-control-metronome-mapping

    deprecated in 0.2.0

    (remove-midi-control-metronome-mapping device-filter channel control-number f & {:keys [metronome], :or {metronome (:metronome *show*)}})

    Deprecated: There is no reason to use this function, it is simpler to call remove-control-mapping directly.

    Stop affecting a metronome when the specified MIDI controller-change messages are received. This undoes the effect of any of add-midi-control-metronome-reset-mapping, add-midi-control-metronome-align-bar-mapping, and add-midi-control-metronome-align-phrase-mapping.

    If keyword parameter :metronome is supplied, its value can either be a rhythm/metronome object, or a keyword naming a show variable containing such an object. If not supplied, the main metronome attached to *show* is mapped.

    -

    f is the function that was returned by add-midi-control-metronome-reset-mapping, add-midi-control-metronome-align-bar-mapping, or add-midi-control-metronome-align-phrase-mapping when this relationship was established.

    remove-midi-control-to-master-mapping

    deprecated in 0.2.0

    (remove-midi-control-to-master-mapping device-filter channel control-number f & {:keys [master], :or {master (:grand-master *show*)}})

    Deprecated: There is no reason to use this function, it is simpler to call remove-control-mapping directly.

    -

    Cease updating the specified dimmer/master when the specified MIDI controller-change messages are received. f is the function that was returned by add-midi-control-to-master-mapping when this relationship was established.

    remove-midi-control-to-var-mapping

    deprecated in 0.2.0

    (remove-midi-control-to-var-mapping device-filter channel control-number variable f)

    Deprecated: There is no reason to use this function, it is simpler to call remove-control-mapping directly.

    -

    Cease updating the specified variable in *show* when the specified MIDI controller-change messages are received. f is the function that was returned by add-midi-control-to-var-mapping when this relationship was created.

    resolution-order

    The order in which assigners should be evaluated, by type key. Multi-channel assignments are resolved before individual ones.

    running?

    (running?)

    Returns an indication of whether the show is currently generating and sending values to its associated lighting universes.

    set-cue!

    (set-cue! x y cue)

    Puts the supplied cue at the specified coordinates in the default show’s cue grid, by delegating to afterglow.controllers/set-cue! (see that function for details).

    set-extension-resolution-order!

    (set-extension-resolution-order! extension-key order)

    A system wanting to extend the Afterglow rendering loop to support new kinds of assigners must call this function to register its new unique assigner types, and the order in which they should be run.

    +

    f is the function that was returned by add-midi-control-metronome-reset-mapping, add-midi-control-metronome-align-bar-mapping, or add-midi-control-metronome-align-phrase-mapping when this relationship was established.

    remove-midi-control-to-master-mapping

    deprecated in 0.2.0

    (remove-midi-control-to-master-mapping device-filter channel control-number f & {:keys [master], :or {master (:grand-master *show*)}})

    Deprecated: There is no reason to use this function, it is simpler to call remove-control-mapping directly.

    +

    Cease updating the specified dimmer/master when the specified MIDI controller-change messages are received. f is the function that was returned by add-midi-control-to-master-mapping when this relationship was established.

    remove-midi-control-to-var-mapping

    deprecated in 0.2.0

    (remove-midi-control-to-var-mapping device-filter channel control-number variable f)

    Deprecated: There is no reason to use this function, it is simpler to call remove-control-mapping directly.

    +

    Cease updating the specified variable in *show* when the specified MIDI controller-change messages are received. f is the function that was returned by add-midi-control-to-var-mapping when this relationship was created.

    resolution-order

    The order in which assigners should be evaluated, by type key. Multi-channel assignments are resolved before individual ones.

    running?

    (running?)

    Returns an indication of whether the show is currently generating and sending values to its associated lighting universes.

    set-cue!

    (set-cue! x y cue)

    Puts the supplied cue at the specified coordinates in the default show’s cue grid, by delegating to afterglow.controllers/set-cue! (see that function for details).

    set-extension-resolution-order!

    (set-extension-resolution-order! extension-key order)

    A system wanting to extend the Afterglow rendering loop to support new kinds of assigners must call this function to register its new unique assigner types, and the order in which they should be run.

    The first argument extension-key is a unique keyword identifying the extension, for example a keyword created from its namespace name. The second argument is a vector containing all the keywords which identify the new assigner types which are implemented by the extension. These must also be globally unique, and should probably have a prefix related to the exension name.

    -

    Even if the extension adds only a single new assigner type, that must be passed as a single-element vector in order so that Afterglow knows to look for and run its assigners.

    set-variable!

    (set-variable! key newval)

    Set a value for a variable associated with *show*.

    show

    (show & {:keys [universes base-metronome refresh-interval description], :or {universes [1], base-metronome (rhythm/metronome 120), refresh-interval default-refresh-interval}})

    Create a show coordinator to calculate and send DMX values to the specified universe(s), with a rhythm/metronome to coordinate timing. The metronome to use can be specified with the optional keyword argument :base-metronome; otherwise, a new metronome is created for the show, with a starting bpm of 120.

    +

    Even if the extension adds only a single new assigner type, that must be passed as a single-element vector in order so that Afterglow knows to look for and run its assigners.

    set-variable!

    (set-variable! key newval)

    Set a value for a variable associated with *show*.

    show

    (show & {:keys [universes base-metronome refresh-interval description], :or {universes [1], base-metronome (rhythm/metronome 120), refresh-interval default-refresh-interval}})

    Create a show coordinator to calculate and send DMX values to the specified universe(s), with a rhythm/metronome to coordinate timing. The metronome to use can be specified with the optional keyword argument :base-metronome; otherwise, a new metronome is created for the show, with a starting bpm of 120.

    Values are computed and sent at a fixed refresh interval (in milliseconds), which defaults to a frame rate of thirty times per second, but can be specified using the optional keyword argument :refresh-interval.

    -

    If a description is supplied with the :description argument, the show will be registered under that description for the user to choose in the embedded web interface. If you recreate the show because you are in the process of working out its details, be sure to unregister the old version (with unregister-show) first, or you will end up with multiple shows with the same description in the web interface. There is an example of how to handle this automatically at the start of afterglow.examples/use-sample-show (click the view source link below the description to see the sample-show atom and swap! invocation within set-default-show! it uses to make sure there is only ever one version registered).

    shows

    Holds the registered shows, if any, for display in the web server.

    start!

    (start!)

    Starts (or restarts) a scheduled task to calculate and send DMX values to the universes controlled by *show* at the appropriate refresh rate.

    stop!

    (stop!)

    Shuts down and removes the scheduled task which is sending DMX values for *show*, and cleans up the show’s thread pool.

    stop-all!

    (stop-all!)

    Stops all running shows. Afterglow registers a shutdown hook to call this when the Java environment is shutting down, to clean up gracefully.

    sync-status

    (sync-status)

    Checks what kind of synchronization is in effect for *show*, and reports on how it seems to be working.

    sync-to-external-clock

    (sync-to-external-clock)(sync-to-external-clock sync-fn)

    Stops or sarts synchronizing the show metronome attached to *show* with an external clock source. Pass it a function which takes the metronome and binds it to the source, returning a ClockSync object which will be stored with the show, so synchronization can later be stopped if desired. Calling this stops any synchronization that was formerly in effect, and calling it with no sync-fn argument simply leaves it stopped.

    -

    Functions useful to pass to this include midi/sync-to-midi-clock and dj-link/sync-to-dj-link.

    unregister-grid-controller

    (unregister-grid-controller controller)

    Remove a cue grid controller from the list available for linking in the web interface.

    unregister-show

    (unregister-show show)

    Remove a show from the list of available shows in the web interface.

    \ No newline at end of file +

    If a description is supplied with the :description argument, the show will be registered under that description for the user to choose in the embedded web interface. If you recreate the show because you are in the process of working out its details, be sure to unregister the old version (with unregister-show) first, or you will end up with multiple shows with the same description in the web interface. There is an example of how to handle this automatically at the start of afterglow.examples/use-sample-show (click the view source link below the description to see the sample-show atom and swap! invocation within set-default-show! it uses to make sure there is only ever one version registered).

    shows

    Holds the registered shows, if any, for display in the web server.

    start!

    (start!)

    Starts (or restarts) a scheduled task to calculate and send DMX values to the universes controlled by *show* at the appropriate refresh rate.

    stop!

    (stop!)

    Shuts down and removes the scheduled task which is sending DMX values for *show*, and cleans up the show’s thread pool.

    stop-all!

    (stop-all!)

    Stops all running shows. Afterglow registers a shutdown hook to call this when the Java environment is shutting down, to clean up gracefully.

    sync-status

    (sync-status)

    Checks what kind of synchronization is in effect for *show*, and reports on how it seems to be working.

    sync-to-external-clock

    (sync-to-external-clock)(sync-to-external-clock sync-fn)

    Stops or sarts synchronizing the show metronome attached to *show* with an external clock source. Pass it a function which takes the metronome and binds it to the source, returning a ClockSync object which will be stored with the show, so synchronization can later be stopped if desired. Calling this stops any synchronization that was formerly in effect, and calling it with no sync-fn argument simply leaves it stopped.

    +

    Functions useful to pass to this include midi/sync-to-midi-clock and dj-link/sync-to-dj-link.

    unregister-grid-controller

    (unregister-grid-controller controller)

    Remove a cue grid controller from the list available for linking in the web interface.

    unregister-show

    (unregister-show show)

    Remove a show from the list of available shows in the web interface.

    \ No newline at end of file diff --git a/api-doc/afterglow.shows.sallie.html b/api-doc/afterglow.shows.sallie.html index 58a4c8bb..15595ab7 100644 --- a/api-doc/afterglow.shows.sallie.html +++ b/api-doc/afterglow.shows.sallie.html @@ -1,3 +1,3 @@ -afterglow.shows.sallie documentation

    afterglow.shows.sallie

    Cues for Sallie’s birthday/housewarming party. Useful as an example of how an actual small show was put together early in Afterglow’s development, and also as a source of effects that may want to make there way into a more central place.

    global-color-cue

    (global-color-cue color x y & {:keys [include-color-wheels? held]})

    Create a cue-grid entry which establishes a global color effect.

    global-color-effect

    (global-color-effect color & {:keys [include-color-wheels? lights], :or {lights (show/all-fixtures)}})

    Make a color effect which affects all lights in the Sallie show. If the show variable :also-color-laser has a value other than 0, the color will be sent to Beyond to affect laser cues as well. Can include only a specific set of lights by passing them with :lights

    global-dimmer-effect

    (global-dimmer-effect level & {:keys [effect-name]})

    Return an effect that sets all the dimmers in the sallie 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

    laser-show

    Allows commands to be sent to the instance of Pangolin Beyond running alongside this light show, in order to affect laser cues.

    make-cues

    (make-cues)

    Create the cues for the Sallie show.

    make-strobe-cue

    (make-strobe-cue 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.

    sallie-show

    Holds the show if it has been created, so it can be unregistered if it is being re-created.

    try-laser-cues

    (try-laser-cues server)

    Create some cues that integrate Pangolin Beyond. Assumes sallie show has been created, and takes the beyond server to work with as an argument.

    use-sallie-show

    (use-sallie-show & {:keys [universe], :or {universe 1}})

    Set up the show for Sallie’s party. 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.

    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.

    \ No newline at end of file +afterglow.shows.sallie documentation

    afterglow.shows.sallie

    Cues for Sallie’s birthday/housewarming party. Useful as an example of how an actual small show was put together early in Afterglow’s development, and also as a source of effects that may want to make there way into a more central place.

    global-color-cue

    (global-color-cue color x y & {:keys [include-color-wheels? held]})

    Create a cue-grid entry which establishes a global color effect.

    global-color-effect

    (global-color-effect color & {:keys [include-color-wheels? lights], :or {lights (show/all-fixtures)}})

    Make a color effect which affects all lights in the Sallie show. If the show variable :also-color-laser has a value other than 0, the color will be sent to Beyond to affect laser cues as well. Can include only a specific set of lights by passing them with :lights

    global-dimmer-effect

    (global-dimmer-effect level & {:keys [effect-name]})

    Return an effect that sets all the dimmers in the sallie 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

    laser-show

    Allows commands to be sent to the instance of Pangolin Beyond running alongside this light show, in order to affect laser cues.

    make-cues

    (make-cues)

    Create the cues for the Sallie show.

    make-strobe-cue

    (make-strobe-cue 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.

    sallie-show

    Holds the show if it has been created, so it can be unregistered if it is being re-created.

    try-laser-cues

    (try-laser-cues server)

    Create some cues that integrate Pangolin Beyond. Assumes sallie show has been created, and takes the beyond server to work with as an argument.

    use-sallie-show

    (use-sallie-show & {:keys [universe], :or {universe 1}})

    Set up the show for Sallie’s party. 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.

    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.

    \ No newline at end of file diff --git a/api-doc/afterglow.transform.html b/api-doc/afterglow.transform.html index cf829c21..f5ddb988 100644 --- a/api-doc/afterglow.transform.html +++ b/api-doc/afterglow.transform.html @@ -1,6 +1,6 @@ -afterglow.transform documentation

    afterglow.transform

    Functions for modeling light position and rotation. If you want to make use of Afterglow’s spatial reasoning capabilities, you need to tell it, when patching a fixture, the location and orientation of that fixture.

    +afterglow.transform documentation

    afterglow.transform

    Functions for modeling light position and rotation. If you want to make use of Afterglow’s spatial reasoning capabilities, you need to tell it, when patching a fixture, the location and orientation of that fixture.

    The coordinate system in afterglow is from the perspective of the audience: Standing facing your show, the X axis passes through it increasing from left to right, the Y axis passes through it increasing away from the floor, and the Z axis passes through it increasing towards the audience. (There is a diagram on the Show Space documentation page.)

    Pick an origin when setting up your show; in our case it is easiest to use the spot on the floor directly under the center of gravity of the main truss in our lighting rig. Something else may be better for you.

    When hanging your lights, measure how far the center of the light is from the origin of the show, in the X, Y, and Z directions. You don’t need to get this precise to the millimeter level, but having it roughly right will make your spatial cues look great.

    @@ -9,11 +9,11 @@

    For this to work you also need to tell Afterglow the orientation in which you have hung the fixture, expressed as a rotation away from the standard orientation described in the fixture definition. Yes, this can be painful to figure out, especially the first few times, and we have ideas about an iPhone app to help automate this, using the phone’s camera and ability to track its own orientation. But until then, figure out how much you have rotated the fixture, in radians, around the X, then Y, then Z axes, in that order, and feed that in as well when patching it.

    Again there are functions in this namespace to convert degrees to radians if they are easier for you to work with. In many cases, hopefully, the rotations will be simple. For example, if a light is hanging backwards with respect to its reference orientation, that is a rotation of zero around the X axis, Pi radians about the Y axis, and zero about the Z axis.

    If a fixture does not have multiple heads, and is not a moving head fixture, you can generally ignore the rotation completely when patching it. Getting the orientation right is most important for moving heads, because Afterglow relies on having that information in order to figure out how to aim the light where you want it aimed.

    aim-to-dmx

    (aim-to-dmx fixture target-point former-values)

    Given a fixture or head and a point in the frame of reference of the light show, calculate the best pan and tilt values to send to that fixture or head in order to aim it at that point.

    -

    If there is more than one legal solution, return the one that is closest to the former values supplied. If no former values were specified, then use the fixture’s center position as the default target value to stay close to.

    angle-to-dmx-value

    (angle-to-dmx-value angle center-value half-circle-value)

    Given an angle in radians, where positive means counterclockwise around the axis, determine the DMX value needed to achieve that amount of rotation of a fixture away from its center position, given the DMX value of that center position, and the amount the DMX value must change to cause a counterclockwise rotation halfway around a circle. The return value may not be a legal DMX value if the fixture cannot rotate that far; this will be weeded out in other parts of the algorithm.

    build-distance-measure

    (build-distance-measure x y z & {:keys [ignore-x ignore-y ignore-z]})

    Returns a function which calculates the distance from a fixture or head to a specified point, optionally ignoring one or more axes. Useful in building transitions which depend on the locations of lights, perhaps only within certain planes or along a single axis.

    -

    The function returned takes a fixture definition, and returns its distance from the configured reference point, after discarding any axes which have been marked as ignored by passing true values along with :ignore-x, :ignore-y, or :ignore-z.

    calculate-bounds

    (calculate-bounds fixtures)

    Given a list of fixtures, determine the corners of the smallest box which contains them all, and the center of that box.

    degrees

    (degrees deg)

    Converts a number of degrees into the corresponding number of radians.

    direction-to-dmx

    (direction-to-dmx fixture direction former-values)

    Given a fixture or head and vector representing a direction in the frame of reference of the light show, calculate the best pan and tilt values to send to that fixture or head in order to aim it in that direction.

    -

    If there is more than one legal solution, return the one that is closest to the former values supplied. If no former values were specified, then use the fixture’s center position as the default target value to stay close to.

    feet

    (feet f)

    Converts a number of feet to the corresponding number of meters.

    inches

    (inches in)

    Converts a number of inches to the corresponding number of meters.

    interpret-rotation

    (interpret-rotation head)

    Given a fixture definition or head, checks whether it has been assigned extrinsic (Euler) angle rotations, or a list of intrinsic rotations. Either way, construct and return the appropriate rotation matrix to represent its orientation.

    invert-direction

    (invert-direction fixture direction)

    Transform a direction vector in show coordinate space to the way it appears to a head or fixture that has been rotated when hanging.

    max-distance

    (max-distance measure fixtures)

    Calculates the maximum distance that will ever be returned by a distance measure for a set of fixtures.

    show-head-positions

    (show-head-positions fixtures)

    To help sanity-check fixtures’ position and orientation after patching them, displays the positions of all heads of the list of fixtures supplied. In the resulting list, top-level fixtures will be identifiable by the presence of their :key entry in the map that includes their position, and will be followed by their heads, if any, until the next top-level fixture entry.

    transform-fixture-euler

    (transform-fixture-euler fixture x y z x-rotation y-rotation z-rotation)

    Determine the positions and orientations of the fixture and its heads when it is patched into a show. x, y, and z are the position of the fixture’s origin point with respect to the show’s origin.

    -

    The fixture rotation is expressed as Euler angles in x-rotation, y-rotation, and z-rotation. These are interpreted as the counter-clockwise extrinsic rotations around the show space axes, in that order, needed to get the fixture from its reference orientation to the orientation in which it was actually hung. Extrinsic means that the axes are always the fixed axes of show space, they do not change as you rotate the fixture.

    transform-fixture-relative

    (transform-fixture-relative fixture x y z relative-rotations)

    Determine the positions and orientations of the fixture and its heads when it is patched into a show. x, y, and z are the position of the fixture’s origin point with respect to the show’s origin.

    -

    The fixture rotation is expressed as a list of relative-rotations in any order. Each list element is a tuple of the rotation type (:x-rotation, :y-rotation, or :z-rotation) and the counter-clockwise angle in radians around that axis which the fixture should be rotated. The fixtue starts at its reference orientation, and these intrinsic rotations are applied, in order, always from the frame of reference of the fixture, including any accumulated previous rotations.

    transform-fixture-rotation-matrix

    (transform-fixture-rotation-matrix fixture x y z rotation)

    Determine the positions and orientations of the fixture and its heads when it is patched into a show. x, y, and z are the position of the fixture’s origin point with respect to the show’s origin.

    +

    If there is more than one legal solution, return the one that is closest to the former values supplied. If no former values were specified, then use the fixture’s center position as the default target value to stay close to.

    angle-to-dmx-value

    (angle-to-dmx-value angle center-value half-circle-value)

    Given an angle in radians, where positive means counterclockwise around the axis, determine the DMX value needed to achieve that amount of rotation of a fixture away from its center position, given the DMX value of that center position, and the amount the DMX value must change to cause a counterclockwise rotation halfway around a circle. The return value may not be a legal DMX value if the fixture cannot rotate that far; this will be weeded out in other parts of the algorithm.

    build-distance-measure

    (build-distance-measure x y z & {:keys [ignore-x ignore-y ignore-z]})

    Returns a function which calculates the distance from a fixture or head to a specified point, optionally ignoring one or more axes. Useful in building transitions which depend on the locations of lights, perhaps only within certain planes or along a single axis.

    +

    The function returned takes a fixture definition, and returns its distance from the configured reference point, after discarding any axes which have been marked as ignored by passing true values along with :ignore-x, :ignore-y, or :ignore-z.

    calculate-bounds

    (calculate-bounds fixtures)

    Given a list of fixtures, determine the corners of the smallest box which contains them all, and the center of that box.

    degrees

    (degrees deg)

    Converts a number of degrees into the corresponding number of radians.

    direction-to-dmx

    (direction-to-dmx fixture direction former-values)

    Given a fixture or head and vector representing a direction in the frame of reference of the light show, calculate the best pan and tilt values to send to that fixture or head in order to aim it in that direction.

    +

    If there is more than one legal solution, return the one that is closest to the former values supplied. If no former values were specified, then use the fixture’s center position as the default target value to stay close to.

    feet

    (feet f)

    Converts a number of feet to the corresponding number of meters.

    inches

    (inches in)

    Converts a number of inches to the corresponding number of meters.

    interpret-rotation

    (interpret-rotation head)

    Given a fixture definition or head, checks whether it has been assigned extrinsic (Euler) angle rotations, or a list of intrinsic rotations. Either way, construct and return the appropriate rotation matrix to represent its orientation.

    invert-direction

    (invert-direction fixture direction)

    Transform a direction vector in show coordinate space to the way it appears to a head or fixture that has been rotated when hanging.

    max-distance

    (max-distance measure fixtures)

    Calculates the maximum distance that will ever be returned by a distance measure for a set of fixtures.

    show-head-positions

    (show-head-positions fixtures)

    To help sanity-check fixtures’ position and orientation after patching them, displays the positions of all heads of the list of fixtures supplied. In the resulting list, top-level fixtures will be identifiable by the presence of their :key entry in the map that includes their position, and will be followed by their heads, if any, until the next top-level fixture entry.

    transform-fixture-euler

    (transform-fixture-euler fixture x y z x-rotation y-rotation z-rotation)

    Determine the positions and orientations of the fixture and its heads when it is patched into a show. x, y, and z are the position of the fixture’s origin point with respect to the show’s origin.

    +

    The fixture rotation is expressed as Euler angles in x-rotation, y-rotation, and z-rotation. These are interpreted as the counter-clockwise extrinsic rotations around the show space axes, in that order, needed to get the fixture from its reference orientation to the orientation in which it was actually hung. Extrinsic means that the axes are always the fixed axes of show space, they do not change as you rotate the fixture.

    transform-fixture-relative

    (transform-fixture-relative fixture x y z relative-rotations)

    Determine the positions and orientations of the fixture and its heads when it is patched into a show. x, y, and z are the position of the fixture’s origin point with respect to the show’s origin.

    +

    The fixture rotation is expressed as a list of relative-rotations in any order. Each list element is a tuple of the rotation type (:x-rotation, :y-rotation, or :z-rotation) and the counter-clockwise angle in radians around that axis which the fixture should be rotated. The fixtue starts at its reference orientation, and these intrinsic rotations are applied, in order, always from the frame of reference of the fixture, including any accumulated previous rotations.

    transform-fixture-rotation-matrix

    (transform-fixture-rotation-matrix fixture x y z rotation)

    Determine the positions and orientations of the fixture and its heads when it is patched into a show. x, y, and z are the position of the fixture’s origin point with respect to the show’s origin.

    The fixture rotation is expressed as a javax.media.j3d.Transform3D matrix containing only rotational components which represents the transformation needed to get the fixture from its reference orientation to the orientation at which it was actually hung.

    -

    This function is useful when you are precomupting a set of rotations based on groups of fixtures that are being patched as an assembly.

    two-pi

    The angle which represents a full rotation around a circle.

    \ No newline at end of file +

    This function is useful when you are precomupting a set of rotations based on groups of fixtures that are being patched as an assembly.

    two-pi

    The angle which represents a full rotation around a circle.

    \ No newline at end of file diff --git a/api-doc/afterglow.util.html b/api-doc/afterglow.util.html index c833c613..b5db9a1d 100644 --- a/api-doc/afterglow.util.html +++ b/api-doc/afterglow.util.html @@ -1,3 +1,3 @@ -afterglow.util documentation

    afterglow.util

    Utility functions that are likely to be widely useful

    contrasting-text-color

    (contrasting-text-color color)

    If the default text color of white will be hard to read against a cell assigned the specified color, returns black. Otherwise returns white. Both are in the form of hex strings suitable for use in a CSS style.

    find-closest-key

    (find-closest-key sm k)

    Finds the key closest to the one specified in a sorted map.

    float-epsilon

    The tolerance value for comparing two floating point numbers. If the difference between the values is smaller than this, after scaling appropriately for very small or very large numbers, they will be considered equal.

    float<

    (float< x y)(float< x y epsilon)

    Checks whether x is less than y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float<=

    (float<= x y)(float<= x y epsilon)

    Checks whether x is less than or equal to y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float=

    (float= x y)(float= x y epsilon)

    Compare two floating point numbers for equality, with a tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float>

    (float> x y)(float> x y epsilon)

    Checks whether x is greater than y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float>=

    (float>= x y)(float>= x y epsilon)

    Checks whether x is greater than or equal to y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    normalize-cue-variable-value

    (normalize-cue-variable-value var-spec raw)

    Given a raw value that has been looked up for a cue variable, convert it to the appropriate type based on the variable specification.

    ubyte

    (ubyte val)

    Convert small integer to its signed byte equivalent. Necessary for convenient handling of DMX values in the range 0-255, since Java does not have unsigned numbers.

    unsign

    (unsign val)

    Convert a signed byte to its unsigned int equivalent, in the range 0-255.

    valid-dmx-value?

    (valid-dmx-value? v)

    Checks that the supplied value is within the legal range for a DMX channel assignment.

    \ No newline at end of file +afterglow.util documentation

    afterglow.util

    Utility functions that are likely to be widely useful

    contrasting-text-color

    (contrasting-text-color color)

    If the default text color of white will be hard to read against a cell assigned the specified color, returns black. Otherwise returns white. Both are in the form of hex strings suitable for use in a CSS style.

    find-closest-key

    (find-closest-key sm k)

    Finds the key closest to the one specified in a sorted map.

    float-epsilon

    The tolerance value for comparing two floating point numbers. If the difference between the values is smaller than this, after scaling appropriately for very small or very large numbers, they will be considered equal.

    float<

    (float< x y)(float< x y epsilon)

    Checks whether x is less than y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float<=

    (float<= x y)(float<= x y epsilon)

    Checks whether x is less than or equal to y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float=

    (float= x y)(float= x y epsilon)

    Compare two floating point numbers for equality, with a tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float>

    (float> x y)(float> x y epsilon)

    Checks whether x is greater than y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    float>=

    (float>= x y)(float>= x y epsilon)

    Checks whether x is greater than or equal to y with an equality tolerance specified by epsilon, which defaults to float-epsilon if not provided.

    normalize-cue-variable-value

    (normalize-cue-variable-value var-spec raw)

    Given a raw value that has been looked up for a cue variable, convert it to the appropriate type based on the variable specification.

    ubyte

    (ubyte val)

    Convert small integer to its signed byte equivalent. Necessary for convenient handling of DMX values in the range 0-255, since Java does not have unsigned numbers.

    unsign

    (unsign val)

    Convert a signed byte to its unsigned int equivalent, in the range 0-255.

    valid-dmx-value?

    (valid-dmx-value? v)

    Checks that the supplied value is within the legal range for a DMX channel assignment.

    \ No newline at end of file diff --git a/api-doc/afterglow.version.html b/api-doc/afterglow.version.html index 8d88ccf5..0dd23045 100644 --- a/api-doc/afterglow.version.html +++ b/api-doc/afterglow.version.html @@ -1,3 +1,3 @@ -afterglow.version documentation

    afterglow.version

    Allows the runtime environment to determine the project name and version which built it.

    tag

    (tag)

    Returns the version tag from the project.clj file, either from the environment variable set up by Leiningen, if running in development mode, or from the JAR manifest if running from a production build.

    title

    (title)

    Returns the project name from the project.clj file, either from the environment variable set up by Leiningen, if running in development mode, or from the JAR manifest if running from a production build.

    \ No newline at end of file +afterglow.version documentation

    afterglow.version

    Allows the runtime environment to determine the project name and version which built it.

    tag

    (tag)

    Returns the version tag from the project.clj file, either from the environment variable set up by Leiningen, if running in development mode, or from the JAR manifest if running from a production build.

    title

    (title)

    Returns the project name from the project.clj file, either from the environment variable set up by Leiningen, if running in development mode, or from the JAR manifest if running from a production build.

    \ No newline at end of file diff --git a/api-doc/afterglow.web.handler.html b/api-doc/afterglow.web.handler.html index 41c9d5cb..456601c1 100644 --- a/api-doc/afterglow.web.handler.html +++ b/api-doc/afterglow.web.handler.html @@ -1,3 +1,3 @@ -afterglow.web.handler documentation

    afterglow.web.handler

    app

    base-routes

    \ No newline at end of file +afterglow.web.handler documentation

    afterglow.web.handler

    app

    base-routes

    \ No newline at end of file diff --git a/api-doc/afterglow.web.layout.html b/api-doc/afterglow.web.layout.html index 52c18f64..f2cf6af5 100644 --- a/api-doc/afterglow.web.layout.html +++ b/api-doc/afterglow.web.layout.html @@ -1,3 +1,3 @@ -afterglow.web.layout documentation

    afterglow.web.layout

    *identity*

    dynamic

    *servlet-context*

    dynamic

    render

    (render template & [params])

    render-with-type

    (render-with-type template mime-type & [params])
    \ No newline at end of file +afterglow.web.layout documentation

    afterglow.web.layout

    *identity*

    dynamic

    *servlet-context*

    dynamic

    render

    (render template & [params])

    render-with-type

    (render-with-type template mime-type & [params])
    \ No newline at end of file diff --git a/api-doc/afterglow.web.middleware.html b/api-doc/afterglow.web.middleware.html index 63ae598e..26ba68ee 100644 --- a/api-doc/afterglow.web.middleware.html +++ b/api-doc/afterglow.web.middleware.html @@ -1,3 +1,3 @@ -afterglow.web.middleware documentation

    afterglow.web.middleware

    on-error

    (on-error request response)

    wrap-auth

    (wrap-auth handler)

    wrap-base

    (wrap-base handler)

    wrap-csrf

    (wrap-csrf handler)

    wrap-dev

    (wrap-dev handler)

    wrap-formats

    (wrap-formats handler)

    wrap-identity

    (wrap-identity handler)

    wrap-internal-error

    (wrap-internal-error handler)

    wrap-restricted

    (wrap-restricted handler)

    wrap-servlet-context

    (wrap-servlet-context handler)
    \ No newline at end of file +afterglow.web.middleware documentation

    afterglow.web.middleware

    on-error

    (on-error request response)

    wrap-auth

    (wrap-auth handler)

    wrap-base

    (wrap-base handler)

    wrap-csrf

    (wrap-csrf handler)

    wrap-dev

    (wrap-dev handler)

    wrap-formats

    (wrap-formats handler)

    wrap-identity

    (wrap-identity handler)

    wrap-internal-error

    (wrap-internal-error handler)

    wrap-restricted

    (wrap-restricted handler)

    wrap-servlet-context

    (wrap-servlet-context handler)
    \ No newline at end of file diff --git a/api-doc/afterglow.web.routes.home.html b/api-doc/afterglow.web.routes.home.html index f88da7c3..4d047e47 100644 --- a/api-doc/afterglow.web.routes.home.html +++ b/api-doc/afterglow.web.routes.home.html @@ -1,3 +1,3 @@ -afterglow.web.routes.home documentation

    afterglow.web.routes.home

    about-page

    (about-page)

    home-page

    (home-page)

    home-routes

    visualizer-page

    (visualizer-page)
    \ No newline at end of file +afterglow.web.routes.home documentation

    afterglow.web.routes.home

    about-page

    (about-page)

    home-page

    (home-page)

    home-routes

    visualizer-page

    (visualizer-page)
    \ No newline at end of file diff --git a/api-doc/afterglow.web.routes.show-control.html b/api-doc/afterglow.web.routes.show-control.html index 6a86eb5c..d5aa4f9f 100644 --- a/api-doc/afterglow.web.routes.show-control.html +++ b/api-doc/afterglow.web.routes.show-control.html @@ -1,3 +1,3 @@ -afterglow.web.routes.show-control documentation

    afterglow.web.routes.show-control

    build-sync-select

    (build-sync-select page-id)

    Creates the list needed by the template which renders the HTML interface allowing the user to link to one of the currently available sources of metronome synchronization, with the current selection, if any, properly identified.

    clients

    Tracks the active show interface pages, and any pending interface updates for each.

    cue-view

    (cue-view show left bottom width height holding snapshot)

    Returns a nested structure of rows of cue information starting at the specified origin, with the specified width and height. Ideal for looping over and rendering in textual form, such as in a HTML table. Each cell contains a tuple [cue effect], the cue assigned to that grid location, and the currently-running effect, if any, launched from that cue. Cells which do not have associated cues still be assigned a unique cue ID (identifying page-relative coordinates, with zero at the lower left) so they can be updated if a cue is created for that slot while the page is still up.

    effect-save-button-changes

    (effect-save-button-changes page-id current)

    Returns the changes which need to be sent to a page to update its effect save/clear button states since it was last rendered, and updates the record.

    effect-save-button-states

    (effect-save-button-states show current)

    Returns a set describing all effects which should have a save or clear button visible based on the state of their cue variables. Set elements are a tuple of the effect ID and either :save or :clear, depending on which button should be visible.

    effect-time-formatter

    The format to use when showing the time an effect was started. See the clj-time documentation if you want details of how to set up a different format string.

    get-ui-updates

    (get-ui-updates id)

    Route which delivers any changes which need to be applied to a show web interface to reflect differences in the current show state compared to when it was last updated.

    hundredths

    (hundredths n)

    Given a value from 0 to 1, return it as a rounded number of hundredths, except return 99 when it would round to 100, since it has to tie in with a whole value that we cannot easily increment. Used to provide information about the fractional beat and second at which an effect was started in the web interface.

    load-update

    (load-update page-id)

    If the show is running and we haven’t sent a load update in the last half second, send one.

    macro-record-file

    metronome-bpm-delta-for-event

    (metronome-bpm-delta-for-event page-info kind)

    If the UI event name submitted by a show page corresponds to a metronome bpm shift, and the metronome is not synced, return the appropriate bpm adjustment.

    metronome-changes

    (metronome-changes page-id snapshot)

    Return the list of changes that should be applied to the show metronome section since the last time it was updated.

    metronome-delta-for-event

    (metronome-delta-for-event page-info kind)

    If the UI event name submitted by a show page corresponds to a metronome shift, return the appropriate number of milliseconds.

    metronome-states

    (metronome-states show last-states snap)

    Gather details about the current state of the main show metronome.

    post-ui-event

    (post-ui-event id kind req)

    Route which reports a user interaction with the show web interface.

    show-page

    (show-page show-id)

    Renders the web interface for interacting with the specified show.

    status-update

    (status-update page-id)

    If the running or error status of the show has changed, send an update about it.

    sync-menu-changes

    (sync-menu-changes page-id)

    Return any changes that should be applied to the menu of available metronome sync options since the last time it was updated.

    update-known-controllers

    (update-known-controllers page-id)

    Makes sure the cached page information contains list of the currently-registered physical grid controllers associated with a page’s show, assigning each a unique id number, so they can be selected in the user interface for scrolling or linking to. If this list changed, return the new list so it can be sent as an update to the page.

    update-known-midi-sync-sources

    (update-known-midi-sync-sources page-id)

    Scans for sources of MIDI clock pulses, and updates the cached page information to contain current list, assigning each a unique id number, so they can be selected in the sync interface.

    \ No newline at end of file +afterglow.web.routes.show-control documentation

    afterglow.web.routes.show-control

    build-sync-select

    (build-sync-select page-id)

    Creates the list needed by the template which renders the HTML interface allowing the user to link to one of the currently available sources of metronome synchronization, with the current selection, if any, properly identified.

    clients

    Tracks the active show interface pages, and any pending interface updates for each.

    cue-view

    (cue-view show left bottom width height holding snapshot)

    Returns a nested structure of rows of cue information starting at the specified origin, with the specified width and height. Ideal for looping over and rendering in textual form, such as in a HTML table. Each cell contains a tuple [cue effect], the cue assigned to that grid location, and the currently-running effect, if any, launched from that cue. Cells which do not have associated cues still be assigned a unique cue ID (identifying page-relative coordinates, with zero at the lower left) so they can be updated if a cue is created for that slot while the page is still up.

    effect-save-button-changes

    (effect-save-button-changes page-id current)

    Returns the changes which need to be sent to a page to update its effect save/clear button states since it was last rendered, and updates the record.

    effect-save-button-states

    (effect-save-button-states show current)

    Returns a set describing all effects which should have a save or clear button visible based on the state of their cue variables. Set elements are a tuple of the effect ID and either :save or :clear, depending on which button should be visible.

    effect-time-formatter

    The format to use when showing the time an effect was started. See the clj-time documentation if you want details of how to set up a different format string.

    get-ui-updates

    (get-ui-updates id)

    Route which delivers any changes which need to be applied to a show web interface to reflect differences in the current show state compared to when it was last updated.

    hundredths

    (hundredths n)

    Given a value from 0 to 1, return it as a rounded number of hundredths, except return 99 when it would round to 100, since it has to tie in with a whole value that we cannot easily increment. Used to provide information about the fractional beat and second at which an effect was started in the web interface.

    load-update

    (load-update page-id)

    If the show is running and we haven’t sent a load update in the last half second, send one.

    macro-record-file

    metronome-bpm-delta-for-event

    (metronome-bpm-delta-for-event page-info kind)

    If the UI event name submitted by a show page corresponds to a metronome bpm shift, and the metronome is not synced, return the appropriate bpm adjustment.

    metronome-changes

    (metronome-changes page-id snapshot)

    Return the list of changes that should be applied to the show metronome section since the last time it was updated.

    metronome-delta-for-event

    (metronome-delta-for-event page-info kind)

    If the UI event name submitted by a show page corresponds to a metronome shift, return the appropriate number of milliseconds.

    metronome-states

    (metronome-states show last-states snap)

    Gather details about the current state of the main show metronome.

    post-ui-event

    (post-ui-event id kind req)

    Route which reports a user interaction with the show web interface.

    show-page

    (show-page show-id)

    Renders the web interface for interacting with the specified show.

    status-update

    (status-update page-id)

    If the running or error status of the show has changed, send an update about it.

    sync-menu-changes

    (sync-menu-changes page-id)

    Return any changes that should be applied to the menu of available metronome sync options since the last time it was updated.

    update-known-controllers

    (update-known-controllers page-id)

    Makes sure the cached page information contains list of the currently-registered physical grid controllers associated with a page’s show, assigning each a unique id number, so they can be selected in the user interface for scrolling or linking to. If this list changed, return the new list so it can be sent as an update to the page.

    update-known-midi-sync-sources

    (update-known-midi-sync-sources page-id)

    Scans for sources of MIDI clock pulses, and updates the cached page information to contain current list, assigning each a unique id number, so they can be selected in the sync interface.

    \ No newline at end of file diff --git a/api-doc/afterglow.web.routes.visualizer.html b/api-doc/afterglow.web.routes.visualizer.html index c957918d..59191f61 100644 --- a/api-doc/afterglow.web.routes.visualizer.html +++ b/api-doc/afterglow.web.routes.visualizer.html @@ -1,3 +1,3 @@ -afterglow.web.routes.visualizer documentation

    afterglow.web.routes.visualizer

    active-fixtures

    (active-fixtures show)

    Return the fixtures which should currently be rendered, because they are emitting light.

    active?

    (active? show [id fixture-or-head])

    Check whether the given fixture (represented as a tuple of [id spec], as found in a show’s :visualizer-visible map) should be included in the current visualizer frame, because it is emitting light.

    adjusted-positions

    (adjusted-positions lights show scale)

    Move the spotlights so they all fit within the shader’s bounding cube, which extends from [-0.5, 0.25, 0.5] to [0.5, -0.25, 0].

    adjusted-rotations

    (adjusted-rotations show)

    Get the current orientations of the active spotlights for the visualizer. Return as a series of columns of the rotation matrices, since it looks like WebGL or THREE.js is a lot happier passing vectors than matrices as uniforms.

    axis-shift

    (axis-shift show axis origin available-span scale)

    Determine how much we need to translate show space points along an axis after they have been scaled to move them into the shader’s bounding cube. If there is extra room for this axis, center it within the bounding cube.

    byte-to-double

    (byte-to-double val)

    Convert a one-byte color component, as used in Afterglow, to a floating point color component as used in OpenGL, where 255 becomes 1.0.

    current-colors

    (current-colors lights show)

    Get the current color values of the active spotlights for the visualizer. Return as a series of four-element vectors of red, green, blue, and alpha.

    current-pan-tilts

    (current-pan-tilts lights show)

    Get the current pan and tilt values of the active spotlights for the visualizer. Return as a series of two-element vectors of pan and tilt angles in the perspective of the visualizer, to save space compared to sending actual rotation matrices.

    max-lights

    The maximum number of lights that the visualizer will attempt to render. Adjust this based on the performance of your graphics hardware.

    page

    (page show-id)

    Render the real-time show preview.

    shader

    (shader show-id)

    Render a GLSL shader capable of volumetric rendering of enough lights to accommodate the current show.

    shader-offsets

    (shader-offsets show scale)

    Determine the values to add to the coordinates of scaled light positions to move them inside the shader’s bounding cube, whose origin is [-0.5, -0.25, 0].

    shader-scale

    (shader-scale show)

    Determine how much we need to scale the show so it fits in the shader’s bounding cube which has a width of 1.0, a height of 0.5, and a depth of 0.5. We are not going to shift lights down to the floor, though.

    show-span

    (show-span show axis)

    Determine the degree to which a show spreads over an axis. For the X and Z axes, this is simply the difference in bounding box coordinates. For Y, we want to preserve height from the floor, so we use zero as a lower bound on the minimum coordinate.

    update-preview

    (update-preview show-id)

    Render updated lighting information for the preview.

    visualizer-pan-tilt

    (visualizer-pan-tilt head pan tilt)

    Given a head and DMX pan and tilt values, calculate the pan and tilt angles to send the visualizer

    \ No newline at end of file +afterglow.web.routes.visualizer documentation

    afterglow.web.routes.visualizer

    active-fixtures

    (active-fixtures show)

    Return the fixtures which should currently be rendered, because they are emitting light.

    active?

    (active? show [id fixture-or-head])

    Check whether the given fixture (represented as a tuple of [id spec], as found in a show’s :visualizer-visible map) should be included in the current visualizer frame, because it is emitting light.

    adjusted-positions

    (adjusted-positions lights show scale)

    Move the spotlights so they all fit within the shader’s bounding cube, which extends from [-0.5, 0.25, 0.5] to [0.5, -0.25, 0].

    adjusted-rotations

    (adjusted-rotations show)

    Get the current orientations of the active spotlights for the visualizer. Return as a series of columns of the rotation matrices, since it looks like WebGL or THREE.js is a lot happier passing vectors than matrices as uniforms.

    axis-shift

    (axis-shift show axis origin available-span scale)

    Determine how much we need to translate show space points along an axis after they have been scaled to move them into the shader’s bounding cube. If there is extra room for this axis, center it within the bounding cube.

    byte-to-double

    (byte-to-double val)

    Convert a one-byte color component, as used in Afterglow, to a floating point color component as used in OpenGL, where 255 becomes 1.0.

    current-colors

    (current-colors lights show)

    Get the current color values of the active spotlights for the visualizer. Return as a series of four-element vectors of red, green, blue, and alpha.

    current-pan-tilts

    (current-pan-tilts lights show)

    Get the current pan and tilt values of the active spotlights for the visualizer. Return as a series of two-element vectors of pan and tilt angles in the perspective of the visualizer, to save space compared to sending actual rotation matrices.

    max-lights

    The maximum number of lights that the visualizer will attempt to render. Adjust this based on the performance of your graphics hardware.

    page

    (page show-id)

    Render the real-time show preview.

    shader

    (shader show-id)

    Render a GLSL shader capable of volumetric rendering of enough lights to accommodate the current show.

    shader-offsets

    (shader-offsets show scale)

    Determine the values to add to the coordinates of scaled light positions to move them inside the shader’s bounding cube, whose origin is [-0.5, -0.25, 0].

    shader-scale

    (shader-scale show)

    Determine how much we need to scale the show so it fits in the shader’s bounding cube which has a width of 1.0, a height of 0.5, and a depth of 0.5. We are not going to shift lights down to the floor, though.

    show-span

    (show-span show axis)

    Determine the degree to which a show spreads over an axis. For the X and Z axes, this is simply the difference in bounding box coordinates. For Y, we want to preserve height from the floor, so we use zero as a lower bound on the minimum coordinate.

    update-preview

    (update-preview show-id)

    Render updated lighting information for the preview.

    visualizer-pan-tilt

    (visualizer-pan-tilt head pan tilt)

    Given a head and DMX pan and tilt values, calculate the pan and tilt angles to send the visualizer

    \ No newline at end of file diff --git a/api-doc/afterglow.web.routes.web-repl.html b/api-doc/afterglow.web.routes.web-repl.html index 6d4960f4..1d12d76f 100644 --- a/api-doc/afterglow.web.routes.web-repl.html +++ b/api-doc/afterglow.web.routes.web-repl.html @@ -1,3 +1,3 @@ -afterglow.web.routes.web-repl documentation

    afterglow.web.routes.web-repl

    Provides a web interface for interacting with the Clojure environment.

    clean-expired-bindings

    (clean-expired-bindings web-sessions)

    Clean out the dynamic variable bindings stored for web sessions which have expired. Ignores bindings whose keys are not strings, because they do not come from web sessions, but from hosting environments like afterglow-max which do not expire.

    discard-bindings

    (discard-bindings session-key)

    Clean up the thread-local bindings stored for a non-web hosted repl session, such as those used by afterglow-max, which are not automatically timed out. session-key is the unique, non-String key used to identify the REPL session to do-eval.

    do-eval

    (do-eval txt session-key)

    Evaluate an expression sent to the web REPL and return the result or an error description. Also supports evaluation of expressions in non-web hosting contexts like afterglow-max by passing in a unique non-String value for session-key. In such cases the thread local bindings will not be automatically cleaned up, and it is the responsibility of the hosting implementation to call discard-bindings when they are no longer needed.

    handle-command

    (handle-command req)

    Route which processes a command typed into the web console.

    page

    (page)

    Route which renders the web console interface.

    with-session

    macro

    (with-session session-key & body)

    Wrap the body in a session-specific set of dynamic variable bindings.

    \ No newline at end of file +afterglow.web.routes.web-repl documentation

    afterglow.web.routes.web-repl

    Provides a web interface for interacting with the Clojure environment.

    clean-expired-bindings

    (clean-expired-bindings web-sessions)

    Clean out the dynamic variable bindings stored for web sessions which have expired. Ignores bindings whose keys are not strings, because they do not come from web sessions, but from hosting environments like afterglow-max which do not expire.

    discard-bindings

    (discard-bindings session-key)

    Clean up the thread-local bindings stored for a non-web hosted repl session, such as those used by afterglow-max, which are not automatically timed out. session-key is the unique, non-String key used to identify the REPL session to do-eval.

    do-eval

    (do-eval txt session-key)

    Evaluate an expression sent to the web REPL and return the result or an error description. Also supports evaluation of expressions in non-web hosting contexts like afterglow-max by passing in a unique non-String value for session-key. In such cases the thread local bindings will not be automatically cleaned up, and it is the responsibility of the hosting implementation to call discard-bindings when they are no longer needed.

    handle-command

    (handle-command req)

    Route which processes a command typed into the web console.

    page

    (page)

    Route which renders the web console interface.

    with-session

    macro

    (with-session session-key & body)

    Wrap the body in a session-specific set of dynamic variable bindings.

    \ No newline at end of file diff --git a/api-doc/afterglow.web.session.html b/api-doc/afterglow.web.session.html index 00b7d48a..4f92a5a3 100644 --- a/api-doc/afterglow.web.session.html +++ b/api-doc/afterglow.web.session.html @@ -1,3 +1,3 @@ -afterglow.web.session documentation

    afterglow.web.session

    Manages the session store for Afterglow’s web interface

    clear-expired-sessions

    (clear-expired-sessions)

    Removes any session entries for sessions whose expiration time has arrived.

    half-hour

    How often expired sessions should be purged.

    mem

    The session store

    start-cleanup-job!

    (start-cleanup-job!)

    Creates a background thread which cleans out expired sessions every half hour.

    \ No newline at end of file +afterglow.web.session documentation

    afterglow.web.session

    Manages the session store for Afterglow’s web interface

    clear-expired-sessions

    (clear-expired-sessions)

    Removes any session entries for sessions whose expiration time has arrived.

    half-hour

    How often expired sessions should be purged.

    mem

    The session store

    start-cleanup-job!

    (start-cleanup-job!)

    Creates a background thread which cleans out expired sessions every half hour.

    \ No newline at end of file diff --git a/api-doc/index.html b/api-doc/index.html index 3b25f23a..0ac1eeb9 100644 --- a/api-doc/index.html +++ b/api-doc/index.html @@ -1,3 +1,3 @@ -Afterglow 0.2.1-SNAPSHOT

    Afterglow 0.2.1-SNAPSHOT

    A live-coding environment for light shows, built on the Open Lighting Architecture, using bits of Overtone.

    Installation

    To install, add the following dependency to your project or build file:

    [afterglow "0.2.1-SNAPSHOT"]

    Namespaces

    afterglow.beyond

    Provides the ability to communicate with Pangolin’s Beyond laser show software, including synchronizing it with Afterglow’s BPM and beat grid, and triggering cues. This initial implementation assumes that sending small UDP datagrams is fast enough that it can be done on the caller’s thread. If this turns out not to be true, it can be changed to use a core.async channel the way that ola-clojure does.

    afterglow.channels

    Functions for modeling DMX channels

    afterglow.controllers

    Provides shared services for all controller implementations.

    afterglow.controllers.ableton-push

    Allows the Ableton Push to be used as a control surface for Afterglow. Its features are described in the online documentation.

    afterglow.controllers.ableton-push-2

    Allows the Ableton Push 2 to be used as a control surface for Afterglow. Its features are described in the online documentation.

    afterglow.controllers.color

    Provides support for adjusting components of a show variable containing a color using any MIDI controller.

    Public variables and functions:

    afterglow.controllers.launchpad-mini

    Allows the Novation Launchpad Mini and Launchpad S to be used as control surfaces for Afterglow.

    afterglow.controllers.launchpad-mk2

    Allows the Novation Launchpad Mk2 to be used as a control surface for Afterglow.

    afterglow.controllers.launchpad-pro

    Allows the Novation Launchpad Pro to be used as a control surface for Afterglow.

    afterglow.controllers.tempo

    Provides support for easily implementing tap-tempo and shift buttons on any MIDI controller.

    afterglow.core

    This is the main class for running Afterglow as a self-contained JAR application. When you are learning and experimenting in your REPL, the main namespace you want to be using is afterglow.examples

    afterglow.coremidi4j

    Public variables and functions:

    afterglow.dj-link

    Provides synchronization with equipment sending Pioneer Pro DJ Link packets on the local network, such as Pioneer Nexus mixers and players. This is purely experimental and based on network traffic capture, but unless they change the protocol, it works really well, providing rock solid BPM, beat, and measure-phase tracking.

    afterglow.effects

    Support functions for building the effects pipeline.

    afterglow.effects.channel

    Effects pipeline functions for working with individual DMX channels.

    afterglow.effects.color

    Effects pipeline functions for working with color assignments to fixtures and heads.

    afterglow.effects.cues

    Cues provide a user interface for controlling effects, by associating them with cells in a cue grid so they can be easily triggered and monitored, either through a physical grid controller, or the web show control interface. They also provide a way of binding cue variables to effect parameters, which can enable controller interfaces to adjust them, and of tying those variables to velocity and pressure sensitivity on physical grid controllers which have such capabilities.

    afterglow.effects.dimmer

    Effects pipeline functions for working with dimmer channels for fixtures and heads. Dimmer effects are always tied to a master chain, which can scale back the maximum allowable value for that dimmer channel, as a percentage. Unless otherwise specified, the dimmer cue will be attached to the show grand master, but you can create other masters to adjust the brightness of groups of fixtures, perhaps because they are intrinsically brighter, or to adjust the balance of lighting for artistic reasons. Secondary masters can be chained to each other, and are always chained to the show grand master, so turning that down will dim the entire show; setting it to zero will black out the show.

    afterglow.effects.fun

    A collection of neat effects that are both useful in shows, and examples of how to create such things.

    afterglow.effects.movement

    Effects pipeline functions for working with direction assignments to fixtures and heads.

    afterglow.effects.oscillators

    Provide a variety of waveforms at frequencies related to the show metronome to facilitate building visually and musically pleasing effects.

    afterglow.effects.params

    A general mechanism for passing dynamic parameters to effect functions and assigners allowing for dynamic values to be computed either when an effect creates its assigners, or when the assigners are resolving DMX values. Parameters can be calculated based on the show metronome snapshot, show variables (which can be bound to OSC and MIDI mappings), and other, not-yet-imagined things.

    afterglow.effects.show-variable

    Virtual effects which set a value in a show variable while they are running. Pair well with conditional-effect to modify the behavior of scenes based on the activation of other cues.

    Public variables and functions:

    afterglow.examples

    Show some simple ways to use Afterglow, and hopefully inspire exploration.

    afterglow.fixtures

    Utility functions common to fixture definitions.

    afterglow.fixtures.american-dj

    Definitions for fixtures provided by American DJ.

    Public variables and functions:

    afterglow.fixtures.blizzard

    Definitions for fixtures provided by Blizzard Lighting.

    afterglow.fixtures.chauvet

    Models for fixtures provided by Chauvet Lighting.

    afterglow.fixtures.qxf

    Functions to work with Fixture Definition Files from the QLC+ open-source lighting controller project. While these do not contain all of the information Afterglow needs to fully control a fixture with its geometric reasoning, they can form a good starting point and save you a lot of tedious capability translation. You can find the available .qxf files on Github.

    Public variables and functions:

    afterglow.init

    This namespace is the context in which any init-files specified on the command line will be loaded during startup, in case they forget to establish their own namespaces.

    Public variables and functions:

      afterglow.midi

      Handles MIDI communication, including syncing a show metronome to MIDI clock pulses.

      afterglow.rhythm

      Functions to help work with musical time, evolved from the original version in Overtone.

      afterglow.show

      Encapsulates a synchronized light show, executing a varying collection of effects with output to a number of DMX universes. Assumes control of the assigned universes, so only one show at a time should be assigned a given universe. Of course, you can stack as many effects as you’d like in that show.

      afterglow.show-context

      Establishes a notion of the current show using the dynamic var *show*, to save having to pass it as a parameter to dozens of functions in the Afterglow API. This needs to be bound to a value for many Afterglow functions to work.

      Public variables and functions:

      afterglow.shows.sallie

      Cues for Sallie’s birthday/housewarming party. Useful as an example of how an actual small show was put together early in Afterglow’s development, and also as a source of effects that may want to make there way into a more central place.

      afterglow.transform

      Functions for modeling light position and rotation. If you want to make use of Afterglow’s spatial reasoning capabilities, you need to tell it, when patching a fixture, the location and orientation of that fixture.

      afterglow.util

      Utility functions that are likely to be widely useful

      afterglow.version

      Allows the runtime environment to determine the project name and version which built it.

      Public variables and functions:

      afterglow.web.handler

      Public variables and functions:

      afterglow.web.layout

      Public variables and functions:

      afterglow.web.middleware

      afterglow.web.routes.home

      Public variables and functions:

      afterglow.web.routes.show-control

      afterglow.web.routes.visualizer

      afterglow.web.routes.web-repl

      Provides a web interface for interacting with the Clojure environment.

      afterglow.web.session

      Manages the session store for Afterglow’s web interface

      Public variables and functions:

      \ No newline at end of file +Afterglow 0.2.1

      Afterglow 0.2.1

      A live-coding environment for light shows, built on the Open Lighting Architecture, using bits of Overtone.

      Installation

      To install, add the following dependency to your project or build file:

      [afterglow "0.2.1"]

      Namespaces

      afterglow.beyond

      Provides the ability to communicate with Pangolin’s Beyond laser show software, including synchronizing it with Afterglow’s BPM and beat grid, and triggering cues. This initial implementation assumes that sending small UDP datagrams is fast enough that it can be done on the caller’s thread. If this turns out not to be true, it can be changed to use a core.async channel the way that ola-clojure does.

      afterglow.channels

      Functions for modeling DMX channels

      afterglow.controllers

      Provides shared services for all controller implementations.

      afterglow.controllers.ableton-push

      Allows the Ableton Push to be used as a control surface for Afterglow. Its features are described in the online documentation.

      afterglow.controllers.ableton-push-2

      Allows the Ableton Push 2 to be used as a control surface for Afterglow. Its features are described in the online documentation.

      afterglow.controllers.color

      Provides support for adjusting components of a show variable containing a color using any MIDI controller.

      Public variables and functions:

      afterglow.controllers.launchpad-mini

      Allows the Novation Launchpad Mini and Launchpad S to be used as control surfaces for Afterglow.

      afterglow.controllers.launchpad-mk2

      Allows the Novation Launchpad Mk2 to be used as a control surface for Afterglow.

      afterglow.controllers.launchpad-pro

      Allows the Novation Launchpad Pro to be used as a control surface for Afterglow.

      afterglow.controllers.tempo

      Provides support for easily implementing tap-tempo and shift buttons on any MIDI controller.

      afterglow.core

      This is the main class for running Afterglow as a self-contained JAR application. When you are learning and experimenting in your REPL, the main namespace you want to be using is afterglow.examples

      afterglow.coremidi4j

      Public variables and functions:

      afterglow.dj-link

      Provides synchronization with equipment sending Pioneer Pro DJ Link packets on the local network, such as Pioneer Nexus mixers and players. This is purely experimental and based on network traffic capture, but unless they change the protocol, it works really well, providing rock solid BPM, beat, and measure-phase tracking.

      afterglow.effects

      Support functions for building the effects pipeline.

      afterglow.effects.channel

      Effects pipeline functions for working with individual DMX channels.

      afterglow.effects.color

      Effects pipeline functions for working with color assignments to fixtures and heads.

      afterglow.effects.cues

      Cues provide a user interface for controlling effects, by associating them with cells in a cue grid so they can be easily triggered and monitored, either through a physical grid controller, or the web show control interface. They also provide a way of binding cue variables to effect parameters, which can enable controller interfaces to adjust them, and of tying those variables to velocity and pressure sensitivity on physical grid controllers which have such capabilities.

      afterglow.effects.dimmer

      Effects pipeline functions for working with dimmer channels for fixtures and heads. Dimmer effects are always tied to a master chain, which can scale back the maximum allowable value for that dimmer channel, as a percentage. Unless otherwise specified, the dimmer cue will be attached to the show grand master, but you can create other masters to adjust the brightness of groups of fixtures, perhaps because they are intrinsically brighter, or to adjust the balance of lighting for artistic reasons. Secondary masters can be chained to each other, and are always chained to the show grand master, so turning that down will dim the entire show; setting it to zero will black out the show.

      afterglow.effects.fun

      A collection of neat effects that are both useful in shows, and examples of how to create such things.

      afterglow.effects.movement

      Effects pipeline functions for working with direction assignments to fixtures and heads.

      afterglow.effects.oscillators

      Provide a variety of waveforms at frequencies related to the show metronome to facilitate building visually and musically pleasing effects.

      afterglow.effects.params

      A general mechanism for passing dynamic parameters to effect functions and assigners allowing for dynamic values to be computed either when an effect creates its assigners, or when the assigners are resolving DMX values. Parameters can be calculated based on the show metronome snapshot, show variables (which can be bound to OSC and MIDI mappings), and other, not-yet-imagined things.

      afterglow.effects.show-variable

      Virtual effects which set a value in a show variable while they are running. Pair well with conditional-effect to modify the behavior of scenes based on the activation of other cues.

      Public variables and functions:

      afterglow.examples

      Show some simple ways to use Afterglow, and hopefully inspire exploration.

      afterglow.fixtures

      Utility functions common to fixture definitions.

      afterglow.fixtures.american-dj

      Definitions for fixtures provided by American DJ.

      Public variables and functions:

      afterglow.fixtures.blizzard

      Definitions for fixtures provided by Blizzard Lighting.

      afterglow.fixtures.chauvet

      Models for fixtures provided by Chauvet Lighting.

      afterglow.fixtures.qxf

      Functions to work with Fixture Definition Files from the QLC+ open-source lighting controller project. While these do not contain all of the information Afterglow needs to fully control a fixture with its geometric reasoning, they can form a good starting point and save you a lot of tedious capability translation. You can find the available .qxf files on Github.

      Public variables and functions:

      afterglow.init

      This namespace is the context in which any init-files specified on the command line will be loaded during startup, in case they forget to establish their own namespaces.

      Public variables and functions:

        afterglow.midi

        Handles MIDI communication, including syncing a show metronome to MIDI clock pulses.

        afterglow.rhythm

        Functions to help work with musical time, evolved from the original version in Overtone.

        afterglow.show

        Encapsulates a synchronized light show, executing a varying collection of effects with output to a number of DMX universes. Assumes control of the assigned universes, so only one show at a time should be assigned a given universe. Of course, you can stack as many effects as you’d like in that show.

        afterglow.show-context

        Establishes a notion of the current show using the dynamic var *show*, to save having to pass it as a parameter to dozens of functions in the Afterglow API. This needs to be bound to a value for many Afterglow functions to work.

        Public variables and functions:

        afterglow.shows.sallie

        Cues for Sallie’s birthday/housewarming party. Useful as an example of how an actual small show was put together early in Afterglow’s development, and also as a source of effects that may want to make there way into a more central place.

        afterglow.transform

        Functions for modeling light position and rotation. If you want to make use of Afterglow’s spatial reasoning capabilities, you need to tell it, when patching a fixture, the location and orientation of that fixture.

        afterglow.util

        Utility functions that are likely to be widely useful

        afterglow.version

        Allows the runtime environment to determine the project name and version which built it.

        Public variables and functions:

        afterglow.web.handler

        Public variables and functions:

        afterglow.web.layout

        Public variables and functions:

        afterglow.web.middleware

        afterglow.web.routes.home

        Public variables and functions:

        afterglow.web.routes.show-control

        afterglow.web.routes.visualizer

        afterglow.web.routes.web-repl

        Provides a web interface for interacting with the Clojure environment.

        afterglow.web.session

        Manages the session store for Afterglow’s web interface

        Public variables and functions:

        \ No newline at end of file diff --git a/doc/README.adoc b/doc/README.adoc index 930bd9e3..cf394e5b 100644 --- a/doc/README.adoc +++ b/doc/README.adoc @@ -2,7 +2,7 @@ James Elliott :icons: font :experimental: -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/color.adoc b/doc/color.adoc index bca3eff3..ec65aab0 100644 --- a/doc/color.adoc +++ b/doc/color.adoc @@ -2,7 +2,7 @@ James Elliott :icons: font :experimental: -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/cues.adoc b/doc/cues.adoc index 31f8cabe..84ea47f4 100644 --- a/doc/cues.adoc +++ b/doc/cues.adoc @@ -4,7 +4,7 @@ James Elliott :toc: :experimental: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/effects.adoc b/doc/effects.adoc index 6d714387..e245e81a 100644 --- a/doc/effects.adoc +++ b/doc/effects.adoc @@ -3,7 +3,7 @@ James Elliott :icons: font :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/fixture_definitions.adoc b/doc/fixture_definitions.adoc index d1979d38..064298e6 100644 --- a/doc/fixture_definitions.adoc +++ b/doc/fixture_definitions.adoc @@ -3,8 +3,8 @@ James Elliott :icons: font :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ -:branch-base: https://github.com/brunchboy/afterglow/blob/master/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ +:branch-base: https://github.com/brunchboy/afterglow/blob/v0.2.1/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. @@ -1125,7 +1125,7 @@ would result in the following Afterglow fixture definition file: Please flesh out this documentation if you are submitting this for inclusion into Afterglow. See, for example, the Blizzard fixture definitions: - http://rawgit.com/brunchboy/afterglow/master/api-doc/afterglow.fixtures.blizzard.html" + http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/afterglow.fixtures.blizzard.html" [] {:channels [(chan/color 1 :uv) ; TODO: add :hue key if you want to color mix this (chan/fine-channel :strobing 2 diff --git a/doc/launchpad.adoc b/doc/launchpad.adoc index e6349ebd..1509d258 100644 --- a/doc/launchpad.adoc +++ b/doc/launchpad.adoc @@ -4,7 +4,7 @@ James Elliott :experimental: :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/mapping_sync.adoc b/doc/mapping_sync.adoc index 337f50be..9d3b2f9f 100644 --- a/doc/mapping_sync.adoc +++ b/doc/mapping_sync.adoc @@ -4,7 +4,7 @@ James Elliott :experimental: :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/metronomes.adoc b/doc/metronomes.adoc index 8545dffc..1d6dba7f 100644 --- a/doc/metronomes.adoc +++ b/doc/metronomes.adoc @@ -1,7 +1,7 @@ = Metronomes James Elliott :icons: font -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/oscillators.adoc b/doc/oscillators.adoc index 3c50878c..df41d0eb 100644 --- a/doc/oscillators.adoc +++ b/doc/oscillators.adoc @@ -3,7 +3,7 @@ James Elliott :icons: font :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/parameters.adoc b/doc/parameters.adoc index b10fe72d..5949915d 100644 --- a/doc/parameters.adoc +++ b/doc/parameters.adoc @@ -3,7 +3,7 @@ James Elliott :icons: font :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/push.adoc b/doc/push.adoc index 99e99f87..735e67ce 100644 --- a/doc/push.adoc +++ b/doc/push.adoc @@ -4,7 +4,7 @@ James Elliott :experimental: :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/push2.adoc b/doc/push2.adoc index 6487a6fd..cd428300 100644 --- a/doc/push2.adoc +++ b/doc/push2.adoc @@ -4,7 +4,7 @@ James Elliott :experimental: :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/rendering_loop.adoc b/doc/rendering_loop.adoc index 1340e71b..2b2d765c 100644 --- a/doc/rendering_loop.adoc +++ b/doc/rendering_loop.adoc @@ -3,7 +3,7 @@ James Elliott :icons: font :toc: :toc-placement: preamble -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/doc/show_space.adoc b/doc/show_space.adoc index a984866e..34a3e19b 100644 --- a/doc/show_space.adoc +++ b/doc/show_space.adoc @@ -1,7 +1,7 @@ = Show Space James Elliott :icons: font -:api-doc: http://rawgit.com/brunchboy/afterglow/master/api-doc/ +:api-doc: http://cdn.rawgit.com/brunchboy/afterglow/v0.2.1/api-doc/ // Set up support for relative links on GitHub; add more conditions // if you need to support other environments and extensions. diff --git a/project.clj b/project.clj index b8418c1b..e44a5805 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject afterglow "0.2.1-SNAPSHOT" +(defproject afterglow "0.2.1" :description "A live-coding environment for light shows, built on the Open Lighting Architecture, using bits of Overtone." :url "https://github.com/brunchboy/afterglow" :license {:name "Eclipse Public License" @@ -32,7 +32,7 @@ [com.taoensso/timbre "4.3.1"] [com.taoensso/tower "3.0.2"] [com.taoensso/truss "1.2.0"] - [markdown-clj "0.9.86"] + [markdown-clj "0.9.87"] [compojure "1.5.0" :exclusions [org.eclipse.jetty/jetty-server clj-time]] [ring/ring-defaults "0.2.0"] @@ -42,7 +42,7 @@ org.clojure/java.classpath org.clojure/core.memoize]] [metosin/ring-http-response "0.6.5"] - [prone "1.1.0"] + [prone "1.1.1"] [buddy "0.11.0"] [instaparse "1.4.1"] [http-kit "2.1.19"]] @@ -72,6 +72,6 @@ [lein-environ "1.0.2"]] :codox {:output-path "api-doc" - :source-uri "https://github.com/brunchboy/afterglow/blob/master/{filepath}#L{line}" + :source-uri "https://github.com/brunchboy/afterglow/blob/v0.2.1/{filepath}#L{line}" :metadata {:doc/format :markdown}} :min-lein-version "2.0.0") diff --git a/resources/templates/home.html b/resources/templates/home.html index c0ff11ca..50b1d8a9 100644 --- a/resources/templates/home.html +++ b/resources/templates/home.html @@ -7,7 +7,7 @@

        Afterglow

        Open console » Open OLA » - Online Manual » + Online Manual »