Use the Launchpad-Mk2 as a Macro Device
Project description
MacroPad
Simple Example
import macropad
# Create Pad Instance
lp = macropad.MacroPad()
# Bind function btn_up to Button X0 Y0 with color red and on press color green
@lp.bind(x=0, y=0, colorcode=5, color_on_activate=21)
def btn_up():
print("X-0 Y-0 PRESSED!")
# Start the Button Listener Thread
lp.start_binding_execution_thread()
# Wait forever
while True: continue
# Only needed if the programm is ending and not killed, without you get some MIDI errors
lp.close()
Stop Button Listener Thread
lp.stop_binding_execution_thread()
Unbind Keys
# Unbind Button X0 Y0
lp.unbind(x=0, y=0)
# Unbind Every Button
lp.unbind_all()
Coltrol Led's
# Turn Led X0 Y0 red
lp.enable_led(x=0, y=0, colorcode=5)
# Turn Led X0 Y0 off
lp.disable_led(x=0, y=0)
# Turn all Led´s off
lp.disable_all_leds()
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
macropad-1.2.0.tar.gz
(3.4 kB
view hashes)