launchpad-control-0.0.1.0: High and low-level interface to the Novation Launchpad midi controller.

Safe HaskellNone

System.MIDI.Launchpad.Control

Contents

Description

Low-level interface to the Novation Launchpad.

Synopsis

definitions

data Button Source

A button of the launchpad. Numbering starts from zero.

(Note that the derived ordering is the same as the "rapid LED update" order!)

Constructors

Pad

the 64 buttons in the grid

Fields

_padX :: !Int
 
_padY :: !Int
 
Side

the 8 buttons on the right side

Fields

_sideCol :: !Int
 
Dir

the left 4 buttons in the control row

Fields

_unDir :: !Dir
 
Ctrl

the right 4 buttons in the control row

Fields

_unCtrl :: !Control
 

Instances

data Dir Source

A direction, also the left top 4 control buttons in the top row.

Constructors

U 
D 
L 
R 

Instances

data Control Source

A control button (right 4 in the top row)

Constructors

Session 
User1 
User2 
Mixer 

data Buffer Source

Double-buffering.

Constructors

Front 
Back 

Instances

data FullColor Source

Note: there is some overlap between Yellow and Amber.

Constructors

Red 
Amber 
Yellow 
Green 

data Brightness Source

Note: there is some overlap between Off and None,

Constructors

Off 
Low 
Medium 
Full 

data Color Source

A color. There are two possible specifications:

  • either a predefined color with a brightness;
  • or exact control of the red and greed leds.

Instances

basic midi

theGlobalConnections :: MVar (Connection, Connection)Source

in-connection, out-connection

encoding colors

setting single leds

control buttons

initialization

resetMsg :: MessagesSource

Officially, reset is simply CC 0 0. But the Launchpad implementation is rather strange and somewhat stupid, see http://linuxaudio.org/mailarchive/lau/2012/7/12/191303

This convoluted reset sequence may or may not help...

turnOnAll :: Brightness -> MessagesSource

Turns on all leds

resetLaunchpad :: Bool -> IO ()Source

The argument controls if we want to flash all the leds for a moment

button presses

data ButtonPress Source

A button is pressed or released

Constructors

Press !Button 
Release !Button 

decodeLaunchpadMessage :: Message -> ButtonPressSource

Unsafe decoding, may throw error

led update

allButtons :: [Button]Source

Sorted list of all Launchpad buttons (sort order is the "rapid led update" order)

data Grid Source

Constructors

Grid 

Fields

_gridMain :: Array (Int, Int) Color

8x8 array of the main grid

_gridSide :: Array Int Color

length 8 array of the right column

_gridCtrl :: Array Int Color

length 8 array of the top row

Instances

ledUpdateInit :: MessagesSource

Actually this is at the moment empty.

ledUpdateClose :: MessagesSource

We have to exit the rapid led update mode before the next update! Setting the grid coordinate mode to XY should do the trick.

rapidLedUpdateArr :: Grid -> MessagesSource

Untested (the grid may be trransposed??)

helper functions

pairs :: [a] -> [(a, a)]Source