Skip to main content

Python API for the Novation Launchpad Mini MK3

Project description

lpminimk3

Python API for the Novation Launchpad Mini MK3 with an object-oriented approach.

CI

The goals of this project are as follows:

  • Intuitive, object-oriented design
  • Convenient for use in script or in shell
  • Access to all (or most) of the Launchpad Mini MK3 MIDI features

Installation

To install the most stable version of this package, run:

$ pip install lpminimk3

Usage example

Make sure your Launchpad is connected to your computer.

In script

"""Displays a random array of colors for 5 seconds."""

from lpminimk3 import Mode, find_launchpads
import random
import time

lp = find_launchpads()[0]  # Get the first available launchpad
lp.open()  # Open device for reading and writing on MIDI interface (by default)

lp.mode = Mode.PROG  # Switch to the programmer mode

for led_id in range(81):  # Loop through all 81 LEDs
    lp.panel.led(led_id).color = random.randint(1, 127)  # Set LED to a random color

time.sleep(5)  # Keep LEDs on for a while

for led_id in range(81):
    lp.panel.led(led_id).reset()  # Turn off LED

View example file here.

In shell

$ python
>>> import lpminimk3
>>> lp = lpminimk3.find_launchpads()[0]
>>> lp.open()
>>> lp.device_inquiry()  # Query device
MidiEvent(message=[240, 0, 32, 41, 2, 13, 14, 1, 247], deltatime=150.938086752)
>>>
>>> lp.mode = 'prog'  # Switch to programmer mode
>>> lp.grid.led('0x0').color = 10  # Set color to yellow
>>> lp.grid.led(1,0).color = 10  # Set color of next LED to yellow
>>> lp.panel.led('logo').color = 1  # Set logo LED color to white

Release History

  • 0.1.2
    • Properly bump up version
  • 0.1.1
    • Cleanup README
  • 0.1.0
    • First release ever (Still a work in progress)

Notes

  • Work in progress, so expect things to break!

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lpminimk3-0.1.2.tar.gz (14.6 kB view hashes)

Uploaded Source

Built Distribution

lpminimk3-0.1.2-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page