|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rngtng.launchpad.Launchpad
public class Launchpad
This is the Main class to control your Launchpad. Please the Docs and Examples for usage
import com.rngtng.launchpad.*; Launchpad launchpad; void setup() { size(400,400); launchpad = new Launchpad(this); } void draw() { background(0); for(int y = 0; y < launchpad.height; y++) { for(int x = 0; x < launchpad.width; x++) { launchpad.changeGrid(x, y, LColor.RED_HIGH); delay(100); } } }
Field Summary | |
---|---|
static int |
height
|
java.lang.String |
VERSION
|
static int |
width
|
Fields inherited from interface com.rngtng.launchpad.LMidiCodes |
---|
BUFFER0, BUFFER1, GRIDLAYOUT_DRUM_RACK, GRIDLAYOUT_XY, MODE_COPY, MODE_FLASHING, STATUS_CC, STATUS_MULTI, STATUS_NIL, STATUS_OFF, STATUS_ON, VELOCITY_TEST_LEDS |
Constructor Summary | |
---|---|
Launchpad(processing.core.PApplet _app)
|
|
Launchpad(processing.core.PApplet _app,
java.lang.String inputName,
java.lang.String outputName)
a Constructor, usually called in the setup() method in your sketch to initialize and start the library. |
Method Summary | |
---|---|
boolean |
addListener(LaunchpadListener listener)
Adds a listener who will be notified each time a new MIDI message is received from a MIDI input device. |
void |
bufferingMode(int display_buffer,
int update_buffer)
Controls the two buffers. |
void |
bufferingMode(int display_buffer,
int update_buffer,
int flags)
Controls the two buffers. |
void |
changeAll(int[] colors)
Changes all buttons in batch mode. |
void |
changeAll(LColor[] colors)
Changes all buttons in batch mode. |
void |
changeAll(processing.core.PImage image)
Changes all buttons in batch mode. |
void |
changeButton(int button,
int color)
Changes a single Control or Scene Button. |
void |
changeButton(int button,
LColor c)
Changes a single Control or Scene Button. |
void |
changeGrid(int x,
int y,
int color)
Changes a single Button on the Grid. |
void |
changeGrid(int x,
int y,
LColor c)
Changes a single Button on the Grid. |
void |
changeSceneButton(int button,
int color)
Changes a single Control or Scene Button. |
void |
changeSceneButton(int button,
LColor c)
Changes a single Control or Scene Button. |
boolean |
connected()
|
void |
dispose()
|
void |
flashingAuto()
Starts flashing LEDs marked as flashing automatically. |
void |
flashingOff()
Switches LEDs marked as flashing off when using custom timer for flashing. |
void |
flashingOn()
Switches LEDs marked as flashing on when using custom timer for flashing. |
void |
midiMessage(javax.sound.midi.MidiMessage message,
long timestamp)
Reads user actions (button presses/releases) that haven't been handled yet and invokes a button or grid event |
boolean |
removeListener(LaunchpadListener listener)
Removes a given listener. |
void |
reset()
Resets the launchpad - all settings are reset and all LEDs are switched off. |
void |
testLeds()
Lights all LEDs (for testing purposes). |
void |
testLeds(int brightness)
Lights all LEDs (for testing purposes). |
java.lang.String |
version()
return the version of the library. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int width
public static int height
public final java.lang.String VERSION
Constructor Detail |
---|
public Launchpad(processing.core.PApplet _app)
public Launchpad(processing.core.PApplet _app, java.lang.String inputName, java.lang.String outputName)
_app
- parent AppletinputName
- name of MIDI input DeviceoutputName
- name of MIDI output Device
import com.rngtng.launchpad.*; Launchpad launchpad; void setup() { size(400,400); launchpad = new Launchpad(this); } void draw() { background(0); for(int y = 0; y < launchpad.height; y++) { for(int x = 0; x < launchpad.width; x++) { launchpad.changeGrid(x, y, LColor.RED_HIGH); delay(100); } } }
Method Detail |
---|
public void dispose()
public java.lang.String version()
public boolean connected()
public boolean addListener(LaunchpadListener listener)
listener
- the listener to add.
removeListener(LaunchpadListener listener)
public boolean removeListener(LaunchpadListener listener)
listener
- the listener to remove.
addListener(LaunchpadListener listener)
public void reset()
public void testLeds()
public void testLeds(int brightness)
brightness
- brightness of both LEDs for all buttons
Errors raised:
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeButton(int button, int color)
button
- value of the button (number or code)color
- color value
Errors raised:
[Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeButton(int button, LColor c)
button
- value of the button (number or code)c
- LColor object
Errors raised:
[Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeSceneButton(int button, int color)
button
- value of the button (number or code)color
- color value
Errors raised:
[Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeSceneButton(int button, LColor c)
button
- value of the button (number or code)c
- LColor object
Errors raised:
[Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeGrid(int x, int y, int color)
x
- x coordinatey
- y coordinatecolor
- color value
Errors raised:
[Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeGrid(int x, int y, LColor c)
x
- x coordinatey
- y coordinatec
- LColor object
Errors raised:
[Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeAll(LColor[] colors)
colors
- an array of ColorsErrors raised:
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabled
public void changeAll(int[] colors)
colors
- an array of integers
Errors raised:
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void changeAll(processing.core.PImage image)
image
- an PImage object
Errors raised:
[Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void flashingOn()
public void flashingOff()
public void flashingAuto()
public void bufferingMode(int display_buffer, int update_buffer)
display_buffer
- which buffer to use for display, defaults to +0+update_buffer
- which buffer to use for updates when :mode is set to :buffering, defaults to +0+ (see change)
Errors raised:
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void bufferingMode(int display_buffer, int update_buffer, int flags)
display_buffer
- which buffer to use for display, defaults to +0+update_buffer
- which buffer to use for updates when :mode is set to :buffering, defaults to +0+ (see change)flags
- values to control FLASHING and COPY
Errors raised:
[Launchpad::NoOutputAllowedError] when output is not enabledpublic void midiMessage(javax.sound.midi.MidiMessage message, long timestamp)
midiMessage
in interface themidibus.StandardMidiListener
message
- the MIDI message
Errors raised:
[Launchpad::NoInputAllowedError] when input is not enabled
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |