Launchpad
Extends:
A Launchpad instance.
This class will emit two events:
press
- Emitted when a button is pressed. Example usage:
myLaunchpad.on("press", pressInfo => {
console.log(pressInfo.button, pressInfo.velocity)
})
release
- Emitted when a button is released. Example usage:
myLaunchpad.on("release", button => {
console.log(button)
})
Constructor Summary
Public Constructor | ||
public |
constructor(params: Object) Creates an instance of Launchpad. |
Method Summary
Public Methods | ||
public |
darkAll() Convenience method to darken all buttons on the Launchpad. |
|
public |
Get a button on this Launchpad |
|
public |
Convenience method to light up all the buttons on the Launchpad a certain color. |
|
public |
lightAllRgb(r: Number, g: Number, b: Number) Convenience method to light up all the buttons on the Launchpad a certain color with RGB values. |
|
public |
scrollText(text: String, color: Number, loop: Boolean, speed: Number) Scroll text across the Launchpad. |
|
public |
Convenience method to add the system-exclusive message header to a message and then send it to the Launchpad. |
|
public |
Set the Launchpad's layout. |
Public Constructors
Public Members
Public Methods
public darkAll() source
Convenience method to darken all buttons on the Launchpad.
Example:
myLaunchpad.darkAll()
public getButton(x: Number, y: Number): Button source
Get a button on this Launchpad
Example:
let button = myLaunchpad.getButton(1, 2)
// do whatever with the button
button.setRgbColor(10, 30, 10)
public lightAll(color: Number) source
Convenience method to light up all the buttons on the Launchpad a certain color.
Params:
Name | Type | Attribute | Description |
color | Number | Note representation of the color. |
Example:
myLaunchpad.lightAll(23)
public lightAllRgb(r: Number, g: Number, b: Number) source
Convenience method to light up all the buttons on the Launchpad a certain color with RGB values.
Example:
myLaunchpad.lightAllRgb(10, 30, 10)
public scrollText(text: String, color: Number, loop: Boolean, speed: Number) source
Scroll text across the Launchpad.
Example:
myLaunchpad.scrollText("Hello node!", 23, true, 5)
public sendSysEx(bytes: Number[]) source
Convenience method to add the system-exclusive message header to a message and then send it to the Launchpad.
Params:
Name | Type | Attribute | Description |
bytes | Number[] | The bytes of the SysEx message to send. Header is automatically included. |
Example:
myLaunchpad.sendSysEx([0, 1, 2, 3])