Holds the functions which 'talk MIDI' to the Launchpad via messages in the javax.sound.midi
package.
Holds the functions which 'talk MIDI' to the Launchpad via messages in the ```javax.sound.midi``` package.
Identifies the cursor down control button in messages sent to/from the Launchpad.
Identifies the cursor down control button in messages sent to/from the Launchpad.
Identifies the cursor left control button in messages sent to/from the Launchpad.
Identifies the cursor left control button in messages sent to/from the Launchpad.
Identifies the cursor right control button in messages sent to/from the Launchpad.
Identifies the cursor right control button in messages sent to/from the Launchpad.
Identifies the cursor up control button in messages sent to/from the Launchpad.
Identifies the cursor up control button in messages sent to/from the Launchpad.
Identifies the "Mixer" control button in messages sent to/from the Launchpad.
Identifies the "Mixer" control button in messages sent to/from the Launchpad.
Identifies the "Session" control button in messages sent to/from the Launchpad.
Identifies the "Session" control button in messages sent to/from the Launchpad.
Identifies the "User 1" control button in messages sent to/from the Launchpad.
Identifies the "User 1" control button in messages sent to/from the Launchpad.
Identifies the "User 2" control button in messages sent to/from the Launchpad.
Identifies the "User 2" control button in messages sent to/from the Launchpad.
(close lpad)
close the launchpad device.
Examples:
(close lpad)
close the launchpad device. Examples: ``` (close lpad) ```
(decode-message obj)
Decompose a com.sun.media.sound.FastShortMessage into a Launchpad-specific map.
Examples:
(def lp-msg (decode-message raw-msg))
(println (:x lp-msg) (:y lp-msg))
(println (:button-up? lp-msg))
(println (:velocity lp-msg))
(= (:note lp-msg) (:getData1 raw-msg))
Decompose a [com.sun.media.sound.FastShortMessage](http://www.docjar.com/docs/api/com/sun/media/sound/FastShortMessage.html) into a Launchpad-specific map. Examples: ``` (def lp-msg (decode-message raw-msg)) (println (:x lp-msg) (:y lp-msg)) (println (:button-up? lp-msg)) (println (:velocity lp-msg)) (= (:note lp-msg) (:getData1 raw-msg)) ```
(open name)
find the launchpad by name in the available midi devices and return a launchpad object suitable for the calls of this library
name
should be the string returned from MidiSystem/getMidiDeviceInfoExamples:
(open "MK2 [hw:2,0,0]")
find the launchpad by name in the available midi devices and return a launchpad object suitable for the calls of this library * `name` should be the string returned from [MidiSystem/getMidiDeviceInfo](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/MidiSystem.html) Examples: ``` (open "MK2 [hw:2,0,0]") ```
(remove-button-press-handler {:keys [in]})
Remove any event handlers.
in
key which returns a javax.sound.midi.Transmitter.Examples:
(remove-button-press-handler lpad)
Remove any event handlers. * the first argument should be a map containing an `in` key which returns a [javax.sound.midi.Transmitter](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/Transmitter.html). Examples: ``` (remove-button-press-handler lpad) ```
(send-midi {:keys [out]} & args)
Sends a javax.sound.midi.ShortMessage to the specified device.
out
key which returns a javax.sound.midi.Receiver.args
should be a three element sequence containing the status
, data1
and data2
components of the message respectively.Examples:
(send-midi lpad 0x90 11 43)
Sends a [javax.sound.midi.ShortMessage](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/ShortMessage.html) to the specified device. * the first argument should be a map containing an `out` key which returns a [javax.sound.midi.Receiver](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/Receiver.html). * `args` should be a three element sequence containing the `status`, `data1` and `data2` components of the message respectively. Examples: ``` (send-midi lpad 0x90 11 43) ```
(send-midi-sysex {:keys [out]} & args)
Sends a javax.sound.midi.SysexMessage to the specified device.
out
key which returns a javax.sound.midi.Receiver.args
should be an arbitary length sequence which will be wrapped by SYSEX_HEADER
and SYSEX_FOOTER
information and converted to a byte array.Examples:
(send-midi-sysex lpad 13 4 43)
Sends a [javax.sound.midi.SysexMessage](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/SysexMessage.html) to the specified device. * the first argument should be a map containing an `out` key which returns a [javax.sound.midi.Receiver](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/Receiver.html). * `args` should be an arbitary length sequence which will be wrapped by [[SYSEX_HEADER]] and [[SYSEX_FOOTER]] information and converted to a byte array. Examples: ``` (send-midi-sysex lpad 13 4 43) ```
(send-midi-sysex-scroll {:keys [out]} text & args)
Sends a javax.sound.midi.SysexMessage to the specified device to produce scrolling text.
out
key which returns a javax.sound.midi.Receiver.text
should be a sequence of integers representing the letters of the text to scroll (e.g., (map #(int (char %)) "Hello")
.args
should be an arbitary length sequence which will be wrapped by SYSEX_HEADER
, text and SYSEX_FOOTER
information and converted to a byte array.Examples:
(send-midi-sysex-scroll lpad (72 101 108 108 111) 20 45 0)
Sends a [javax.sound.midi.SysexMessage](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/SysexMessage.html) to the specified device to produce scrolling text. * the first argument should be a map containing an `out` key which returns a [javax.sound.midi.Receiver](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/Receiver.html). * `text` should be a sequence of integers representing the letters of the text to scroll (e.g., `(map #(int (char %)) "Hello")`. * `args` should be an arbitary length sequence which will be wrapped by [[SYSEX_HEADER]], text and [[SYSEX_FOOTER]] information and converted to a byte array. Examples: ``` (send-midi-sysex-scroll lpad (72 101 108 108 111) 20 45 0) ```
(set-button-press-handler {:keys [in]} handler-fn)
Specify a single handler that will receive all midi events from the input device.
in
key which returns a javax.sound.midi.Transmitter.Examples:
(set-button-press-handler
lpad
(fn [msg]
(light-cell
lpad
(:x msg)
(:y msg)
(- 127 (+ (:x msg) (:y msg))))))
Specify a single handler that will receive all midi events from the input device. * the first argument should be a map containing an `in` key which returns a [javax.sound.midi.Transmitter](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/Transmitter.html). * handler should be a function that accepts a single parameter - a decoded version of the event. Examples: ``` (set-button-press-handler lpad (fn [msg] (light-cell lpad (:x msg) (:y msg) (- 127 (+ (:x msg) (:y msg)))))) ```
The common set of footer bytes sent with each Sysex message
The common set of footer bytes sent with each Sysex message
The common set of header bytes sent with each Sysex message
The common set of header bytes sent with each Sysex message
The status byte for a light column Sysex message
The status byte for a light column Sysex message
The status byte for a light grid Sysex message
The status byte for a light grid Sysex message
The status byte for a light row Sysex message
The status byte for a light row Sysex message
The status byte for a RGB Sysex message
The status byte for a RGB Sysex message
The status byte for a scroll text Sysex message
The status byte for a scroll text Sysex message
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close