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.
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, Afterglow embeds CoreMIDI4J to provide a working implementation.
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
.
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.
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 (and please open a Pull Request); this filter seems to work for Mac OS X and Windows.
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.