Setting the Colors on the Launchpad Pro’s Pads

Now that I have figured out how to re-program the firmware on the Launchpad Pro it is time to do something useful with it. There’s multiple parts to what I have in mind but today I experimented with coloring the pads.

There is a nice API for setting the color of a pad. From the app.h include file we find:

void hal_plot_led(u8 type, u8 index, u8 red, u8 green, u8 blue);

The first parameter, type, has two possible values: TYPEPAD and TYPESETUP. TYPEPAD is used to address the round and square pads on the Launchpad Pro. TYPESETUP is used for the recessed setup button in the upper left corner of the device. When using TYPESETUP, the second parameter (index) is ignored and the color of the vertical LED on the bottom edge of the device is altered.

The second parameter, index, is used to address the pads on the device. Check out the Novation documentation for a nice picture of the pad indexing but the summary is this: values 0 to 99 starting from the bottom left corner, moving left to right and moving up. So the “Record Arm” button is index 1, while the “User” button is index 98. Indexes 0, 9, 90 and 99 are not mapped to anything. One might think that index 90 would address the Setup button, but it does not.

The last three parameters are fairly obvious: the red, green and blue values required to render a color. Note that RGB values are often expressed as values 0-255. The Launchpad Pro uses 0-63. Therefore, if you use a site like to find colors you will need to divide the individual values by 4 for similar colors on the Launchpad Pro. RGB(0,0,0) normally corresponds with black. But for our Launchpad, it turns the pad off.

With the API well in hand I’m going to need to create visual differences between a button that’s active and a button that’s available but not active, and a button that’s off or unavailable. Certainly, RGB(0,0,0) will suffice for off/unavailable but how should we represent available but not active? Working with good strong colors like RGB(63,0,0) and RGB(32,0,32) I experimentally determined that dividing each value by 4 or 8 yields a clear enough difference between the full color (active) and reduced color (available) but still allows for a color that properly represents the full/active color. ¬†So, for a nice purple with active/full as RGB(32,0,32) we can use RGB(8,0,8) for the inactive/available situations.



One Response to “Setting the Colors on the Launchpad Pro’s Pads”

  1. Handling Pad Events on the Launchpad Pro | Coder For Christ Says:

    […] Just another coder trying to make his way through the universe… « Setting the Colors on the Launchpad Pro’s Pads […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: