This is a wrapper class for the Akai APCmini controller. It provides internal state customization, pad hold/switch functionality, visual slider mode and a nice starting animation, making the controller properly usable for any purpose. For the moment only tested for GNU/Linux.
(C) 2015 Andrés Pérez López // www.andresperezlopez.com // contact@andresperezlopez.com
Get the state of the pads (padInternalState) and Buttons (horizontal: horInternalState, vertical: verInternalState)
Pads and buttons can work in two different modes: \hold
or \switch
type |
|
mode |
In hold mode, the state will be ON only during the time pressing the pad/button. Pads can customize the ON color of the hold mode (but the state will be always the same: 1). Color can be one of the following symbols: \black
(no light), \red
, \blinkRed
, \green
, \blinkGreen
, \orange
or \blinkOrange
.
In switch mode, the state will be maintained until a new press is performed. Furthermore, pads allow for up to 4 different states, represented by different colours.
Set the number of states for a given pad
array |
An Array in the form [0, colorString0, 1, colorString1...] |
array |
An Array in the form [0, colorString0, 1, colorString1...] |
Get the number of states for each pad
Get a Dictionary with the state->color association for each pad
For each pad/button state, a Function can be passed and evaluated.
type |
|
num |
Button index |
In the case of the sliders, the function will be passed the slider index and the value.
num |
Slider index |
The code provides the option of using the pads for display the sliders value. That's called "slider mode". Slider mode can be toggled by the Shift pad, or by the following methods. During slider mode, any action in the pads or buttons won't have any effect.
Play the startup animation