├── .classpath ├── .gitignore ├── .project ├── .settings └── org.eclipse.jdt.core.prefs ├── README.md ├── data └── .keepme ├── examples ├── ColorPicker │ └── ColorPicker.pde ├── Colors │ └── Colors.pde ├── Doodle │ └── Doodle.pde ├── DoubleBuffering │ └── DoubleBuffering.pde ├── DrawingBoard │ └── DrawingBoard.pde ├── Feedback │ └── Feedback.pde ├── Launchpad │ └── Launchpad.pde ├── LaunchpadAll │ └── LaunchpadAll.pde ├── LaunchpadInput │ └── LaunchpadInput.pde ├── monomic_blink_game │ └── monomic_blink_game.pde ├── monomic_bounce │ └── monomic_bounce.pde ├── monomic_crosshairs │ └── monomic_crosshairs.pde ├── monomic_kaleidoscope │ └── monomic_kaleidoscope.pde ├── monomic_lights │ └── monomic_lights.pde ├── monomic_pulse │ └── monomic_pulse.pde ├── monomic_sketchpad │ └── monomic_sketchpad.pde └── monomic_sketchpad_state │ └── monomic_sketchpad_state.pde ├── lib └── README.md ├── resources ├── build.properties ├── build.xml ├── code │ ├── ExampleTaglet.class │ ├── ExampleTaglet.java │ ├── ant-contrib-1.0b3.jar │ └── doc.sh ├── install_instructions.txt └── stylesheet.css ├── src └── com │ └── rngtng │ └── launchpad │ ├── LButton.java │ ├── LColor.java │ ├── LMidiCodes.java │ ├── LaunchadPAppletListener.java │ ├── Launchpad.java │ ├── LaunchpadListener.java │ └── MonomeLaunchpad.java ├── update-webpage.sh └── web ├── index.html └── stylesheet.css /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | distribution 2 | bin 3 | .DS_Store 4 | reference 5 | lib/monomic 6 | lib/themidibus 7 | *.class 8 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Launchpad 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu Nov 26 15:55:35 CET 2009 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.6 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.6 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Launchpad - Processing Library to control Novation Launchpad 2 | 3 | This library provides an interface to access [novation's launchpad](http://www.novationmusic.com/products/launchpad) programmatically. 4 | It's based on Thomas Jachmanns [ruby launchpad gem](http://github.com/thomasjachmann/launchpad). LEDs can be lighted and button presses can be listened to. In addition, it includes a wrapper for the [Monomic Library](http://jkriss.github.com/monomic) as well. 5 | 6 | 7 | ## Requirements 8 | 9 | * Severin Smiths [themidibus library](http://smallbutdigital.com/themidibus.php) 10 | * On Mac OS X < Java Update 6 you need Humatics [mmj library](http://www.humatic.de/htools/mmj.htm) as well. Yes, go and spend those 3.5 - it's worth it! 11 | * obviously a Novation Launchpad ;-) 12 | 13 | ## Installation 14 | 15 | Download, unzip and put the extracted launchpad folder into the libraries folder of your processing sketches. Reference and examples are included in the launchpad folder. 16 | If needed (only Mac OS X with java Update < 6), install *mmj* library as described in their documentation. 17 | 18 | 19 | ## Usage 20 | 21 | Basically, create an instance of the Launchpad class and your're ready to go. This is a simple example that switches on all LEDs (for testing), resets the launchpad again and then lights the grid button at position 4/4 (from top left). 22 | 23 | import themidibus.*; 24 | import com.rngtng.launchpad.*; 25 | 26 | Launchpad device; 27 | 28 | void setup() { 29 | device = new Launchpad(this); 30 | noLoop(); 31 | } 32 | 33 | void draw() { 34 | device.testLeds(); 35 | delay(1000); 36 | device.reset(); 37 | delay(1000); 38 | device.changeGrid( 4, 4, LColor.RED_HIGH + LColor.GREEN_LOW); 39 | } 40 | 41 | For Interaction, make sure to include Pressed/Released Listener for grid, the button on the top and scene buttons on the right. This is an interaction example lighting all grid buttons in red when pressed and keeping them lit. 42 | 43 | import themidibus.*; 44 | import com.rngtng.launchpad.*; 45 | 46 | Launchpad device; 47 | 48 | void setup() { 49 | device = new Launchpad(this); 50 | noLoop(); 51 | } 52 | 53 | void draw() { 54 | } 55 | 56 | void launchpadGridPressed(int x, int y) { 57 | device.changeGrid( x, y, LColor.RED_HIGH); 58 | } 59 | 60 | void launchpadButtonPressed(int buttonCode) { 61 | if(buttonCode == LButton.MIXER) exit(); 62 | } 63 | 64 | 65 | For more details, see the examples. Most examples are ported from the ruby and monomic library 66 | 67 | ## Near future plans 68 | 69 | * add proper Exception/Warning handling 70 | * use entities instead of Consts?? 71 | * add test (how to do this with processing??) 72 | 73 | 74 | ## Contributors 75 | 76 | * [AspeteRakete](https://github.com/aspeteRakete): [Pullrequest #1](https://github.com/rngtng/launchpad/pull/1) 77 | 78 | Big Thank you! 79 | 80 | ## Changelog 81 | 82 | ### v0.3 83 | 84 | * Merged [Pullrequest #1](https://github.com/rngtng/launchpad/pull/1), to bee up to date with external libs 85 | * Included external libs 86 | * Updated build file & Website 87 | 88 | ### v0.2.2 89 | 90 | * bugfixes 91 | * added connected() method 92 | 93 | 94 | ### v0.2.0 95 | 96 | * interaction fully working, accepts PApplet or custom Listeners 97 | * first stable version, API is nearly fixed now 98 | * nice color handling using the LColor class 99 | * monomic wrapper class 100 | * lots of new examples 101 | * proper buffer & flashing support 102 | 103 | ### v0.1.0 104 | 105 | * first version, supporting output only 106 | 107 | 108 | 109 | 110 | ## Copyright 111 | The MIT License 112 | 113 | Copyright © 2011 RngTng, Tobias Bielohlawek 114 | 115 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 116 | 117 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 118 | 119 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /data/.keepme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtng/launchpad/370fc73cb886501b1facc16e75e44804647d6dc5/data/.keepme -------------------------------------------------------------------------------- /examples/ColorPicker/ColorPicker.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | Launchpad launchpad; 6 | 7 | LColor current_color; 8 | 9 | void setup() { 10 | launchpad = new Launchpad(this); 11 | launchpad.flashingAuto(); 12 | current_color = new LColor(LColor.YELLOW_HIGH); 13 | } 14 | 15 | void draw() { 16 | background(0); 17 | delay(1000); 18 | } 19 | 20 | void update_scene_buttons(Launchpad d, LColor kolor) { 21 | d.changeSceneButton( LButton.SCENE1, (kolor.isRed(LColor.RED_HIGH )) ? LColor.YELLOW_HIGH : LColor.RED_HIGH ); 22 | d.changeSceneButton( LButton.SCENE2, (kolor.isRed(LColor.RED_MEDIUM )) ? LColor.YELLOW_HIGH : LColor.RED_MEDIUM ); 23 | d.changeSceneButton( LButton.SCENE3, (kolor.isRed(LColor.RED_LOW )) ? LColor.YELLOW_HIGH : LColor.RED_LOW ); 24 | d.changeSceneButton( LButton.SCENE4, (kolor.isRed(LColor.RED_OFF )) ? LColor.YELLOW_HIGH : LColor.RED_OFF ); 25 | d.changeSceneButton( LButton.SCENE5, (kolor.isGreen(LColor.GREEN_HIGH )) ? LColor.YELLOW_HIGH : LColor.GREEN_HIGH ) ; 26 | d.changeSceneButton( LButton.SCENE6, (kolor.isGreen(LColor.GREEN_MEDIUM )) ? LColor.YELLOW_HIGH : LColor.GREEN_MEDIUM ); 27 | d.changeSceneButton( LButton.SCENE7, (kolor.isGreen(LColor.GREEN_LOW )) ? LColor.YELLOW_HIGH : LColor.GREEN_LOW ); 28 | d.changeSceneButton( LButton.SCENE8, (kolor.isGreen(LColor.GREEN_OFF )) ? LColor.YELLOW_HIGH : LColor.GREEN_OFF ); 29 | for( int red = 0; red < 8; red++) { 30 | for( int green = 0; green < 8; green++) { 31 | d.changeGrid( red, green, kolor); 32 | } 33 | } 34 | } 35 | 36 | public void launchpadSceneButtonPressed(int buttonCode) { 37 | int number = LButton.sceneButtonNumber(buttonCode); 38 | println(number); 39 | if( number < 5 ) { 40 | current_color.setRed( 4 - number); 41 | } 42 | else { 43 | current_color.setGreen(8 - number); 44 | } 45 | } 46 | 47 | public void launchpadSceneButtonReleased(int buttonCode) { 48 | update_scene_buttons(launchpad, current_color); 49 | } 50 | 51 | public void launchpadButtonPressed(int buttonCode) { 52 | switch(buttonCode) { 53 | case LButton.UP: 54 | for( int red = 0; red < 4; red++) { 55 | for( int green = 0; green < 4; green++) { 56 | launchpad.changeGrid( red, green, new LColor(red, green)); 57 | } 58 | } 59 | break; 60 | case LButton.DOWN: 61 | for( int red = 0; red < 4; red++) { 62 | for( int green = 0; green < 4; green++) { 63 | launchpad.changeGrid( red*2, green*2, new LColor(red, green)); 64 | launchpad.changeGrid( red*2+1, green*2+1, new LColor(red, green)); 65 | } 66 | } 67 | break; 68 | case LButton.LEFT: 69 | int pos_x = 0; 70 | int pos_y = 0; 71 | for( int red = 0; red < 4; red++) { 72 | for( int green = 0; green < 4; green++) { 73 | launchpad.changeGrid( pos_x, pos_y, new LColor(red, green)); 74 | launchpad.changeGrid( 7 - pos_x, pos_y, new LColor(red, green)); 75 | launchpad.changeGrid( pos_x, 7 - pos_y, new LColor(red, green)); 76 | launchpad.changeGrid( 7 - pos_x, 7 - pos_y, new LColor(red, green)); 77 | pos_y += 1; 78 | } 79 | pos_x += 1; 80 | pos_y = 0; 81 | } 82 | break; 83 | case LButton.RIGHT: 84 | update_scene_buttons(launchpad, current_color); 85 | break; 86 | } 87 | } 88 | 89 | public void launchpadButtonReleased(int buttonCode) { 90 | switch(buttonCode) { 91 | case LButton.MIXER: 92 | exit(); 93 | } 94 | } 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /examples/Colors/Colors.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | Launchpad launchpad; 6 | 7 | void setup() { 8 | launchpad = new Launchpad(this); 9 | 10 | int pos_x = 0; 11 | int pos_y = 0; 12 | 13 | for( int red = 0; red < 4; red++) { 14 | for( int green = 0; green < 4; green++) { 15 | launchpad.changeGrid( pos_x, pos_y, new LColor(red, green)); 16 | launchpad.changeGrid( 7 - pos_x, pos_y, new LColor(red, green)); 17 | launchpad.changeGrid( pos_x, 7 - pos_y, new LColor(red, green)); 18 | launchpad.changeGrid( 7 - pos_x, 7 - pos_y, new LColor(red, green)); 19 | pos_y += 1; 20 | } 21 | pos_x += 1; 22 | pos_y = 0; 23 | } 24 | } 25 | 26 | void draw() { 27 | background(0); 28 | } 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/Doodle/Doodle.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | Launchpad launchpad; 6 | 7 | LColor current_color; 8 | 9 | void setup() { 10 | launchpad = new Launchpad(this); 11 | launchpad.flashingAuto(); 12 | current_color = new LColor(LColor.YELLOW_HIGH); 13 | update_scene_buttons(launchpad, current_color); 14 | } 15 | 16 | void draw() { 17 | background(0); 18 | delay(1000); 19 | } 20 | 21 | void update_scene_buttons(Launchpad d, LColor kolor) { 22 | d.changeSceneButton( LButton.SCENE1, (kolor.isRed(LColor.RED_HIGH )) ? LColor.YELLOW_HIGH : LColor.RED_HIGH ); 23 | d.changeSceneButton( LButton.SCENE2, (kolor.isRed(LColor.RED_MEDIUM )) ? LColor.YELLOW_HIGH : LColor.RED_MEDIUM ); 24 | d.changeSceneButton( LButton.SCENE3, (kolor.isRed(LColor.RED_LOW )) ? LColor.YELLOW_HIGH : LColor.RED_LOW ); 25 | d.changeSceneButton( LButton.SCENE4, (kolor.isRed(LColor.RED_OFF )) ? LColor.YELLOW_HIGH : LColor.RED_OFF ); 26 | d.changeSceneButton( LButton.SCENE5, (kolor.isGreen(LColor.GREEN_HIGH )) ? LColor.YELLOW_HIGH : LColor.GREEN_HIGH ) ; 27 | d.changeSceneButton( LButton.SCENE6, (kolor.isGreen(LColor.GREEN_MEDIUM )) ? LColor.YELLOW_HIGH : LColor.GREEN_MEDIUM ); 28 | d.changeSceneButton( LButton.SCENE7, (kolor.isGreen(LColor.GREEN_LOW )) ? LColor.YELLOW_HIGH : LColor.GREEN_LOW ); 29 | d.changeSceneButton( LButton.SCENE8, (kolor.isGreen(LColor.GREEN_OFF )) ? LColor.YELLOW_HIGH : LColor.GREEN_OFF ); 30 | d.changeButton( LButton.USER1, ((kolor.isMode( LColor.FLASHING )) ? LColor.GREEN_HIGH : LColor.GREEN_LOW) + LColor.FLASHING ); 31 | d.changeButton( LButton.USER2, (kolor.isMode( LColor.NORMAL )) ? LColor.GREEN_HIGH : LColor.GREEN_LOW ); 32 | } 33 | 34 | public void launchpadSceneButtonPressed(int buttonCode) { 35 | int number = LButton.sceneButtonNumber(buttonCode); 36 | println(number); 37 | if( number < 5 ) { 38 | current_color.setRed( 4 - number); 39 | } 40 | else { 41 | current_color.setGreen(8 - number); 42 | } 43 | } 44 | 45 | public void launchpadSceneButtonReleased(int buttonCode) { 46 | update_scene_buttons(launchpad, current_color); 47 | } 48 | 49 | public void launchpadButtonPressed(int buttonCode) { 50 | switch(buttonCode) { 51 | case LButton.USER1: 52 | current_color.setMode( LColor.FLASHING ); 53 | break; 54 | case LButton.USER2: 55 | current_color.setMode( LColor.NORMAL ); 56 | break; 57 | case LButton.MIXER: 58 | launchpad.changeButton(LButton.MIXER, LColor.RED_HIGH); 59 | break; 60 | } 61 | } 62 | 63 | public void launchpadButtonReleased(int buttonCode) { 64 | switch(buttonCode) { 65 | case LButton.MIXER: 66 | exit(); 67 | } 68 | update_scene_buttons(launchpad, current_color); 69 | } 70 | 71 | public void launchpadGridPressed(int x, int y) { 72 | launchpad.changeGrid(x, y, current_color); 73 | } 74 | 75 | 76 | -------------------------------------------------------------------------------- /examples/DoubleBuffering/DoubleBuffering.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | Launchpad launchpad; 6 | 7 | LColor current_color; 8 | 9 | int mode; 10 | 11 | int FLASHING = 0; 12 | int BUFFER0 = 1; 13 | int BUFFER1 = 2; 14 | 15 | void setup() { 16 | launchpad = new Launchpad(this); 17 | launchpad.reset(); 18 | launchpad.flashingAuto(); 19 | mode = FLASHING; 20 | current_color = new LColor(LColor.YELLOW_HIGH); 21 | 22 | update_scene_buttons(launchpad, current_color); 23 | } 24 | 25 | void draw() { 26 | background(0); 27 | delay(1000); 28 | } 29 | 30 | void update_scene_buttons(Launchpad d, LColor kolor) { 31 | d.changeSceneButton( LButton.SCENE1, (kolor.isRed(LColor.RED_HIGH )) ? LColor.YELLOW_HIGH : LColor.RED_HIGH ); 32 | d.changeSceneButton( LButton.SCENE2, (kolor.isRed(LColor.RED_MEDIUM )) ? LColor.YELLOW_HIGH : LColor.RED_MEDIUM ); 33 | d.changeSceneButton( LButton.SCENE3, (kolor.isRed(LColor.RED_LOW )) ? LColor.YELLOW_HIGH : LColor.RED_LOW ); 34 | d.changeSceneButton( LButton.SCENE4, (kolor.isRed(LColor.RED_OFF )) ? LColor.YELLOW_HIGH : LColor.RED_OFF ); 35 | d.changeSceneButton( LButton.SCENE5, (kolor.isGreen(LColor.GREEN_HIGH )) ? LColor.YELLOW_HIGH : LColor.GREEN_HIGH ) ; 36 | d.changeSceneButton( LButton.SCENE6, (kolor.isGreen(LColor.GREEN_MEDIUM )) ? LColor.YELLOW_HIGH : LColor.GREEN_MEDIUM ); 37 | d.changeSceneButton( LButton.SCENE7, (kolor.isGreen(LColor.GREEN_LOW )) ? LColor.YELLOW_HIGH : LColor.GREEN_LOW ); 38 | d.changeSceneButton( LButton.SCENE8, (kolor.isGreen(LColor.GREEN_OFF )) ? LColor.YELLOW_HIGH : LColor.GREEN_OFF ); 39 | d.changeButton( LButton.SESSION, (mode == FLASHING) ? LColor.YELLOW_HIGH : LColor.YELLOW_LOW ); 40 | d.changeButton( LButton.USER1, (mode == BUFFER0) ? LColor.YELLOW_HIGH : LColor.YELLOW_LOW); 41 | d.changeButton( LButton.USER2, (mode == BUFFER1) ? LColor.YELLOW_HIGH : LColor.YELLOW_LOW ); 42 | } 43 | 44 | public void launchpadSceneButtonPressed(int buttonCode) { 45 | int number = LButton.sceneButtonNumber(buttonCode); 46 | println(number); 47 | if( number < 5 ) { 48 | current_color.setRed( 4 - number); 49 | } 50 | else { 51 | current_color.setGreen(8 - number); 52 | } 53 | } 54 | 55 | public void launchpadSceneButtonReleased(int buttonCode) { 56 | update_scene_buttons(launchpad, current_color); 57 | } 58 | 59 | public void launchpadButtonPressed(int buttonCode) { 60 | switch(buttonCode) { 61 | case LButton.SESSION: 62 | mode = FLASHING; 63 | launchpad.flashingAuto(); 64 | break; 65 | case LButton.USER1: 66 | mode = BUFFER0; 67 | launchpad.bufferingMode(Launchpad.BUFFER0, Launchpad.BUFFER0); 68 | break; 69 | case LButton.USER2: 70 | mode = BUFFER1; 71 | launchpad.bufferingMode(Launchpad.BUFFER1, Launchpad.BUFFER1); 72 | break; 73 | case LButton.MIXER: 74 | launchpad.changeButton(LButton.MIXER, LColor.RED_HIGH); 75 | break; 76 | } 77 | } 78 | 79 | public void launchpadButtonReleased(int buttonCode) { 80 | switch(buttonCode) { 81 | case LButton.MIXER: 82 | exit(); 83 | } 84 | update_scene_buttons(launchpad, current_color); 85 | } 86 | 87 | public void launchpadGridPressed(int x, int y) { 88 | switch(y) { 89 | case 0: 90 | launchpad.changeGrid(x, y, current_color); 91 | break; 92 | case 1: 93 | launchpad.bufferingMode(Launchpad.BUFFER1, Launchpad.BUFFER0); 94 | launchpad.changeGrid(x, y, current_color.getRed() + current_color.getGreen() + LColor.FLASHING ); 95 | launchpad.flashingAuto(); 96 | break; 97 | default: 98 | launchpad.changeGrid(x, y, current_color.getRed() + current_color.getGreen() + LColor.BUFFERED ); 99 | break; 100 | } 101 | } 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /examples/DrawingBoard/DrawingBoard.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | Launchpad launchpad; 6 | 7 | LColor current_color; 8 | 9 | boolean[] flags = new boolean[64]; 10 | 11 | void setup() { 12 | launchpad = new Launchpad(this); 13 | } 14 | 15 | void draw() { 16 | background(0); 17 | delay(1000); 18 | } 19 | 20 | public void launchpadButtonPressed(int buttonCode) { 21 | switch(buttonCode) { 22 | case LButton.MIXER: 23 | launchpad.changeButton(LButton.MIXER, LColor.RED_HIGH); 24 | break; 25 | } 26 | } 27 | 28 | public void launchpadButtonReleased(int buttonCode) { 29 | switch(buttonCode) { 30 | case LButton.MIXER: 31 | exit(); 32 | } 33 | } 34 | 35 | public void launchpadGridPressed(int x, int y) { 36 | int coord = y*8 + x; 37 | flags[coord] = !flags[coord]; 38 | launchpad.changeGrid(x, y, (flags[coord]) ? LColor.YELLOW_HIGH : LColor.YELLOW_OFF); 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /examples/Feedback/Feedback.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | Launchpad launchpad; 6 | 7 | void setup() { 8 | launchpad = new Launchpad(this); 9 | } 10 | 11 | void draw() { 12 | background(0); 13 | } 14 | 15 | public void launchpadGridPressed(int x, int y) { 16 | println("GridButton pressed at: " + x + ", " + y); 17 | launchpad.changeGrid(x, y, LColor.YELLOW_HIGH); 18 | } 19 | 20 | public void launchpadGridReleased(int x, int y) { 21 | println("GridButton released at: " + x + ", " + y); 22 | launchpad.changeGrid(x, y, LColor.OFF); 23 | } 24 | 25 | public void launchpadButtonPressed(int buttonCode) { 26 | println("Button pressed: " + buttonCode); 27 | launchpad.changeButton(buttonCode, LColor.RED_HIGH); 28 | } 29 | 30 | public void launchpadButtonReleased(int buttonCode) { 31 | println("Button pressed: " + buttonCode); 32 | launchpad.changeButton(buttonCode, LColor.OFF); 33 | if(buttonCode == LButton.MIXER) exit(); 34 | } 35 | 36 | public void launchpadSceneButtonPressed(int buttonCode) { 37 | println("Button pressed: " + buttonCode); 38 | launchpad.changeSceneButton(buttonCode, LColor.GREEN_HIGH); 39 | } 40 | 41 | public void launchpadSceneButtonReleased(int buttonCode) { 42 | println("Button pressed: " + buttonCode); 43 | launchpad.changeSceneButton(buttonCode, LColor.OFF); 44 | } 45 | -------------------------------------------------------------------------------- /examples/Launchpad/Launchpad.pde: -------------------------------------------------------------------------------- 1 | import com.rngtng.launchpad.*; 2 | 3 | Launchpad launchpad; 4 | 5 | void setup() { 6 | size(400,400); 7 | launchpad = new Launchpad(this); 8 | } 9 | 10 | void draw() { 11 | background(0); 12 | for(int y = 0; y < launchpad.height; y++) { 13 | for(int x = 0; x < launchpad.width; x++) { 14 | launchpad.changeGrid(x, y, LColor.RED_HIGH); 15 | delay(100); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/LaunchpadAll/LaunchpadAll.pde: -------------------------------------------------------------------------------- 1 | import com.rngtng.launchpad.*; 2 | 3 | Launchpad launchpad; 4 | byte[] data = new byte[64]; 5 | 6 | void setup() { 7 | launchpad = new Launchpad(this); 8 | launchpad.reset(); 9 | for(int y = 0; y < 64; y++) { 10 | data[y] = 16; 11 | } 12 | } 13 | 14 | 15 | 16 | void draw() { 17 | background(0); 18 | for(int y = 0; y < launchpad.height; y++) { 19 | for(int x = 0; x < launchpad.width; x++) { 20 | byte pos = byte(y*launchpad.width + x); 21 | if(pos > 0) data[pos-1] = 0; 22 | data[pos] = 3; 23 | launchpad.changeAll(data); 24 | delay(100); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/LaunchpadInput/LaunchpadInput.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | Launchpad launchpad; 6 | byte[] data = new byte[64]; 7 | 8 | void setup() { 9 | launchpad = new Launchpad(this); 10 | launchpad.flashingAuto(); 11 | } 12 | 13 | void draw() { 14 | background(0); 15 | } 16 | 17 | public void launchpadGridPressed(int x, int y) { 18 | println("GridButton pressed at: " + x + ", " + y); 19 | launchpad.changeGrid(x, y, LColor.RED_HIGH); 20 | } 21 | 22 | public void launchpadGridReleased(int x, int y) { 23 | println("GridButton released at: " + x + ", " + y); 24 | launchpad.changeGrid(x, y, LColor.YELLOW_HIGH); 25 | } 26 | 27 | public void launchpadButtonPressed(int buttonCode) { 28 | println("Button pressed: " + buttonCode); 29 | launchpad.changeButton(buttonCode, LColor.GREEN_HIGH); 30 | } 31 | 32 | public void launchpadButtonReleased(int buttonCode) { 33 | println("Button pressed: " + buttonCode); 34 | launchpad.changeButton(buttonCode, LColor.RED_HIGH + LColor.FLASHING); 35 | } 36 | 37 | 38 | public void launchpadSceneButtonPressed(int buttonCode) { 39 | println("Scene Button pressed: " + buttonCode); 40 | launchpad.changeSceneButton(buttonCode, LColor.RED_HIGH); 41 | } 42 | 43 | public void launchpadSceneButtonReleased(int buttonCode) { 44 | println("Scene Button pressed: " + buttonCode); 45 | launchpad.changeSceneButton(buttonCode, LColor.GREEN_HIGH + LColor.FLASHING); 46 | } 47 | -------------------------------------------------------------------------------- /examples/monomic_blink_game/monomic_blink_game.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | import jklabs.monomic.*; 6 | 7 | Monome m; 8 | 9 | byte all = (byte)0xff; 10 | byte[] matrix = {0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f}; 11 | 12 | void setup() { 13 | m = new MonomeLaunchpad(this); 14 | frameRate(2); 15 | m.setValues(matrix); 16 | } 17 | 18 | void draw() { 19 | m.invert(); 20 | } 21 | 22 | void monomePressed(int x, int y) { 23 | m.invertCol(x); 24 | } 25 | -------------------------------------------------------------------------------- /examples/monomic_bounce/monomic_bounce.pde: -------------------------------------------------------------------------------- 1 | import processing.serial.*; 2 | 3 | import themidibus.*; 4 | 5 | import com.rngtng.launchpad.*; 6 | 7 | import jklabs.monomic.*; 8 | 9 | 10 | // Bounce 11 | // by REAS 12 | 13 | // altered by jesse kriss for monome output 14 | 15 | // When the shape hits the edge of the window, it reverses its direction 16 | 17 | // Updated 1 September 2002 18 | 19 | int size = 1; // Width of the shape 20 | float xpos, ypos; // Starting position of shape 21 | 22 | float xspeed = 0.3; // Speed of the shape 23 | float yspeed = 0.2; // Speed of the shape 24 | 25 | int xdirection = 1; // Left or Right 26 | int ydirection = 1; // Top to Bottom 27 | 28 | Monome m; 29 | int mWidth = 8; 30 | int mHeight = mWidth; 31 | 32 | void setup() 33 | { 34 | size(200, 200); 35 | noStroke(); 36 | smooth(); 37 | frameRate(60); 38 | // Set the starting position of the shape 39 | xpos = mWidth/2; 40 | ypos = mHeight/2; 41 | m = new MonomeLaunchpad(this); 42 | //m.setDebug(true); 43 | } 44 | 45 | void draw() 46 | { 47 | // Update the position of the shape 48 | xpos = xpos + ( xspeed * xdirection ); 49 | ypos = ypos + ( yspeed * ydirection ); 50 | 51 | // Test to see if the shape exceeds the boundaries of the screen 52 | // If it does, reverse its direction by multiplying by -1 53 | if (xpos > mWidth-size || xpos < 0) { 54 | xdirection *= -1; 55 | } 56 | if (ypos > mHeight-size || ypos < 0) { 57 | ydirection *= -1; 58 | } 59 | 60 | // Draw the shape 61 | //ellipse(xpos+size/2, ypos+size/2, size, size); 62 | m.lightsOff(); 63 | m.lightOn((int)xpos, (int)ypos); 64 | } 65 | 66 | void monomePressed(int x, int y) { 67 | xpos = x; 68 | ypos = y; 69 | } 70 | -------------------------------------------------------------------------------- /examples/monomic_crosshairs/monomic_crosshairs.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | import jklabs.monomic.*; 6 | 7 | 8 | Monome m; 9 | 10 | byte on = (byte)0xff; 11 | byte off = 0; 12 | 13 | void setup() { 14 | m = new MonomeLaunchpad(this); 15 | } 16 | 17 | void draw() { 18 | 19 | } 20 | 21 | void monomePressed(int x, int y) { 22 | m.setCol(x, on); 23 | m.setRow(y, on); 24 | } 25 | 26 | void monomeReleased(int x, int y) { 27 | m.setCol(x, off); 28 | m.setRow(y, off); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /examples/monomic_kaleidoscope/monomic_kaleidoscope.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | import jklabs.monomic.*; 6 | 7 | Monome m; 8 | 9 | void setup() { 10 | m = new MonomeLaunchpad(this); 11 | } 12 | 13 | void monomePressed(int x, int y) { 14 | m.setValue(x, y, !m.isLit(x,y)); 15 | m.setValue(7-x, y, !m.isLit(7-x,y)); 16 | m.setValue(x, 7-y, !m.isLit(x,7-y)); 17 | m.setValue(7-x, 7-y, !m.isLit(7-x,7-y)); 18 | } 19 | 20 | void draw() { 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /examples/monomic_lights/monomic_lights.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | import jklabs.monomic.*; 6 | 7 | Monome m; 8 | 9 | m = new MonomeLaunchpad(this); 10 | 11 | m.setDebug(true); 12 | 13 | m.lightsOn(); 14 | m.lightsOff(); 15 | 16 | m.lightOn(0,0); 17 | m.lightOff(0,0); 18 | 19 | m.setValue(0,0,1); 20 | m.setValue(0,0,0); 21 | 22 | int[] vals = new int[]{0,0,1,1,0,0,1,1}; 23 | 24 | byte bitVals = 0x33; 25 | 26 | m.setRow(1,vals); 27 | m.setCol(2,bitVals); 28 | 29 | int[][] matrix = new int[][]{ 30 | {0,1,0,1,0,1,0,1}, 31 | {1,0,1,0,1,0,1,0}, 32 | {0,1,0,1,0,1,0,1}, 33 | {1,0,1,0,1,0,1,0}, 34 | {0,1,0,1,0,1,0,1}, 35 | {1,0,1,0,1,0,1,0}, 36 | {0,1,0,1,0,1,0,1}, 37 | {1,0,1,0,1,0,1,0}, 38 | }; 39 | 40 | m.setValues(matrix); 41 | 42 | byte[] bitMatrix = new byte[]{0x0f, 0x0f, 0x0f, 0x0f,0x0f, 0x0f, 0x0f, 0x0f}; 43 | 44 | m.setValues(bitMatrix); 45 | -------------------------------------------------------------------------------- /examples/monomic_pulse/monomic_pulse.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | import jklabs.monomic.*; 6 | 7 | Monome m; 8 | float b = 0; 9 | float delta = 0.2; 10 | 11 | void setup() { 12 | m = new MonomeLaunchpad(this); 13 | m.setLedIntensity(b); 14 | m.lightsOn(); 15 | } 16 | 17 | void draw() { 18 | m.setLedIntensity(b); 19 | if (b < 0 || b > 9) delta = -delta; 20 | b+=delta; 21 | } 22 | 23 | void monomePressed(int x, int y) { 24 | delta = (y+1)/30f; 25 | } 26 | 27 | void dispose() { 28 | stop(); 29 | } 30 | 31 | protected void finalize() { 32 | stop(); 33 | } 34 | 35 | void stop() { 36 | println("stopping"); 37 | m.setLedIntensity(1); 38 | m.lightsOff(); 39 | } 40 | -------------------------------------------------------------------------------- /examples/monomic_sketchpad/monomic_sketchpad.pde: -------------------------------------------------------------------------------- 1 | import themidibus.*; 2 | 3 | import com.rngtng.launchpad.*; 4 | 5 | import jklabs.monomic.*; 6 | 7 | Monome m; 8 | 9 | void setup() { 10 | m = new MonomeLaunchpad(this); 11 | } 12 | 13 | void monomePressed(int x, int y) { 14 | m.setValue(x, y, !m.isLit(x,y)); 15 | } 16 | 17 | void draw() { 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /examples/monomic_sketchpad_state/monomic_sketchpad_state.pde: -------------------------------------------------------------------------------- 1 | import processing.serial.*; 2 | import jklabs.monomic.*; 3 | 4 | Monome m; 5 | 6 | void setup() { 7 | m = new MonomeSerial(this); 8 | } 9 | 10 | void monomePressed(int x, int y) { 11 | m.setValue(x, y, !m.isLit(x,y)); 12 | 13 | byte[] buttons = m.getButtonValues(); 14 | for (int i=0; i 2 | 3 | 12 | 13 | 14 | 15 | 16 | ${ant.description} 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ${line} 60 | building a processing library, ${project.name} ${project.version} 61 | ${line} 62 | src path ${project.src} 63 | bin path ${project.bin} 64 | classpath.local ${classpath.local.location} 65 | sketchbook ${sketchbook.location} 66 | java version ${java.target.version} 67 | ${line} 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 192 | 193 | 197 | 198 | 202 | 203 | 207 | 208 | 212 | 213 | 217 | 218 | 222 | 223 | 227 | 228 | 232 | 233 | 237 | 238 | 242 | 243 | 247 | 248 | 252 | 253 | 257 | 258 | 262 | 263 | 264 | 265 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | ${line} 327 | Name ${project.name} 328 | Version ${project.version} 329 | Compiled ${project.compile} 330 | Sketchbook ${sketchbook.location} 331 | ${line} 332 | done, finished. 333 | ${line} 334 | 335 | 336 | 337 | 338 | 339 | -------------------------------------------------------------------------------- /resources/code/ExampleTaglet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtng/launchpad/370fc73cb886501b1facc16e75e44804647d6dc5/resources/code/ExampleTaglet.class -------------------------------------------------------------------------------- /resources/code/ExampleTaglet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * -Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * -Redistribution in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Sun Microsystems, Inc. or the names of 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * This software is provided "AS IS," without a warranty of any 21 | * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 22 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY 24 | * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY 25 | * DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR 26 | * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR 27 | * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE 28 | * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, 29 | * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER 30 | * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF 31 | * THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN 32 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 33 | * 34 | * You acknowledge that Software is not designed, licensed or 35 | * intended for use in the design, construction, operation or 36 | * maintenance of any nuclear facility. 37 | */ 38 | 39 | import com.sun.tools.doclets.Taglet; 40 | import com.sun.javadoc.*; 41 | import java.util.Map; 42 | import java.io.*; 43 | /** 44 | * A sample Taglet representing @example. This tag can be used in any kind of 45 | * {@link com.sun.javadoc.Doc}. It is not an inline tag. The text is displayed 46 | * in yellow to remind the developer to perform a task. For 47 | * example, "@example Hello" would be shown as: 48 | *
49 | *
50 | * To Do: 51 | *
Fix this! 52 | *
53 | *
54 | * 55 | * @author Jamie Ho 56 | * @since 1.4 57 | */ 58 | 59 | public class ExampleTaglet implements Taglet { 60 | 61 | private static final String NAME = "example"; 62 | private static final String HEADER = "example To Do:"; 63 | 64 | /** 65 | * Return the name of this custom tag. 66 | */ 67 | public String getName() { 68 | return NAME; 69 | } 70 | 71 | /** 72 | * Will return true since @example 73 | * can be used in field documentation. 74 | * @return true since @example 75 | * can be used in field documentation and false 76 | * otherwise. 77 | */ 78 | public boolean inField() { 79 | return true; 80 | } 81 | 82 | /** 83 | * Will return true since @example 84 | * can be used in constructor documentation. 85 | * @return true since @example 86 | * can be used in constructor documentation and false 87 | * otherwise. 88 | */ 89 | public boolean inConstructor() { 90 | return true; 91 | } 92 | 93 | /** 94 | * Will return true since @example 95 | * can be used in method documentation. 96 | * @return true since @example 97 | * can be used in method documentation and false 98 | * otherwise. 99 | */ 100 | public boolean inMethod() { 101 | return true; 102 | } 103 | 104 | /** 105 | * Will return true since @example 106 | * can be used in method documentation. 107 | * @return true since @example 108 | * can be used in overview documentation and false 109 | * otherwise. 110 | */ 111 | public boolean inOverview() { 112 | return true; 113 | } 114 | 115 | /** 116 | * Will return true since @example 117 | * can be used in package documentation. 118 | * @return true since @example 119 | * can be used in package documentation and false 120 | * otherwise. 121 | */ 122 | public boolean inPackage() { 123 | return true; 124 | } 125 | 126 | /** 127 | * Will return true since @example 128 | * can be used in type documentation (classes or interfaces). 129 | * @return true since @example 130 | * can be used in type documentation and false 131 | * otherwise. 132 | */ 133 | public boolean inType() { 134 | return true; 135 | } 136 | 137 | /** 138 | * Will return false since @example 139 | * is not an inline tag. 140 | * @return false since @example 141 | * is not an inline tag. 142 | */ 143 | 144 | public boolean isInlineTag() { 145 | return false; 146 | } 147 | 148 | /** 149 | * Register this Taglet. 150 | * @param tagletMap the map to register this tag to. 151 | */ 152 | public static void register(Map tagletMap) { 153 | ExampleTaglet tag = new ExampleTaglet(); 154 | Taglet t = (Taglet) tagletMap.get(tag.getName()); 155 | if (t != null) { 156 | tagletMap.remove(tag.getName()); 157 | } 158 | tagletMap.put(tag.getName(), tag); 159 | } 160 | 161 | /** 162 | * Given the Tag representation of this custom 163 | * tag, return its string representation. 164 | * @param tag the Tag representation of this custom tag. 165 | */ 166 | public String toString(Tag tag) { 167 | return createHTML(readFile(tag.text())); 168 | } 169 | 170 | 171 | /** 172 | * Given an array of Tags representing this custom 173 | * tag, return its string representation. 174 | * @param tags the array of Tags representing of this custom tag. 175 | */ 176 | public String toString(Tag[] tags) { 177 | if (tags.length == 0) { 178 | return null; 179 | } 180 | return createHTML(readFile(tags[0].text())); 181 | } 182 | 183 | 184 | 185 | String createHTML(String theString) { 186 | if(theString!=null) { 187 | String dd = ""; 193 | 194 | return dd+"\n
" + 195 | "
+Example
" + 196 | "
"+theString+"
" + 197 | "
"; 198 | } 199 | return ""; 200 | } 201 | 202 | 203 | /** 204 | * check if the examples directory exists and return the example as given in the tag. 205 | * @param theExample the name of the example 206 | */ 207 | String readFile(String theExample) { 208 | String record = ""; 209 | String myResult = ""; 210 | int recCount = 0; 211 | String myDir = "../examples"; 212 | File file=new File(myDir); 213 | if(file.exists()==false) { 214 | myDir = "./examples"; 215 | } 216 | try { 217 | FileReader fr = new FileReader(myDir+"/"+theExample+"/"+theExample+".pde"); 218 | BufferedReader br = new BufferedReader(fr); 219 | record = new String(); 220 | while ((record = br.readLine()) != null) { 221 | myResult += record+"\n"; 222 | } 223 | } catch (IOException e) { 224 | System.out.println(e); 225 | return null; 226 | } 227 | return myResult; 228 | } 229 | } 230 | 231 | 232 | -------------------------------------------------------------------------------- /resources/code/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtng/launchpad/370fc73cb886501b1facc16e75e44804647d6dc5/resources/code/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /resources/code/doc.sh: -------------------------------------------------------------------------------- 1 | # a shell script to create a java documentation 2 | # for a processing library. 3 | # 4 | # make changes to the variables below so they 5 | # fit the structure of your library 6 | 7 | # the package name of your library 8 | package=template; 9 | 10 | # source folder location 11 | src=../src; 12 | 13 | # the destination folder of your documentation 14 | dest=../documentation; 15 | 16 | 17 | # compile the java documentation 18 | javadoc -d $dest -stylesheetfile ./stylesheet.css -sourcepath ${src} ${package} 19 | -------------------------------------------------------------------------------- /resources/install_instructions.txt: -------------------------------------------------------------------------------- 1 | To install, simply drag this folder into your libraries folder. 2 | 3 | For Processing 1.0, your libraries folder is located in your Processing sketch folder. 4 | 5 | Otherwise, if you're still using Processing BETA, your libraries folder can be found in same folder as Processing itself. -------------------------------------------------------------------------------- /resources/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | /* Define colors, fonts and other style attributes here to override the defaults */ 3 | /* processingLibs style by andreas schlegel, sojamo */ 4 | 5 | 6 | body { 7 | margin : 0; 8 | padding : 0; 9 | padding-left : 10px; 10 | padding-right : 8px; 11 | background-color : #FFFFFF; 12 | font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; 13 | font-size : 100%; 14 | font-size : 0.7em; 15 | font-weight : normal; 16 | line-height : normal; 17 | margin-bottom:30px; 18 | } 19 | 20 | 21 | 22 | 23 | /* Headings */ 24 | h1, h2, h3, h4, h5, th { 25 | font-family :Arial, Helvetica, sans-serif; 26 | font-size:1.2em; 27 | } 28 | 29 | 30 | p { 31 | font-size : 1em; 32 | width:80%; 33 | } 34 | 35 | pre, code { 36 | font-family : "Courier New", Courier, monospace; 37 | font-size : 12px; 38 | line-height : normal; 39 | } 40 | 41 | 42 | 43 | table { 44 | border:0; 45 | margin-bottom:10px; 46 | margin-top:10px; 47 | } 48 | 49 | 50 | tr, td { 51 | border-top: 0px solid; 52 | border-left: 0px solid; 53 | padding-top:8px; 54 | padding-bottom:8px; 55 | } 56 | 57 | 58 | 59 | hr { 60 | border:0; 61 | height:1px; 62 | padding:0; 63 | margin:0; 64 | margin-bottom:4px; 65 | 66 | } 67 | 68 | 69 | 70 | dd, th, td, font { 71 | font-size:1.0em; 72 | line-height:1.0em; 73 | } 74 | 75 | 76 | 77 | dt { 78 | margin-bottom:0px; 79 | } 80 | 81 | 82 | 83 | dd { 84 | margin-top:2px; 85 | margin-bottom:4px; 86 | } 87 | 88 | 89 | 90 | a { 91 | text-decoration: underline; 92 | font-weight: normal; 93 | } 94 | 95 | a:hover, 96 | a:active { 97 | text-decoration: underline; 98 | font-weight: normal; 99 | } 100 | 101 | a:visited, 102 | a:link:visited { 103 | text-decoration: underline; 104 | font-weight: normal; 105 | } 106 | 107 | 108 | img { 109 | border: 0px solid #000000; 110 | } 111 | 112 | 113 | 114 | /* Navigation bar fonts */ 115 | .NavBarCell1 { 116 | border:0; 117 | } 118 | 119 | .NavBarCell1Rev { 120 | border:0; 121 | } 122 | 123 | .NavBarFont1 { 124 | font-family: Arial, Helvetica, sans-serif; 125 | font-size:1.1em; 126 | } 127 | 128 | 129 | .NavBarFont1 b { 130 | font-weight:normal; 131 | } 132 | 133 | 134 | 135 | .NavBarFont1:after, .NavBarFont1Rev:after { 136 | font-weight:normal; 137 | content: " \\"; 138 | } 139 | 140 | 141 | .NavBarFont1Rev { 142 | font-family: Arial, Helvetica, sans-serif; 143 | font-size:1.1em; 144 | } 145 | 146 | .NavBarFont1Rev b { 147 | font-family: Arial, Helvetica, sans-serif; 148 | font-size:1.1em; 149 | font-weight:normal; 150 | } 151 | 152 | .NavBarCell2 { 153 | font-family: Arial, Helvetica, sans-serif; 154 | } 155 | 156 | .NavBarCell3 { 157 | font-family: Arial, Helvetica, sans-serif; 158 | } 159 | 160 | 161 | 162 | font.FrameItemFont { 163 | font-family: Helvetica, Arial, sans-serif; 164 | font-size:1.1em; 165 | line-height:1.1em; 166 | } 167 | 168 | font.FrameHeadingFont { 169 | font-family: Helvetica, Arial, sans-serif; 170 | line-height:32px; 171 | } 172 | 173 | /* Font used in left-hand frame lists */ 174 | .FrameTitleFont { 175 | font-family: Helvetica, Arial, sans-serif 176 | } 177 | 178 | 179 | .toggleList { 180 | padding:0; 181 | margin:0; 182 | margin-top:12px; 183 | } 184 | 185 | .toggleList dt { 186 | font-weight:bold; 187 | font-size:12px; 188 | font-family:arial,sans-serif; 189 | padding:0px; 190 | margin:10px 0px 10px 0px; 191 | } 192 | 193 | .toggleList dt span { 194 | font-family: monospace; 195 | padding:0; 196 | margin:0; 197 | } 198 | 199 | 200 | .toggleList dd { 201 | margin:0; 202 | padding:0; 203 | } 204 | 205 | html.isjs .toggleList dd { 206 | display: none; 207 | } 208 | 209 | .toggleList pre { 210 | padding: 4px 4px 4px 4px; 211 | } 212 | 213 | 214 | 215 | 216 | 217 | /* COLORS */ 218 | 219 | pre, code { 220 | color: #000000; 221 | } 222 | 223 | 224 | body { 225 | color : #333333; 226 | background-color :#FFFFFF; 227 | } 228 | 229 | 230 | h1, h2, h3, h4, h5, h6 { 231 | color:#555; 232 | } 233 | 234 | a, 235 | .toggleList dt { 236 | color: #1a7eb0; 237 | } 238 | 239 | a:hover, 240 | a:active { 241 | color: #1a7eb0; 242 | } 243 | 244 | a:visited, 245 | a:link:visited { 246 | color: #1a7eb0; 247 | } 248 | 249 | td,tr { 250 | border-color: #999999; 251 | } 252 | 253 | hr { 254 | color:#999999; 255 | background:#999999; 256 | } 257 | 258 | 259 | .TableHeadingColor { 260 | background: #dcdcdc; 261 | color: #555; 262 | } 263 | 264 | 265 | .TableSubHeadingColor { 266 | background: #EEEEFF 267 | } 268 | 269 | .TableRowColor { 270 | background: #FFFFFF 271 | } 272 | 273 | 274 | .NavBarCell1 { 275 | background-color:#dcdcdc; 276 | color:#000; 277 | } 278 | 279 | .NavBarCell1 a { 280 | color:#333; 281 | } 282 | 283 | 284 | .NavBarCell1Rev { 285 | background-color:transparent; 286 | } 287 | 288 | .NavBarFont1 { 289 | color:#333; 290 | } 291 | 292 | 293 | .NavBarFont1Rev { 294 | color:#fff; 295 | } 296 | 297 | .NavBarCell2 { 298 | background-color:#999; 299 | } 300 | 301 | .NavBarCell2 a { 302 | color:#fff; 303 | } 304 | 305 | 306 | 307 | .NavBarCell3 { 308 | background-color:#dcdcdc; 309 | } 310 | 311 | -------------------------------------------------------------------------------- /src/com/rngtng/launchpad/LButton.java: -------------------------------------------------------------------------------- 1 | package com.rngtng.launchpad; 2 | 3 | /** 4 | * The Button class to handle the different Button types, acces thier MIDI codes 5 | * and transform code <-> numer conversions 6 | * 7 | * @author rngtng - Tobias Bielohlawek 8 | * 9 | */ 10 | public class LButton { 11 | 12 | public final static int UP = 0x68; 13 | public final static int DOWN = 0x69; 14 | public final static int LEFT = 0x6A; 15 | public final static int RIGHT = 0x6B; 16 | public final static int SESSION = 0x6C; 17 | public final static int USER1 = 0x6D; 18 | public final static int USER2 = 0x6E; 19 | public final static int MIXER = 0x6F; 20 | 21 | public final static int SCENE_OFFSET = 1; 22 | public final static int SCENE1 = SCENE_OFFSET + 0x08; 23 | public final static int SCENE2 = SCENE_OFFSET + 0x18; 24 | public final static int SCENE3 = SCENE_OFFSET + 0x28; 25 | public final static int SCENE4 = SCENE_OFFSET + 0x38; 26 | public final static int SCENE5 = SCENE_OFFSET + 0x48; 27 | public final static int SCENE6 = SCENE_OFFSET + 0x58; 28 | public final static int SCENE7 = SCENE_OFFSET + 0x68; 29 | public final static int SCENE8 = SCENE_OFFSET + 0x78; 30 | 31 | /* static ones */ 32 | 33 | /** 34 | * checks for valid button code 35 | * 36 | * @param buttonCode code of the button 37 | * @return boolean if code is valid 38 | */ 39 | public static boolean isButtonCode(int buttonCode) { 40 | if( buttonCode == UP) return true; 41 | if( buttonCode == DOWN) return true; 42 | if( buttonCode == LEFT) return true; 43 | if( buttonCode == RIGHT) return true; 44 | if( buttonCode == SESSION) return true; 45 | if( buttonCode == USER1) return true; 46 | if( buttonCode == USER2) return true; 47 | if( buttonCode == MIXER) return true; 48 | return false; 49 | } 50 | 51 | /** 52 | * checks for valid scene button code 53 | * 54 | * @param buttonCode code of the button 55 | * @return boolean whether code is as scene button 56 | */ 57 | public static boolean isSceneButtonCode(int buttonCode) { 58 | if( buttonCode == SCENE1) return true; 59 | if( buttonCode == SCENE2) return true; 60 | if( buttonCode == SCENE3) return true; 61 | if( buttonCode == SCENE4) return true; 62 | if( buttonCode == SCENE5) return true; 63 | if( buttonCode == SCENE6) return true; 64 | if( buttonCode == SCENE7) return true; 65 | if( buttonCode == SCENE8) return true; 66 | return false; 67 | } 68 | 69 | /** 70 | * return button code for button number 71 | * 72 | * @param button button value 73 | * @return button number 74 | */ 75 | public static int buttonNumber(int button) { 76 | return ( button <= 8 ) ? button : button - UP; 77 | } 78 | 79 | /** 80 | * return button number for button code 81 | * 82 | * @param button button value 83 | * @return button code 84 | */ 85 | public static int buttonCode(int button) { 86 | return ( button <= 8 ) ? button + UP : button; 87 | } 88 | 89 | /** 90 | * return scene button Code for scene button number 91 | * 92 | * @param button button value 93 | * @return scene button number 94 | */ 95 | public static int sceneButtonNumber(int button) { 96 | return ( button <= 8 ) ? button : (button - SCENE_OFFSET + 8) / 16; 97 | } 98 | 99 | /** 100 | * return scene button number for scene button code 101 | * 102 | * @param button button value 103 | * @return scene button code 104 | */ 105 | public static int sceneButtonCode(int button) { 106 | return ( button <= 8 ) ? (button * 16) - 8 + SCENE_OFFSET: button; 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /src/com/rngtng/launchpad/LColor.java: -------------------------------------------------------------------------------- 1 | package com.rngtng.launchpad; 2 | 3 | /** 4 | * The Color class, to handle the MIDI Color and Mode codes 5 | * 6 | * @author rngtng - Tobias Bielohlawek 7 | * 8 | */ 9 | public class LColor { 10 | 11 | public final static int OFF = 0; 12 | public final static int LOW = 1; 13 | public final static int MEDIUM = 2; 14 | public final static int HIGH = 3; 15 | 16 | public final static int RED_OFF = OFF; 17 | public final static int RED_LOW = LOW; 18 | public final static int RED_MEDIUM = MEDIUM; 19 | public final static int RED_HIGH = HIGH; 20 | 21 | public final static int GREEN_OFFSET = 16; 22 | public final static int GREEN_OFF = OFF * GREEN_OFFSET; 23 | public final static int GREEN_LOW = LOW * GREEN_OFFSET; 24 | public final static int GREEN_MEDIUM = MEDIUM * GREEN_OFFSET; 25 | public final static int GREEN_HIGH = HIGH * GREEN_OFFSET; 26 | 27 | public final static int YELLOW_OFF = RED_OFF + GREEN_OFF; 28 | public final static int YELLOW_LOW = RED_LOW + GREEN_LOW; 29 | public final static int YELLOW_MEDIUM = RED_MEDIUM + GREEN_MEDIUM; 30 | public final static int YELLOW_HIGH = RED_HIGH + GREEN_HIGH; 31 | 32 | //Hack: I want NORMAL to be default MODE so I switched values of BUFFERED and NORMAL 33 | public final static int BUFFERED = 12; // updates the LED for the current update_buffer only 34 | public final static int FLASHING = 8; // flashing updates the LED for flashing (the new value will be written to buffer 0 while the LED will be off in buffer 1, see buffering_mode) 35 | public final static int NORMAL = 0; // updates the LED for all circumstances (the new value will be written to both buffers) 36 | 37 | private int red; 38 | private int green; 39 | private int mode; 40 | 41 | /** 42 | * creates default black color 43 | */ 44 | public LColor() { 45 | this(OFF); 46 | } 47 | 48 | /** 49 | * creates color with given red and green value, green can be 0-3 or Constants 50 | * @param red red value 51 | * @param green green value 52 | */ 53 | public LColor(int red, int green) { 54 | this(red); 55 | setGreen(green); 56 | } 57 | 58 | /** 59 | * creates color with given red and green value, green can be 0-3 or Constants 60 | * @param red Red value 61 | * @param green Green value 62 | * @param mode Mode value 63 | */ 64 | public LColor(int red, int green, int mode) { 65 | this(red + mode); 66 | setGreen(green); 67 | } 68 | 69 | /** 70 | * creates color with given red/green and mode value 71 | * @param _color color value 72 | */ 73 | public LColor(int _color) { 74 | int red_and_mode = _color % GREEN_OFFSET; 75 | if( red_and_mode < FLASHING ) { 76 | this.setMode(NORMAL); 77 | } 78 | else if( red_and_mode < BUFFERED ) { 79 | this.setMode(FLASHING); 80 | } 81 | else { 82 | this.setMode(BUFFERED); 83 | } 84 | this.setRed(red_and_mode - this.getMode()); 85 | this.setGreen(_color - red_and_mode); 86 | } 87 | 88 | /** 89 | * Calculates the MIDI data 2 value (velocity) for given brightness and mode values. 90 | * * 91 | * @return integer to be used for MIDI data 2 92 | * 93 | * Errors raised: 94 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 95 | */ 96 | public int velocity() { 97 | //Hack switch values, as CONST have switch values for default reasons 98 | int mode = this.mode; 99 | if(mode == NORMAL) { 100 | mode = BUFFERED; 101 | } 102 | else if(mode == BUFFERED) { 103 | mode = NORMAL; 104 | } 105 | return this.green + this.red + mode; 106 | } 107 | 108 | /** 109 | * Returns the value of Red 110 | * 111 | * @return red value 112 | */ 113 | public int getRed() { 114 | return red; 115 | } 116 | 117 | /** 118 | * Set the value of Red 119 | * 120 | * @param red 121 | */ 122 | public void setRed(int red) { 123 | this.red = red; 124 | } 125 | 126 | /** 127 | * Returns the value of green 128 | * 129 | * @return green value 130 | */ 131 | public int getGreen() { 132 | return green; 133 | } 134 | 135 | /** 136 | * Set the value of green 137 | * 138 | * @param green 139 | */ 140 | public void setGreen(int green) { 141 | if(green < GREEN_OFFSET) green *= GREEN_OFFSET; 142 | this.green = green; 143 | } 144 | 145 | /** 146 | * Returns the value of mode 147 | * 148 | * @return mode value 149 | */ 150 | public int getMode() { 151 | return mode; 152 | } 153 | 154 | /** 155 | * Set the value of mode 156 | * 157 | * @param mode 158 | */ 159 | public void setMode(int mode) { 160 | this.mode = mode; 161 | } 162 | 163 | /** 164 | * Compares color with given int value 165 | * 166 | * @param color 167 | * @return true if color is equal 168 | */ 169 | public boolean is(int color) { 170 | return velocity() == new LColor(color).velocity(); 171 | } 172 | 173 | /** 174 | * Compares color with given LColor value 175 | * 176 | * @param color 177 | * @return true if color is equal 178 | */ 179 | public boolean is(LColor color) { 180 | return velocity() == color.velocity(); 181 | } 182 | 183 | /** 184 | * Compares red color value with given int value 185 | * 186 | * @param red 187 | * @return true if color is equal 188 | */ 189 | public boolean isRed(int red) { 190 | return getRed() == new LColor(red).getRed(); 191 | } 192 | 193 | /** 194 | * Compares red color value with given int value 195 | * 196 | * @param green 197 | * @return true if color is equal 198 | */ 199 | public boolean isGreen(int green) { 200 | return getGreen() == new LColor(green).getGreen(); 201 | } 202 | 203 | /** 204 | * Compares red color value with given int value 205 | * 206 | * @param mode 207 | * @return true if color is equal 208 | */ 209 | public boolean isMode(int mode) { 210 | return getMode() == new LColor(mode).getMode(); 211 | } 212 | } -------------------------------------------------------------------------------- /src/com/rngtng/launchpad/LMidiCodes.java: -------------------------------------------------------------------------------- 1 | package com.rngtng.launchpad; 2 | 3 | /** 4 | * Set of MidiCodes to send to Launchpad 5 | * 6 | * @author rngtng - Tobias Bielohlawek 7 | * 8 | */ 9 | public interface LMidiCodes { 10 | public final static int STATUS_NIL = 0x00; 11 | public final static int STATUS_OFF = 0x80; 12 | public final static int STATUS_ON = 0x90; 13 | public final static int STATUS_MULTI = 0x92; 14 | public final static int STATUS_CC = 0xB0; 15 | 16 | public final static int VELOCITY_TEST_LEDS = 0x7C; 17 | 18 | public final static int GRIDLAYOUT_XY = 0x01; 19 | public final static int GRIDLAYOUT_DRUM_RACK = 0x02; 20 | 21 | public final static int BUFFER0 = 0; 22 | public final static int BUFFER1 = 1; 23 | public final static int MODE_FLASHING = 8; //whether to start flashing by automatically switching between the two buffers for display 24 | public final static int MODE_COPY = 16; //whether to copy the LEDs states from the new display_buffer over to the new update_buffer 25 | } -------------------------------------------------------------------------------- /src/com/rngtng/launchpad/LaunchadPAppletListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | A wrapper class to add PApplet LaunchpadListener methods 3 | 4 | (c) copyright 2009 by rngtng - Tobias Bielohlawek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General 17 | Public License along with this library; if not, write to the 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 19 | Boston, MA 02111-1307 USA 20 | */ 21 | 22 | package com.rngtng.launchpad; 23 | 24 | import java.lang.reflect.InvocationTargetException; 25 | import java.lang.reflect.Method; 26 | 27 | import processing.core.PApplet; 28 | 29 | /** 30 | * A wrapper class to to PApplet into a LaunchpadListerner for generic Listener handling 31 | * 32 | * @author rngtng - Tobias Bielohlawek 33 | * 34 | */ 35 | public class LaunchadPAppletListener implements LaunchpadListener { 36 | 37 | PApplet app; 38 | 39 | private Method buttonPressedMethod; 40 | private Method buttonReleasedMethod; 41 | 42 | private Method sceneButtonPressedMethod; 43 | private Method sceneButtonReleasedMethod; 44 | 45 | private Method gridPressedMethod; 46 | private Method gridReleasedMethod; 47 | 48 | LaunchadPAppletListener(PApplet _app) { 49 | app = _app; 50 | getMethods(app); 51 | } 52 | 53 | protected void getMethods(Object parent) { 54 | Class[] argsButton = new Class[] { int.class}; 55 | try { 56 | buttonPressedMethod = parent.getClass().getDeclaredMethod( "launchpadButtonPressed", argsButton); 57 | } catch (NoSuchMethodException e) { 58 | // not a big deal if they aren't implemented 59 | } 60 | try { 61 | buttonReleasedMethod = parent.getClass().getDeclaredMethod( "launchpadButtonReleased", argsButton); 62 | } catch (NoSuchMethodException e) { 63 | // not a big deal if they aren't implemented 64 | } 65 | 66 | try { 67 | sceneButtonPressedMethod = parent.getClass().getDeclaredMethod( "launchpadSceneButtonPressed", argsButton); 68 | } catch (NoSuchMethodException e) { 69 | // not a big deal if they aren't implemented 70 | } 71 | try { 72 | sceneButtonReleasedMethod = parent.getClass().getDeclaredMethod( "launchpadSceneButtonReleased", argsButton); 73 | } catch (NoSuchMethodException e) { 74 | // not a big deal if they aren't implemented 75 | } 76 | 77 | Class[] argsGrid = new Class[] {int.class, int.class}; 78 | try { 79 | gridPressedMethod = parent.getClass().getDeclaredMethod( "launchpadGridPressed", argsGrid); 80 | } catch (NoSuchMethodException e) { 81 | // not a big deal if they aren't implemented 82 | } 83 | try { 84 | gridReleasedMethod = parent.getClass().getDeclaredMethod( "launchpadGridReleased", argsGrid); 85 | } catch (NoSuchMethodException e) { 86 | // not a big deal if they aren't implemented 87 | } 88 | } 89 | 90 | public void launchpadButtonPressed(int buttonCode) { 91 | if (buttonPressedMethod == null) return; 92 | try { 93 | buttonPressedMethod.invoke(app, new Object[]{ buttonCode }); // param is: buttonCode 94 | } catch (IllegalArgumentException e) { 95 | e.printStackTrace(); 96 | } catch (IllegalAccessException e) { 97 | e.printStackTrace(); 98 | } catch (InvocationTargetException e) { 99 | e.printStackTrace(); 100 | } 101 | } 102 | 103 | public void launchpadButtonReleased(int buttonCode) { 104 | if (buttonReleasedMethod == null) return; 105 | try { 106 | buttonReleasedMethod.invoke(app, new Object[]{ buttonCode }); // param is: buttonCode 107 | } catch (IllegalArgumentException e) { 108 | e.printStackTrace(); 109 | } catch (IllegalAccessException e) { 110 | e.printStackTrace(); 111 | } catch (InvocationTargetException e) { 112 | e.printStackTrace(); 113 | } 114 | } 115 | 116 | public void launchpadSceneButtonPressed(int buttonCode) { 117 | if (sceneButtonPressedMethod == null) return; 118 | try { 119 | sceneButtonPressedMethod.invoke(app, new Object[]{ buttonCode }); // param is: buttonCode 120 | } catch (IllegalArgumentException e) { 121 | e.printStackTrace(); 122 | } catch (IllegalAccessException e) { 123 | e.printStackTrace(); 124 | } catch (InvocationTargetException e) { 125 | e.printStackTrace(); 126 | } 127 | } 128 | 129 | public void launchpadSceneButtonReleased(int buttonCode) { 130 | if (sceneButtonReleasedMethod == null) return; 131 | try { 132 | sceneButtonReleasedMethod.invoke(app, new Object[]{ buttonCode }); // param is: buttonCode 133 | } catch (IllegalArgumentException e) { 134 | e.printStackTrace(); 135 | } catch (IllegalAccessException e) { 136 | e.printStackTrace(); 137 | } catch (InvocationTargetException e) { 138 | e.printStackTrace(); 139 | } 140 | } 141 | public void launchpadGridPressed(int x, int y) { 142 | if(gridPressedMethod == null) return; 143 | try { 144 | gridPressedMethod.invoke(app, new Object[]{x, y}); // params are: x, y 145 | } catch (IllegalArgumentException e) { 146 | e.printStackTrace(); 147 | } catch (IllegalAccessException e) { 148 | e.printStackTrace(); 149 | } catch (InvocationTargetException e) { 150 | e.printStackTrace(); 151 | } 152 | } 153 | 154 | public void launchpadGridReleased(int x, int y) { 155 | if(gridReleasedMethod == null) return; 156 | try { 157 | gridReleasedMethod.invoke(app, new Object[]{x, y}); // params are: x, y 158 | } catch (IllegalArgumentException e) { 159 | e.printStackTrace(); 160 | } catch (IllegalAccessException e) { 161 | e.printStackTrace(); 162 | } catch (InvocationTargetException e) { 163 | e.printStackTrace(); 164 | } 165 | } 166 | 167 | } 168 | -------------------------------------------------------------------------------- /src/com/rngtng/launchpad/Launchpad.java: -------------------------------------------------------------------------------- 1 | /* 2 | A nice wrapper class to control the novation launchpad 3 | 4 | (c) copyright 2009 by rngtng - Tobias Bielohlawek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General 17 | Public License along with this library; if not, write to the 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 19 | Boston, MA 02111-1307 USA 20 | */ 21 | 22 | package com.rngtng.launchpad; 23 | 24 | import java.util.Vector; 25 | 26 | import javax.sound.midi.MidiMessage; 27 | 28 | import processing.core.PApplet; 29 | import processing.core.PImage; 30 | import themidibus.*; 31 | 32 | /** 33 | * This is the Main class to control your Launchpad. Please the Docs and Examples for usage 34 | * 35 | * @example Launchpad 36 | * @author rngtng - Tobias Bielohlawek 37 | * 38 | */ 39 | public class Launchpad implements LMidiCodes, StandardMidiListener { 40 | 41 | PApplet app; 42 | MidiBus midiBus; // The MidiBus 43 | 44 | public static int width = 8; 45 | public static int height = width; 46 | 47 | public final String VERSION = "0.2.1"; 48 | 49 | boolean connected; 50 | 51 | Vector listeners; 52 | 53 | public Launchpad(PApplet _app) { 54 | this(_app, "Launchpad", "Launchpad"); 55 | } 56 | 57 | /** 58 | * a Constructor, usually called in the setup() method in your sketch to 59 | * initialize and start the library. 60 | * 61 | * @example Launchpad 62 | * @param _app parent Applet 63 | * @param inputName name of MIDI input Device 64 | * @param outputName name of MIDI output Device 65 | */ 66 | public Launchpad(PApplet _app, String inputName, String outputName) { 67 | this.app = _app; 68 | this.connected = false; 69 | app.registerDispose(this); 70 | midiBus = new MidiBus(_app); 71 | if(midiBus.addInput(inputName) && midiBus.addOutput(outputName)) { 72 | midiBus.addMidiListener(this); 73 | 74 | listeners = new Vector(); 75 | addListener(new LaunchadPAppletListener(_app)); 76 | reset(); 77 | this.connected = true; 78 | } 79 | } 80 | 81 | public void dispose() { 82 | reset(); 83 | midiBus.close(); 84 | } 85 | 86 | /** 87 | * return the version of the library. 88 | * 89 | * @return String version number 90 | */ 91 | public String version() { 92 | return VERSION; 93 | } 94 | 95 | /** 96 | * @return wheter launchpad is connected 97 | */ 98 | public boolean connected() { 99 | return this.connected; 100 | } 101 | 102 | /* -- Listener Handling -- */ 103 | 104 | /** 105 | * Adds a listener who will be notified each time a new MIDI message is received from a MIDI input device. If the listener has already been added, it will not be added again. 106 | * 107 | * @param listener the listener to add. 108 | * @return true if and only the listener was successfully added. 109 | * @see #removeListener(LaunchpadListener listener) 110 | */ 111 | public boolean addListener(LaunchpadListener listener) { 112 | for(LaunchpadListener current : listeners) if(current == listener) return false; 113 | listeners.add(listener); 114 | return true; 115 | } 116 | 117 | /** 118 | * Removes a given listener. 119 | * 120 | * @param listener the listener to remove. 121 | * @return true if and only the listener was successfully removed. 122 | * @see #addListener(LaunchpadListener listener) 123 | */ 124 | public boolean removeListener(LaunchpadListener listener) { 125 | for(LaunchpadListener current : listeners) { 126 | if(current == listener) { 127 | listeners.remove(listener); 128 | return true; 129 | } 130 | } 131 | return false; 132 | } 133 | 134 | /** 135 | * Resets the launchpad - all settings are reset and all LEDs are switched off. 136 | * 137 | * Errors raised: 138 | * 139 | * [Launchpad::NoOutputAllowedError] when output is not enabled 140 | */ 141 | public void reset() { 142 | output(STATUS_CC, STATUS_NIL, STATUS_NIL); 143 | } 144 | 145 | /** 146 | * Lights all LEDs (for testing purposes). 147 | * 148 | * Parameters (see Launchpad for values): 149 | * 150 | * Errors raised: 151 | * 152 | * [Launchpad::NoOutputAllowedError] when output is not enabled 153 | */ 154 | public void testLeds() { 155 | testLeds(LColor.HIGH); 156 | } 157 | 158 | /** 159 | * Lights all LEDs (for testing purposes). 160 | * 161 | * Parameters (see Launchpad for values): 162 | * 163 | * @param brightness brightness of both LEDs for all buttons 164 | * 165 | * Errors raised: 166 | * 167 | * [Launchpad::NoOutputAllowedError] when output is not enabled 168 | */ 169 | public void testLeds(int brightness) { 170 | if(brightness == 0) { 171 | reset(); 172 | } 173 | else { 174 | output(STATUS_CC, STATUS_NIL, VELOCITY_TEST_LEDS + brightness); 175 | } 176 | } 177 | 178 | /** 179 | * Changes a single Control or Scene Button. Specify the Button by its name 180 | * 181 | * @param button value of the button (number or code) 182 | * @param color color value 183 | * 184 | * Errors raised: 185 | * [Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range 186 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 187 | * [Launchpad::NoOutputAllowedError] when output is not enabled 188 | */ 189 | public void changeButton(int button, int color) { 190 | changeButton(button, new LColor(color)); 191 | } 192 | 193 | /** 194 | * Changes a single Control or Scene Button. Specify the Button by its name 195 | * 196 | * @param button value of the button (number or code) 197 | * @param c LColor object 198 | * 199 | * Errors raised: 200 | * [Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range 201 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 202 | * [Launchpad::NoOutputAllowedError] when output is not enabled 203 | */ 204 | public void changeButton(int button, LColor c) { 205 | output(STATUS_CC, LButton.buttonCode(button), c.velocity()); 206 | } 207 | 208 | 209 | /** 210 | * Changes a single Control or Scene Button. Specify the Button by its name 211 | * 212 | * @param button value of the button (number or code) 213 | * @param color color value 214 | * 215 | * Errors raised: 216 | * [Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range 217 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 218 | * [Launchpad::NoOutputAllowedError] when output is not enabled 219 | */ 220 | public void changeSceneButton(int button, int color) { 221 | changeSceneButton(button, new LColor(color)); 222 | } 223 | 224 | /** 225 | * Changes a single Control or Scene Button. Specify the Button by its name 226 | * 227 | * @param button value of the button (number or code) 228 | * @param c LColor object 229 | * 230 | * Errors raised: 231 | * [Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range 232 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 233 | * [Launchpad::NoOutputAllowedError] when output is not enabled 234 | */ 235 | public void changeSceneButton(int button, LColor c) { 236 | output(STATUS_ON, LButton.sceneButtonCode(button) - LButton.SCENE_OFFSET, c.velocity()); 237 | } 238 | 239 | /** 240 | * Changes a single Button on the Grid. Specify the Button by its x & y coordinates 241 | * 242 | * @param x x coordinate 243 | * @param y y coordinate 244 | * @param color color value 245 | * 246 | * Errors raised: 247 | * [Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range 248 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 249 | * [Launchpad::NoOutputAllowedError] when output is not enabled 250 | */ 251 | public void changeGrid(int x, int y, int color) { 252 | changeGrid(x, y, new LColor(color)); 253 | } 254 | 255 | /** 256 | * Changes a single Button on the Grid. Specify the Button by its x & y coordinates 257 | * 258 | * @param x x coordinate 259 | * @param y y coordinate 260 | * @param c LColor object 261 | * 262 | * Errors raised: 263 | * [Launchpad::NoValidGridCoordinatesError] when coordinates aren't within the valid range 264 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 265 | * [Launchpad::NoOutputAllowedError] when output is not enabled 266 | */ 267 | public void changeGrid(int x, int y, LColor c) { 268 | output(STATUS_ON, (y * 16 + x), c.velocity()); 269 | } 270 | 271 | /** 272 | * Changes all buttons in batch mode. First 64 are the buttons on the grid, then the scene buttons (top to bottom) 273 | * followed by the control buttons (left to right). Maximum 80 values - excessive values will be ignored, missing 274 | * values will be filled with 0 275 | * 276 | * @param colors an array of Colors 277 | * @see LColor 278 | * 279 | * Errors raised: 280 | * 281 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 282 | * [Launchpad::NoOutputAllowedError] when output is not enabled 283 | */ 284 | public void changeAll(LColor[] colors) { 285 | int param1, param2; 286 | 287 | // send normal MIDI message to reset rapid LED change pointer 288 | // in this case, set mapping mode to x-y layout (the default) 289 | output(STATUS_CC, STATUS_NIL, GRIDLAYOUT_XY); 290 | 291 | int default_color = new LColor().velocity(); 292 | // send colors in slices of 2 293 | for(int i = 0; i < 80; i = i + 2) { 294 | try { 295 | param1 = colors[i].velocity(); 296 | } catch (ArrayIndexOutOfBoundsException e) { 297 | param1 = default_color; 298 | } catch (NullPointerException e) { 299 | param1 = default_color; 300 | } 301 | 302 | try { 303 | param2 = colors[i+1].velocity(); 304 | } catch (ArrayIndexOutOfBoundsException e) { 305 | param2 = default_color; 306 | } catch (NullPointerException e) { 307 | param2 = default_color; 308 | } 309 | output(STATUS_MULTI, param1, param2); 310 | } 311 | } 312 | 313 | /** 314 | * Changes all buttons in batch mode. First 64 are the buttons on the grid, then the scene buttons (top to bottom) 315 | * followed by the control buttons (left to right). Maximum 80 values - excessive values will be ignored, missing 316 | * values will be filled with 0 317 | * 318 | * @param colors an array of integers 319 | * 320 | * Errors raised: 321 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 322 | * [Launchpad::NoOutputAllowedError] when output is not enabled 323 | */ 324 | public void changeAll(int[] colors) { 325 | int param1, param2; 326 | 327 | // send normal MIDI message to reset rapid LED change pointer 328 | // in this case, set mapping mode to x-y layout (the default) 329 | output(STATUS_CC, STATUS_NIL, GRIDLAYOUT_XY); 330 | 331 | int default_color = new LColor().velocity(); 332 | // send colors in slices of 2 333 | for(int i = 0; i < 80; i = i + 2) { 334 | try { 335 | param1 = colors[i]; 336 | } catch (ArrayIndexOutOfBoundsException e) { 337 | param1 = default_color; 338 | } catch (NullPointerException e) { 339 | param1 = default_color; 340 | } 341 | 342 | try { 343 | param2 = colors[i+1]; 344 | } 345 | catch (ArrayIndexOutOfBoundsException e) { 346 | param2 = default_color; 347 | } catch (NullPointerException e) { 348 | param2 = default_color; 349 | } 350 | output(STATUS_MULTI, param1, param2); 351 | } 352 | } 353 | 354 | /** 355 | * Changes all buttons in batch mode. Using the pixel data of an PImage 356 | * 357 | * @param image an PImage object 358 | * 359 | * Errors raised: 360 | * [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range 361 | * [Launchpad::NoOutputAllowedError] when output is not enabled 362 | */ 363 | public void changeAll(PImage image) { 364 | int param1, param2; 365 | 366 | // send normal MIDI message to reset rapid LED change pointer 367 | // in this case, set mapping mode to x-y layout (the default) 368 | output(STATUS_CC, STATUS_NIL, GRIDLAYOUT_XY); 369 | image.loadPixels(); 370 | 371 | // send colors in slices of 2 372 | for(int i = 0; i < 80; i = i + 2) { 373 | try { 374 | param1 = (int) (4 * app.red(image.pixels[i]) / 255); 375 | } catch (ArrayIndexOutOfBoundsException e) { 376 | param1 = 0; 377 | } catch (NullPointerException e) { 378 | param1 = 0; 379 | } 380 | 381 | try { 382 | param2 = (int) (4 * app.green(image.pixels[i+1]) / 255); 383 | } catch (ArrayIndexOutOfBoundsException e) { 384 | param2 = 0; 385 | } catch (NullPointerException e) { 386 | param2 = 0; 387 | } 388 | output(STATUS_MULTI, param1, param2); 389 | } 390 | } 391 | 392 | 393 | 394 | /** 395 | * Switches LEDs marked as flashing on when using custom timer for flashing. 396 | * 397 | * Errors raised: 398 | * [Launchpad::NoOutputAllowedError] when output is not enabled 399 | */ 400 | public void flashingOn() { 401 | bufferingMode(BUFFER0, BUFFER0); 402 | } 403 | 404 | /** 405 | * Switches LEDs marked as flashing off when using custom timer for flashing. 406 | * 407 | * Errors raised: 408 | * 409 | * [Launchpad::NoOutputAllowedError] when output is not enabled 410 | */ 411 | public void flashingOff() { 412 | bufferingMode(BUFFER1, BUFFER0); 413 | } 414 | 415 | /** 416 | * Starts flashing LEDs marked as flashing automatically. 417 | * Stop flashing by calling flashing_on or flashing_off. 418 | * 419 | * Errors raised: 420 | * [Launchpad::NoOutputAllowedError] when output is not enabled 421 | */ 422 | public void flashingAuto() { 423 | bufferingMode(BUFFER0, BUFFER0, MODE_FLASHING); 424 | } 425 | 426 | /** 427 | * Controls the two buffers. 428 | * 429 | * @param display_buffer which buffer to use for display, defaults to +0+ 430 | * @param update_buffer which buffer to use for updates when :mode is set to :buffering, defaults to +0+ (see change) 431 | * 432 | * Errors raised: 433 | * [Launchpad::NoOutputAllowedError] when output is not enabled 434 | */ 435 | public void bufferingMode(int display_buffer, int update_buffer) { 436 | bufferingMode(BUFFER0, BUFFER0, 0); 437 | } 438 | 439 | /** 440 | * Controls the two buffers. 441 | * 442 | * @param display_buffer which buffer to use for display, defaults to +0+ 443 | * @param update_buffer which buffer to use for updates when :mode is set to :buffering, defaults to +0+ (see change) 444 | * @param flags values to control FLASHING and COPY 445 | * 446 | * Errors raised: 447 | * [Launchpad::NoOutputAllowedError] when output is not enabled 448 | */ 449 | public void bufferingMode(int display_buffer, int update_buffer, int flags) { 450 | int data = display_buffer + 4 * update_buffer + 32 + flags; 451 | output(STATUS_CC, STATUS_NIL, data); 452 | } 453 | 454 | /** 455 | * Reads user actions (button presses/releases) that haven't been handled yet and invokes a button 456 | * or grid event 457 | * 458 | * @param message the MIDI message 459 | * 460 | * Errors raised: 461 | * [Launchpad::NoInputAllowedError] when input is not enabled 462 | */ 463 | public void midiMessage(MidiMessage message, long timestamp) { 464 | int code = message.getStatus(); 465 | int note = message.getMessage()[1] & 0xFF; 466 | int velocity = message.getMessage()[2] & 0xFF; 467 | 468 | //process button event 469 | if(code == STATUS_CC) { 470 | for(LaunchpadListener listener : listeners) { 471 | if(velocity == 127) { 472 | listener.launchpadButtonPressed(note); 473 | } 474 | else { 475 | listener.launchpadButtonReleased(note); 476 | } 477 | } 478 | //PApplet.println("Button :" + note); 479 | return; 480 | } 481 | 482 | //process grid event 483 | if( code == STATUS_ON || code == STATUS_OFF) { 484 | 485 | if( LButton.isSceneButtonCode(note + LButton.SCENE_OFFSET) ) { 486 | for(LaunchpadListener listener : listeners) { 487 | if(velocity == 127) { 488 | listener.launchpadSceneButtonPressed(note + LButton.SCENE_OFFSET ); 489 | } 490 | else { 491 | listener.launchpadSceneButtonReleased(note + LButton.SCENE_OFFSET); 492 | } 493 | } 494 | // PApplet.println("SceneButton :" + note); 495 | return; 496 | } 497 | else { 498 | for(LaunchpadListener listener : listeners) { 499 | if(velocity == 127) { 500 | listener.launchpadGridPressed(note % 16, note / 16); 501 | } 502 | else { 503 | listener.launchpadGridReleased(note % 16, note / 16); 504 | } 505 | } 506 | } 507 | // PApplet.println("x:" + (note % 16) + " y:" + (note / 16)); 508 | return; 509 | } 510 | 511 | PApplet.print("Huston we've an unimplemented MIDI Message: " + message.getStatus()); 512 | if(message.getMessage().length > 1) PApplet.print(" Param 1: " + (message.getMessage()[1] & 0xFF) ); 513 | if(message.getMessage().length > 2) PApplet.print(" Param 2: " + (message.getMessage()[2] & 0xFF) ); 514 | PApplet.println(); 515 | } 516 | 517 | /** 518 | * Writes a messages to the MIDI device. 519 | * 520 | */ 521 | private void output(int status, int data1, int data2) { 522 | //raise NoOutputAllowedError if @output.nil? 523 | midiBus.sendMessage(new byte[]{ (byte) status, (byte) data1, (byte) data2}); 524 | } 525 | 526 | } 527 | -------------------------------------------------------------------------------- /src/com/rngtng/launchpad/LaunchpadListener.java: -------------------------------------------------------------------------------- 1 | package com.rngtng.launchpad; 2 | 3 | /** 4 | * The LaunchpadListener Interface, implement this for interaction feedback 5 | * 6 | * @author rngtng - Tobias Bielohlawek 7 | * 8 | */ 9 | public interface LaunchpadListener { 10 | 11 | public void launchpadGridPressed(int x, int y); 12 | public void launchpadGridReleased(int x, int y); 13 | 14 | public void launchpadButtonPressed(int buttonCode); 15 | public void launchpadButtonReleased(int buttonCode); 16 | 17 | public void launchpadSceneButtonPressed(int buttonCode); 18 | public void launchpadSceneButtonReleased(int buttonCode); 19 | } -------------------------------------------------------------------------------- /src/com/rngtng/launchpad/MonomeLaunchpad.java: -------------------------------------------------------------------------------- 1 | /* 2 | An implementation of the Monome API for launchpad 3 | 4 | (c) copyright 2009 by rngtng - Tobias Bielohlawek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General 17 | Public License along with this library; if not, write to the 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 19 | Boston, MA 02111-1307 USA 20 | */ 21 | 22 | package com.rngtng.launchpad; 23 | 24 | import jklabs.monomic.Monome; 25 | import processing.core.PApplet; 26 | 27 | 28 | /** 29 | * An implementation of the Monomic API to get your Launchpad working with Monome stuff 30 | * 31 | * @author rngtng - Tobias Bielohlawek 32 | * 33 | */ 34 | public class MonomeLaunchpad extends Monome implements LaunchpadListener { 35 | 36 | private LColor color_on, color_off; 37 | Launchpad launchpad; 38 | 39 | public MonomeLaunchpad(Object listener) { 40 | super(listener); 41 | launchpad = new Launchpad( (PApplet) listener); 42 | launchpad.addListener(this); 43 | color_on = new LColor(LColor.RED_HIGH); //full Red 44 | color_off = new LColor(); //Black 45 | launchpad.reset(); 46 | } 47 | 48 | public MonomeLaunchpad(Object listener, String inputName, String outputName) { 49 | super(listener); 50 | launchpad = new Launchpad( (PApplet) listener, inputName, outputName); 51 | launchpad.addListener(this); 52 | color_on = new LColor(LColor.RED_HIGH); //full Red 53 | color_off = new LColor(); //Black 54 | launchpad.reset(); 55 | } 56 | 57 | ////////////////////////////////////////////////// monome functions 58 | 59 | public void testPattern(boolean b) { 60 | super.testPattern(b); 61 | launchpad.testLeds(); 62 | //sendSerial(LED_TEST, (byte) (b ? 1 : 0)); 63 | } 64 | 65 | public void setValue(int x, int y, int value) { 66 | super.setValue(x, y, value); 67 | launchpad.changeGrid(x, y, (value == 1) ? color_on : color_off); 68 | } 69 | 70 | public void setRow(int i, byte bitVals) { 71 | super.setRow(i, bitVals); 72 | for(int k = 0; k < 8; k++) { 73 | launchpad.changeGrid(k, i, (((bitVals >> k) & 1) == 1) ? color_on : color_off); 74 | } 75 | } 76 | 77 | public void setCol(int i, byte bitVals) { 78 | super.setCol(i, bitVals); 79 | for(int k = 0; k < 8; k++) { 80 | launchpad.changeGrid(i, k, (((bitVals >> k) & 1) == 1) ? color_on : color_off); 81 | } 82 | } 83 | 84 | ////////////////////////////////////////////////// listener functions 85 | 86 | public synchronized void launchpadGridPressed(int x, int y) { 87 | super.handleInputEvent(x, y, 1); 88 | } 89 | 90 | public synchronized void launchpadGridReleased(int x, int y) { 91 | super.handleInputEvent(x, y, 0); 92 | } 93 | 94 | public void launchpadButtonPressed(int buttonCode) { 95 | } 96 | 97 | public void launchpadButtonReleased(int buttonCode) { 98 | } 99 | 100 | public void launchpadSceneButtonPressed(int buttonCode) { 101 | } 102 | 103 | public void launchpadSceneButtonReleased(int buttonCode) { 104 | } 105 | } -------------------------------------------------------------------------------- /update-webpage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | VERSION=`ls distribution | awk 'match($0, /[0-9.]+/) { print substr($0,RSTART,RLENGTH) }'` 3 | 4 | #git tag -d "v${VERSION}" && git push origin :refs/tags/v${VERSION} 5 | 6 | git checkout gh-pages && \ 7 | rm -rf download reference examples && \ 8 | mv distribution/launchpad*/* . && \ 9 | git add -A && \ 10 | git commit -m "updated webpage to version ${VERSION}" && \ 11 | git push origin && \ 12 | git tag -a "v${VERSION}" -m "updated to version ${VERSION}" && \ 13 | git push --tags origin && \ 14 | rm -rf download reference examples && \ 15 | git checkout master -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | ##project.title## 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Fork me on GitHub 21 |
22 | 23 | 26 | 27 | 39 | 40 |
41 | 42 |
43 |

##project.name##

44 |

45 | A library by ##author.name## for the programming environment processing. Last update, ##date##. 46 |

47 |

48 | This library provides an interface to access novation's launchpad programmatically. It's based on Thomas Jachmanns ruby launchpad gem. LEDs can be lighted and button presses can be listened to. In addition, it includes a wrapper for the Monomic Library as well. 49 |

50 |
51 | 52 | 53 | 54 |
55 |

Download

56 |

57 | Download ##project.name## version ##project.version## in 58 | .zip format. 59 |

60 |

Installation

61 |

62 | Unzip and put the extracted ##project.name## folder into the libraries folder of your processing sketches. Reference and examples are included in the ##project.name## folder. 63 |

64 |
65 | 66 | 67 |
68 |

Keywords ##project.keywords##

69 |

Reference. Have a look at the javadoc reference here. a copy of the reference is included in the .zip as well.

70 |

Source. The source code of ##project.name## is available at ##source.host##, and its repository can be browsed here.

71 |
72 | 73 |
74 |

Examples

75 |

Find a list of examples in the current distribution of ##project.name##, or have a look at them by following the links below.

76 |
    77 | ##project.examples## 78 |
79 |
80 | 81 | 82 |
83 |

Tested

84 |

85 | 86 | Platform ##tested.platform## 87 | 88 | 89 |
Processing ##tested.processingversion## 90 | 91 | 92 |
Dependencies ##project.dependencies## 93 |

94 |
95 | 96 | 97 | 98 | 110 | 111 | 112 | 117 | 118 | 119 | 123 | 124 | 125 |
126 |
127 | 128 | 131 |
132 | 133 | -------------------------------------------------------------------------------- /web/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* processingLibs style by andreas schlegel, sojamo. */ 2 | 3 | #header { 4 | background: #58ACFA !important; 5 | width: 100%; 6 | margin-left: -64px; 7 | padding-left: 64px; 8 | padding-bottom: 24px !important; 9 | } 10 | 11 | #header h1 { 12 | color: #fff !important; 13 | } 14 | 15 | * { 16 | margin:0; 17 | padding:0; 18 | border:0; 19 | } 20 | 21 | 22 | body { 23 | font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; 24 | font-size : 100%; 25 | font-size : 0.70em; 26 | font-weight : normal; 27 | line-height : normal; 28 | } 29 | 30 | 31 | 32 | #container { 33 | margin-left:64px; 34 | background-color:#fff; 35 | } 36 | 37 | #header { 38 | float:left; 39 | padding-top:24px; 40 | padding-bottom:48px; 41 | } 42 | 43 | #menu { 44 | margin-top:16px; 45 | float:left; 46 | margin-bottom:64px; 47 | } 48 | 49 | 50 | #about, 51 | #download, 52 | #examples, 53 | #demos, 54 | #misc { 55 | width:480px; 56 | float:left; 57 | margin-right:24px; 58 | } 59 | 60 | 61 | #resources, #info { 62 | width:320px; 63 | float:left; 64 | } 65 | 66 | 67 | .clear { 68 | clear:both; 69 | } 70 | 71 | #footer { 72 | margin-top:300px; 73 | height:20px; 74 | margin-bottom:32px; 75 | } 76 | 77 | 78 | ul { 79 | list-style:none; 80 | padding:0; 81 | margin:0; 82 | } 83 | 84 | 85 | #menu ul li, #subMenu ul li { 86 | float:left; 87 | padding-right:6px; 88 | } 89 | 90 | 91 | 92 | 93 | 94 | 95 | /* Headings */ 96 | 97 | h1 { 98 | font-size:2em; 99 | font-weight:normal; 100 | } 101 | 102 | 103 | h2, h3, h4, h5, th { 104 | font-size:1.3em; 105 | font-weight:normal; 106 | margin-bottom:4px; 107 | } 108 | 109 | 110 | 111 | p { 112 | font-size:1em; 113 | width:90%; 114 | margin-bottom:32px; 115 | } 116 | 117 | 118 | pre, code { 119 | font-family:"Courier New", Courier, monospace; 120 | font-size:1em; 121 | line-height:normal; 122 | } 123 | 124 | 125 | 126 | 127 | hr { 128 | border:0; 129 | height:1px; 130 | margin-bottom:24px; 131 | } 132 | 133 | 134 | a { 135 | text-decoration: underline; 136 | font-weight: normal; 137 | } 138 | 139 | 140 | a:hover, 141 | a:active { 142 | text-decoration: underline; 143 | font-weight: normal; 144 | } 145 | 146 | 147 | a:visited, 148 | a:link:visited { 149 | text-decoration: underline; 150 | font-weight: normal; 151 | } 152 | 153 | 154 | 155 | img { 156 | border: 0px solid #000000; 157 | } 158 | 159 | 160 | 161 | 162 | 163 | /* COLORS */ 164 | 165 | 166 | body { 167 | color : #333; 168 | background-color :#fff; 169 | } 170 | 171 | 172 | #header { 173 | background-color:#fff; 174 | color:#333; 175 | } 176 | 177 | 178 | 179 | h1, h2, h3, h4, h5, h6 { 180 | color:#666; 181 | } 182 | 183 | 184 | pre, code { 185 | color: #000000; 186 | } 187 | 188 | 189 | a,strong { 190 | color: #333; 191 | } 192 | 193 | 194 | a:hover, 195 | a:active { 196 | color: #333; 197 | } 198 | 199 | 200 | a:visited, 201 | a:link:visited { 202 | color: #333; 203 | } 204 | 205 | 206 | #footer, #menu { 207 | background-color:#fff; 208 | color:#333; 209 | } 210 | 211 | 212 | #footer a, #menu a { 213 | color:#333; 214 | } 215 | --------------------------------------------------------------------------------