#include #include #include "Launchpad.h" using namespace std; using namespace midi; // Platform-dependent sleep routines. #if defined(__WINDOWS_MM__) #include #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) #else // Unix variants #include #define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) ) #endif Launchpad l; void keyPressed(unsigned char x, unsigned char y, void* data) { std::cout << "(" << (int)x << ", " << (int)y << ")" << std::endl; l.setColor(x, y, LaunchpadColor(3, 3)); } int main() { l.keyPressedCallback = keyPressed; l.setColorAll(LaunchpadColor(0, 1)); cout << "Press a button to stop... " << endl; cin.ignore(); return 0; }