Skip to content

A Clojure library for interacting with Novation Launchpad S or Mini. (Maybe even the old Launchpad?)

License

Notifications You must be signed in to change notification settings

fugalh/launchpad-clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Launchpad Mini

launchpad

A Clojure library for interacting with a Novation Launchpad.

Tested with a new Launchpad Mini in 2015, which I understand works the same as a Launchpad S, but smaller. It may work for an older model Launchpad too. The new full-size Launchpad and Launchpad Pro with RGB colors could probably be made to work, but I don't have one to test on so I'm ignoring it. If you're interested and can help test, reach out.

Usage

(require '[launchpad :as lp])

;; blinkenlights
(lp/grid [x y] [red green]) ; light a grid button
(lp/top x [red green])      ; light a top-row button
(lp/right y [red green])    ; light a right side-column button

;; start over
(lp/reset)

Colors are [red green] where red and green range from 0 (off) to 3 (brightest). Red and green mix to yield amber.

Coordinates are 0-indexed starting from the top-left.

There are examples for your perusal in src/examples.

Advanced Usage

Namespace launchpad will get you going, but for full power you'll want to use launchpad.core.

You can provide a reactor to the Launchpad, which is just a callback that will react to button presses, e.g. [:grid [x y] [r g]]. If your reactor returns a state, the Launchpad will update accordingly. Here's an example sketch, and you can see src/examples/roxanne.clj for a more complete example.

(defn next-state [state]
  ...)

(defn my-reactor [state what where velocity]
  (println [what where velocity])
  (next-state state))

(.react pad my-reactor)

Gotchas

There is a Java bug on OSX: Java caches the MIDI device list indefinitely. So you need to have the Launchpad plugged in before calling get-launchpad, else you have to restart the JVM.

TODO

Finish examples, and maybe make more (at least Knight Rider).

License

Copyright © 2015 Hans Fugal

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

A Clojure library for interacting with Novation Launchpad S or Mini. (Maybe even the old Launchpad?)

Resources

License

Stars

Watchers

Forks

Packages

No packages published