Skip to content

Commit c98324b

Browse files
committed
added support for the Pro Mk3
1 parent b7c06c4 commit c98324b

File tree

9 files changed

+133
-60
lines changed

9 files changed

+133
-60
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ First [Mk3][21] and [X][22] Launchpad code snippets running now (4/2020).
2525

2626
Now with (some) [Midi Fighter 64][23] support (8/2020).
2727

28+
Finally! Hehe, say hello to the [Mk3 Pro][24] (8/2020)
2829

2930
---
3031
## STATUS 2020/08/xx:
@@ -41,6 +42,8 @@ What's hot, what's not?
4142

4243
Launchpad Pro - class "LaunchpadPro()" LEDs and buttons (digitally only (yet))
4344

45+
Launchpad Pro - class "LaunchpadProMk3()" EXPERIMENTAL
46+
4447
Launchpad Mini Mk3 - class "LaunchpadMiniMk3()" LEDs and buttons *** RENAMED 5/2020 ***
4548

4649
Launchpad X - class "LaunchpadLPX()" EXPERIMENTAL++ as in "should work quite well"
@@ -56,8 +59,16 @@ What's hot, what's not?
5659
Midi Fighter 64 - class "MidiFighter64" EXPERIMENTAL; LEDs and buttons
5760

5861

62+
> PRO MK3 USERS:
63+
> You need to disable the Launchpad's "Transmit Clock" in the MIDI settings!
64+
> See section "For Launchpad Pro Mk3 users"
65+
>
66+
> Also, every program shall end with either calling lp.Close() or calling
67+
> lp.SetLedMode( 0 ), to switch back to the Live mode.
68+
5969
Please notice that the class "LaunchpadMk3()" was renamed to "LaunchpadMiniMk3()" in 5/2020.
6070
This was necessary to avoid confusion with the device search string and the new "Pro-Mk3" Launchpad.
71+
The "Pro Mk3" now is in LaunchpadProMk3().
6172

6273
Please notice the changes in methods "Open()" and "Check()" for the Mini Mk3 and X.
6374
Also, see demo files "hello.py" or "launchpad_rgb.py" as a reference on how to use them.
@@ -89,6 +100,9 @@ Successfully tested with Ubuntu 18.04-LTS+. Requires compiling your own PyGame t
89100
- added a class for the Midi Fighter 64, only (raw) buttons so far
90101
- added MF64 LedCtrlRaw(), ButtonStateXY(), LedAllOn()
91102
- added MF64 LedCtrlXY()
103+
- added support for the Launchpad Pro Mk3
104+
- updated some demos to work with the Pro
105+
92106

93107
### CHANGES 2020/05/XX:
94108

@@ -274,6 +288,7 @@ Successfully tested with Ubuntu 18.04-LTS+. Requires compiling your own PyGame t
274288
---
275289
## Upcoming attractions, notes and thoughts
276290

291+
- "PK3": the Pro Mk3 has some issues; needs to be fixed
277292
- "All": New, officially recommended device selection code in all demo files
278293
- "M64": RGB to color code mapping
279294
- "M64": Add character and string methods for the Midi Fighter (requires RGB)
@@ -711,6 +726,19 @@ name it once shipped the first red/green LED with!
711726
As of 2016/01/24, the "Pro" is now automatically set to "Ableton Live mode",
712727
which is required for launchpad.py to work.
713728

729+
### For Launchpad Pro Mk3 users
730+
731+
USE CLASS "LaunchpadProMk3":
732+
733+
lp = launchpad.LaunchpadProMk3()
734+
735+
You need to disable the "Transmit Clock" in the Launchpad settings!
736+
Hold "Setup" and disable the 2nd LED from the left (must be red).
737+
738+
![RGB color palette](/images/promk3_transmit.png)
739+
740+
Otherwise you will be spammed by pressure events!
741+
714742
### For Launchpad Mk2 users
715743

