Skip to content

Commit

Permalink
corrected hello.py demo for LPX; few notes in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
FMMT666 committed Mar 30, 2020
1 parent a834d72 commit 3e3fc3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Successfully tested with Ubuntu 18.04-LTS+. Requires compiling your own PyGame t

- added Mk3 Launchpad; just a few lines of code, so far; ** EXPERIMENTAL **
- added LPX Launchpad; just a few lines of code, so far; ** EXPERIMENTAL **
- updated "hello.py" demo with basic Mk3/LPX code

### CHANGES 2019/09/XX:

Expand Down Expand Up @@ -488,6 +489,8 @@ Supported and tested full RGB Launchpad devices:

- Launchpad Pro
- Launchpad Mk2
- Launchpad Mk3 (soon)
- Launchpad LPX (soon)

Supported completely different stuff:

Expand Down Expand Up @@ -659,6 +662,18 @@ name it once shipped the first red/green LED with!
lp = launchpad.LaunchpadMk2()

### For Launchpad Mk3 users

USE CLASS "LaunchpadMk3":
lp = launchpad.LaunchpadMk3()

### For Launchpad X users

USE CLASS "LaunchpadLPX":
lp = launchpad.LaunchpadLPX()

### For Launch Control XL users

USE CLASS "LaunchControlXL":
Expand Down Expand Up @@ -911,7 +926,7 @@ Btw, the fireworks demo will play whenever the Launchpad cannot be enumerated (c


---
## Launchpad "Mk2" and "Pro" class methods overview (valid for RGB LED devices)
## Launchpad "Mk2/3" and "Pro" class methods overview (valid for RGB LED devices)

### LED functions

Expand Down Expand Up @@ -1361,7 +1376,7 @@ Functions requiring a color code have a "...ByCode" naming style.


---
## Detailed description of Launchpad "Pro" or "Mk2" only methods
## Detailed description of Launchpad "Pro" or "Mk2/3" only methods

### LedSetMode( mode ) *>>> PRO ONLY <<<*

Expand Down
6 changes: 4 additions & 2 deletions examples/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def main():

# experimental MK3 implementation
# The MK3 has two MIDI instances per device; we need the 2nd one.
# If you have two MK3s attached, its "1" for the first and "3" for the 2nd device
elif lp.Check( 1, "mk3" ):
lp = launchpad.LaunchpadMk3()
if lp.Open( 1, "mk3" ):
Expand All @@ -46,9 +47,10 @@ def main():

# experimental LPX implementation
# Like the Mk3, the LPX also has two MIDI instances per device; we need the 2nd one.
elif lp.Check( 0, "lpx" ):
# If you have two LPXs attached, its "1" for the first and "3" for the 2nd device
elif lp.Check( 1, "lpx" ):
lp = launchpad.LaunchpadLPX()
if lp.Open( 0, "lpx" ):
if lp.Open( 1, "lpx" ):
print("Launchpad X")
mode = "Pro"

Expand Down

0 comments on commit 3e3fc3b

Please sign in to comment.