| 
					
				 | 
			
			
				@@ -0,0 +1,36 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#include <iostream> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#include <cstdlib> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#include "RtMidi.h" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#include "MidiMessage.h" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#include "Launchpad.h" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// Platform-dependent sleep routines. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#if defined(__WINDOWS_MM__) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  #include <windows.h> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#else // Unix variants 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  #include <unistd.h> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  #define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#endif 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+Launchpad l; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+void keyPressed(unsigned char x, unsigned char y) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    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)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    while(true)  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |