Python API for the Novation Launchpad Mini MK3
Project description
lpminimk3
Python API for the Novation Launchpad Mini MK3 with an object-oriented approach.
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
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
lpminimk3-0.1.2-py3-none-any.whl
(15.4 kB
view hashes)
Close
Hashes for lpminimk3-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9e6e0f1cfd5c106ab912671f778d89a4356eaf894d6563f91b4579d48deefab |
|
MD5 | 5672b8d76186cd2ee369e82c0c82c222 |
|
BLAKE2b-256 | c5a1561c9c3ec8209eaa621b0a95ca38b40cd041964f7d06bc0bd59dc6493c85 |