716744
USE CLASS "LaunchpadMk2":
@@ -1000,7 +1028,9 @@ Btw, the fireworks demo will play whenever the Launchpad cannot be enumerated (c
10001028

10011029

10021030
---
1003-
## Launchpad "Mk2/3", "Pro" and "X" class methods overview (valid for RGB LED devices)
1031+
## Launchpad "Mk2/3", "Pro", "Pro Mk3" and "X" class methods overview (valid for RGB LED devices)
1032+
1033+
Please notice that the Mk3 does not yet have all of these.
10041034

10051035
### LED functions
10061036

@@ -2535,6 +2565,12 @@ There is no possibility to control the RGB LEDs individually.yle.
25352565
+---+---+---+---+---+---+---+---+
25362566

25372567

2568+
---
2569+
## Button and LED codes, Launchpad "Pro Mk3" (RGB LEDs)
2570+
2571+
TODO TODO TODO TODO
2572+
2573+
25382574
---
25392575
## Buttons, LED and potentiometer codes, Launch Control
25402576

@@ -2810,3 +2846,4 @@ FMMT666(ASkr)
28102846
[21]: https://twitter.com/FMMT666/status/1242950069923520519
28112847
[22]: https://twitter.com/FMMT666/status/1242978460454326272
28122848
[23]: https://twitter.com/FMMT666/status/1298372859383906305
2849+
[24]: https://twitter.com/FMMT666/status/1299478117497688073

examples/buttons_raw.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
#
33
# Quick button test.
4-
# Works with these Launchpads: Mk1, Mk2, Mini Mk3, S/Mini, Pro
4+
# Works with these Launchpads: Mk1, Mk2, Mini Mk3, S/Mini, Pro, Pro Mk3
55
# And these: Midi Figther 64
66
#
77
#
@@ -31,6 +31,12 @@ def main():
3131
if lp.Open( 0 ):
3232
print("Launchpad Pro")
3333
mode = "Pro"
34+
35+
elif launchpad.LaunchpadProMk3().Check( 0 ):
36+
lp = launchpad.LaunchpadProMk3()
37+
if lp.Open( 0 ):
38+
print("Launchpad Pro Mk3")
39+
mode = "ProMk3"
3440

3541
elif launchpad.LaunchpadMiniMk3().Check( 1 ):
3642
lp = launchpad.LaunchpadMiniMk3()

examples/buttons_xy.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
#
33
# Quick button test.
4-
# Works with these Launchpads: Mk1, Mk2, Mini Mk3, S/Mini, Pro
4+
# Works with these Launchpads: Mk1, Mk2, Mini Mk3, S/Mini, Pro, Pro Mk3
55
# And these: Midi Figther 64
66
#
77
#
@@ -31,7 +31,13 @@ def main():
3131
if lp.Open( 0 ):
3232
print("Launchpad Pro")
3333
mode = "Pro"
34-
34+
35+
elif launchpad.LaunchpadProMk3().Check( 0 ):
36+
lp = launchpad.LaunchpadProMk3()
37+
if lp.Open( 0 ):
38+
print("Launchpad Pro Mk3")
39+
mode = "ProMk3"
40+
3541
elif launchpad.LaunchpadMiniMk3().Check( 1 ):
3642
lp = launchpad.LaunchpadMiniMk3()
3743
if lp.Open( 1 ):
@@ -74,21 +80,33 @@ def main():
7480
print("Midi Fighter 64")
7581
mode = "F64"
7682

77-
else:
78-
if lp.Open():
83+
elif launchpad.Launchpad().Check( 0 ):
84+
lp = launchpad.Launchpad()
85+
if lp.Open( 0 ):
7986
print("Launchpad Mk1/S/Mini")
8087
mode = "Mk1"
8188

8289
if mode is None:
8390
print("Did not find any Launchpads, meh...")
8491
return
8592

86-
print("QUIT: That's on the TODO list. For now, just hit CTRL-C ...")
93+
print("QUIT: Push a single button for longer than 3s and release it.")
8794

95+
lastBut = (-99,-99)
96+
tStart = time.time()
8897
while True:
8998
buts = lp.ButtonStateXY()
9099
if buts != []:
91-
print( buts[0], buts[1], buts[2])
100+
print( buts[0], buts[1], buts[2] )
101+
102+
# quit?
103+
if buts[2] > 0:
104+
lastBut = ( buts[0], buts[1] )
105+
tStart = time.time()
106+
else:
107+
if lastBut == ( buts[0], buts[1] ) and (time.time() - tStart) > 2:
108+
break
109+
92110

93111
print("bye ...")
94112

examples/launchpad_rgb-fire.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Launchpad Fire Demo for Mk2, Mini Mk3, Pro, X
3+
# Launchpad Fire Demo for Mk2, Mini Mk3, Pro, X, Pro Mk3
44
#
55
#
66
# FMMT666(ASkr) 7/2013..8/2020
@@ -329,6 +329,16 @@ def __init__( self ):
329329
print( " - Launchpad Pro: ERROR")
330330
return
331331

332+
# try the first Pro Mk3
333+
elif lp.Check( 0, "mk3" ):
334+
lp = launchpad.LaunchpadProMk3()
335+
if lp.Open( 0 ):
336+
print( " - Launchpad Pro Mk3: OK" )
337+
self.mode = "promk3"
338+
else:
339+
print( " - Launchpad Pro Mk3: ERROR")
340+
return
341+
332342
# try the first X
333343
# Notice that this is already built-in in the LPX class' methods Check() and Open,
334344
# but we're using the one from above!
@@ -349,6 +359,13 @@ def __init__( self ):
349359
self.lp = lp
350360

351361

362+
#-------------------------------------------------------------------------------------
363+
#--
364+
#-------------------------------------------------------------------------------------
365+
def Close( self ):
366+
if self.mode == "promk3":
367+
self.lp.LedSetMode( 0 )
368+
352369

353370
#-------------------------------------------------------------------------------------
354371
#--
@@ -398,7 +415,7 @@ def UpdateRow( self, y, values ):
398415
#--
399416
#-------------------------------------------------------------------------------------
400417
def ButtonGet( self ):
401-
if self.mode == "pro":
418+
if self.mode == "pro" or self.mode == "promk3":
402419
return self.lp.ButtonStateXY( mode = "pro" )
403420
elif self.mode == "mk3" or self.mode == "lpx":
404421
return self.lp.ButtonStateXY( mode = "classic" )
@@ -467,3 +484,5 @@ def ButtonFlush( self ):
467484
break
468485

469486
lpDis.Clear()
487+
lpDis.Close()
488+

examples/launchpad_rgb-pulse.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ def main():
3535
if lp.Open(0,"pad pro"):
3636
print("Launchpad Pro")
3737
mode = "Pro"
38+
39+
elif lp.Check( 0, "promk3" ):
40+
lp = launchpad.LaunchpadProMk3()
41+
if lp.Open( 0 ):
42+
print("Launchpad Pro Mk3")
43+
mode = "ProMk3"
3844

39-
elif lp.Check( 0, "mk2" ):
40-
lp = launchpad.LaunchpadMk2()
41-
if lp.Open( 0, "mk2" ):
42-
print("Launchpad Mk2")
43-
mode = "Mk2"
4445

4546
elif lp.Check( 1, "minimk3" ):
4647
lp = launchpad.LaunchpadMiniMk3()

examples/launchpad_rgb.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ def main():
6666
print( " - Launchpad Pro: ERROR")
6767
return
6868

69+
# try the first Pro Mk3
70+
elif lp.Check( 0, "promk3" ):
71+
lp = launchpad.LaunchpadProMk3()
72+
if lp.Open( 0 ):
73+
print( " - Launchpad Pro Mk3: OK" )
74+
else:
75+
print( " - Launchpad Pro Mk3: ERROR")
76+
return
77+
6978
# try the first X
7079
# Notice that this is already built-in in the LPX class' methods Check() and Open,
7180
# but we're using the one from above!

examples/midi_events.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ def main():
7272
print("===")
7373
print("Now hit the keys, turn the knobs or push the buttons:")
7474

75+
# DEBUG STUFF
76+
# lp.midi.RawWriteSysEx( [ 0, 32, 41, 2, 14, 14, 1 ] ) # Pro Mk3 programmer's mode ON
77+
# lp.midi.RawWriteSysEx( [ 0, 32, 41, 2, 14, 14, 0 ] ) # Pro Mk3 programmer's mode OFF (Live mode)
78+
7579
while(True):
7680
events = lp.EventRaw()
7781
if events != []:

images/promk3_transmit.png

61.8 KB
Loading

0 commit comments

Comments
 (0)