A modular Python toolkit for controlling a Novation Launchpad MK2 via MIDI System Exclusive (SysEx) messages.
Includes an interactive shell, lighting/text/effect scripts, and a REST API for remote or programmatic control.
- Interactive Shell: Live control of lights, text, effects, and modes (sysex_shell.py).
- Lighting Effects: Set solid colors, pulse, flash, and clear pads.
- Text Display: Scroll custom text across the Launchpad.
- Tempo Control: Send MIDI clock messages to adjust effect tempo.
- Raw SysEx: Send custom SysEx messages for advanced use.
- Mode Switching: Emulate Ableton-style mode switching with visual feedback.
- Input Listener: Monitor and display incoming MIDI messages.
- REST API: Control the Launchpad remotely via HTTP (api/api.py).
- Python 3.7+
- python-rtmidi
- FastAPI (for API)
- Uvicorn (for API server)
Install dependencies:
pip install python-rtmidi fastapi uvicornStart the shell:
python sysex_shell.pyType help for a list of commands.
- Lighting pads:
python misc/lights.py
- Lighting with BPM/tempo:
python misc/lights_bpm.py
- Scrolling text:
python misc/text.py
Start the API server (from the project root):
uvicorn api.api:app --reloadcurl -X POST "http://127.0.0.1:8000/command" -H "Content-Type: application/json" -d "{\"command\": \"solid\", \"args\": [63,0,63]}"List available commands:
curl http://127.0.0.1:8000/commandsThe Launchpad MK2 uses SysEx messages with the following header:
0xF0, 0x00, 0x20, 0x29, 0x02, 0x18, # Header
# ...message...
0xF7 # End of SysExCommon lighting commands:
0x0A, LED, Colour # Palette color (0-127)
0x0B, LED, R, G, B # RGB color (0-63 each)
0x0E, Colour # All LEDs
0x23, 0, LED, Colour # Flash effect
0x28, 0, LED, Colour # Pulse effect
0x14, Colour, Loop, Speed, ...Text... # Scroll textSee Novation Launchpad MK2 Programmer's Reference for more.
solid 63 0 63— Set all pads to magenta (RGB)solid 5— Set all pads to palette color 5pulse 10— Pulse all pads with palette color 10flash 20— Flash all pads with palette color 20text 15 3 Hello!— Scroll "Hello!" in color 15 at speed 3clear— Turn off all padsmode user1— Switch to User 1 modetempo 120— Send MIDI clock at 120 BPM
POST /command— Execute a shell command.
Body:{ "command": "solid", "args": [63, 0, 63] }GET /commands— List all available commands.
This project is provided as-is for hobby and educational use.
- Novation Launchpad MK2 Programmer's Reference Manual
- Inspired by the Ableton workflow and Launchpad community.