Skip to content
Johnny edited this page Nov 27, 2015 · 4 revisions

connect

Use this function to connect with the Launchpad
Parameters:
None

Returns
boolean: If connection was successfull or not

How to use:
Interface lint = new Interface();
lint.connect( Interface.getConnectedLaunchpads()[0] ); //Connects with your Launchpad


disconnect

Use this function to disconnect with the Launchpad
Parameters:
None

Returns
Nothing

How to use:
lint.disconnect( Interface.getConnectedLaunchpads()[0] ); //Disconnects with your Launchpad


setLED

This function can be used to set the color of a specific LED.
Parameters:
x: The X coordinate of the LED
y: The Y coordinate of the LED
velo: The velocity index for the color (see programmers manual of your launchpad)

Returns
Nothing

How to use:
lint.setLED(5, 5, 127); //Sets the LED at position X=5;Y=5 to orange.


fillLEDs

With this function you can fill a rectangle by giving start and end coordinates.
Parameters:
startX: The X coordinate for the start
startY: The Y coordinate for the start
endX: The X coordinate for the end
endY: The Y coordinate for the end
velo: The velocity index for the color

Returns
Nothing

How to use:
lint.fillLEDs(2, 2, 5, 5, 50); //Creates a purple rectangle from 2;2 to 5;5


clearAllLEDs

Clears all LEDs.
Parameters:
None

Returns
Nothing

How to use:
lint.clearAllLEDs(); //Clears all LEDs (same as putting their velocity to zero.)


ledToMidiNote

Returns the note on the piano which is equilavent to the LED you input.
Parameters:
x: LEDs X coordinate
y: LEDs Y coordinate

Returns
Midi.Pitch: The Note

How to use:
Midi.Pitch myNote = lint.ledToMidiNote(5, 2); //Returns the equilavent note


midiNoteToLED

Returns the note on the piano which is equilavent to the LED you input.
Parameters:
p: The note to convert (Midi.Pitch type!)

Returns
integer array: The coordinates, Index 0 is X, Index 1 is Y coordinate.

How to use:
int[] myLED = lint.midiNoteToLed(Midi.Pitch.A5); //Returns the equilavent led coordinates for the tone A5

Clone this wiki locally