Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaunchpadLEDs

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.


Features

  • 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).

Requirements

Install dependencies:

pip install python-rtmidi fastapi uvicorn

Usage

1. Interactive Shell

Start the shell:

python sysex_shell.py

Type help for a list of commands.

2. Example Scripts

  • Lighting pads:
    python misc/lights.py
  • Lighting with BPM/tempo:
    python misc/lights_bpm.py
  • Scrolling text:
    python misc/text.py

3. REST API

Start the API server (from the project root):

uvicorn api.api:app --reload

Example: Send a Command via HTTP

curl -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/commands

SysEx Reference

The Launchpad MK2 uses SysEx messages with the following header:

0xF0, 0x00, 0x20, 0x29, 0x02, 0x18,  # Header
# ...message...
0xF7  # End of SysEx

Common 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 text

See Novation Launchpad MK2 Programmer's Reference for more.


Example Shell Commands

  • solid 63 0 63 — Set all pads to magenta (RGB)
  • solid 5 — Set all pads to palette color 5
  • pulse 10 — Pulse all pads with palette color 10
  • flash 20 — Flash all pads with palette color 20
  • text 15 3 Hello! — Scroll "Hello!" in color 15 at speed 3
  • clear — Turn off all pads
  • mode user1 — Switch to User 1 mode
  • tempo 120 — Send MIDI clock at 120 BPM

API Endpoints

  • POST /command — Execute a shell command.
    Body:
    {
      "command": "solid",
      "args": [63, 0, 63]
    }
  • GET /commands — List all available commands.

Screenshots


License

This project is provided as-is for hobby and educational use.


Credits


About

A modular Python toolkit for controlling a Launchpad MK2 via MIDI SysEx messages.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages