In a previous post, I explained how to control preset changes on the mPK261 using SysEx commands. In this post, I explain how to get the MPK2 series to show some tricked pad colors.
The key to changing the color of a specific pad is to send a MIDI SysEx. The format is
F0 47 00 25 31 00 04 01 0x yy zz F7
where x and y form the address, in hexadecimal, of a specific pad in the MPK RAM memory and zz is the color number, from 0x00 to 0x0B. The x and y components of the address is a bit tricky because since you are sending a SysEx to a MIDI device, no byte can have a value greater than 0x7F, otherwise bit 1 is set and that breaks the SysEx stream. So the addresses for the pads are 0x0A7C and up: 7C, 7D, 7E, 7F and the next one is 0x0B00, and so on to oxoB0B.
For this to work, you need to write/modify some code. It’s doable with Processing and some DAW (but not Ableton!) might let you send SysEx on demand. You could also use an Arduino, like I did here.
The Arduino receives all MIDI message from the keyboard and will search for some commands, mainly Control Change or Note On. Receiving the proper command (in these examples by pressing a specific button) will launch code that will send a series of MIDI SysEx messages to the keyboard, forcing specific pads to show a certain color or just turn off.
Here’s a bit of (Arduino) code that has two loops; one to address the first four pads, then the next 12 and send the color 0x00, or black:
[language=”++”]
void loadDarkPads() { byte a; // first row of pads is 0X0A7C to 0X0A7F MPK2PadsSysEx [8] = 0x0A; //pad address is 2 bytes. First one is 0x0A or 0x0B for ( a = 0x7C ; a <= 0X7F ; a++) { //second byte varies depending on first byte MPK2PadsSysEx [9] = a; //Which pad MPK2PadsSysEx [10] = 0; //What color (here Dark) midiA.sendSysEx( MPK2PadsSysExLength, MPK2PadsSysEx, true); } // second to fourth row of pad is 0X0B00 to 0X0B0B MPK2PadsSysEx [8] = 0x0B; for ( a = 0x00 ; a <= 0x0B ; a++) { MPK2PadsSysEx [9] = a; MPK2PadsSysEx [10] = 0; midiA.sendSysEx( MPK2PadsSysExLength, MPK2PadsSysEx, true); } }
[/++]
This is the complete code for the Arduino.
Leave a Reply