Skip to main content

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


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 details)

Uploaded Source

File details

Details for the file macropad-1.2.0.tar.gz.

File metadata

  • Download URL: macropad-1.2.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for macropad-1.2.0.tar.gz
Algorithm Hash digest
SHA256 62ee2883b50a080e64652fb98caed224b8318a90ea6e98c0aa1845d3ef246ff0
MD5 edd0a17a667bbea337ee9cf31b0b55b7
BLAKE2b-256 091675af5b90a3812d70ca22456bd3194b8ebdf84f9896ae9d45b17ced208584

See more details on using hashes here.

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